Skip to content

Commit d26b3a8

Browse files
committed
use biome to format
1 parent e32ff5a commit d26b3a8

File tree

5 files changed

+136
-6
lines changed

5 files changed

+136
-6
lines changed

biome.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3+
"formatter": {
4+
"enabled": true,
5+
"formatWithErrors": false,
6+
"indentStyle": "space",
7+
"indentWidth": 2,
8+
"lineEnding": "lf",
9+
"lineWidth": 120,
10+
"attributePosition": "auto",
11+
"ignore": ["**/*.min.js", "**/*.min.css", "source/js_complied"]
12+
},
13+
"organizeImports": { "enabled": true },
14+
"linter": { "enabled": true, "rules": { "recommended": true } },
15+
"javascript": {
16+
"formatter": {
17+
"jsxQuoteStyle": "double",
18+
"quoteProperties": "asNeeded",
19+
"trailingCommas": "all",
20+
"semicolons": "always",
21+
"arrowParentheses": "always",
22+
"bracketSpacing": true,
23+
"bracketSameLine": false,
24+
"quoteStyle": "single",
25+
"attributePosition": "auto"
26+
}
27+
}
28+
}

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"private": true,
55
"scripts": {
66
"format:stylus": "stylus-supremacy format ./source/css/**/*.styl -r --options .supermacy.yml",
7-
"format:pretty": "prettier --write ./{includes,languages,layout,scripts,source,src}/**/*.{pug,js,css,ts,tsx,jsx}",
7+
"format:pretty": "prettier --write ./layout/**/*.pug",
8+
"format:biome": "biome format --write includes languages scripts source src",
89
"lint": "eslint . --fix",
9-
"format": "pnpm format:stylus && pnpm format:pretty",
10+
"format": "pnpm format:stylus && pnpm format:biome && pnpm format:pretty",
1011
"build": "rollup -c ./rollup.config.mjs"
1112
},
1213
"dependencies": {
@@ -17,6 +18,7 @@
1718
"typescript": "^5.5.4"
1819
},
1920
"devDependencies": {
21+
"@biomejs/biome": "1.8.3",
2022
"@prettier/plugin-pug": "^3.0.0",
2123
"@swc/core": "^1.7.23",
2224
"eslint": "^9.4.0",

pnpm-lock.yaml

+91
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/search.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,16 @@ export class AnatoloSearch extends Component {
204204
Fuse.config.ignoreLocation = true;
205205
Fuse.config.includeMatches = true;
206206

207-
this.fuses.posts = new Fuse(data.posts, { keys: ['title', 'text', 'link'] });
208-
this.fuses.pages = new Fuse(data.pages, { keys: ['title', 'text', 'link'] });
207+
this.fuses.posts = new Fuse(data.posts, {
208+
keys: ['title', 'text', 'link'],
209+
});
210+
this.fuses.pages = new Fuse(data.pages, {
211+
keys: ['title', 'text', 'link'],
212+
});
209213
this.fuses.tags = new Fuse(data.tags, { keys: ['name', 'slug', 'link'] });
210-
this.fuses.categories = new Fuse(data.categories, { keys: ['name', 'slug', 'link'] });
214+
this.fuses.categories = new Fuse(data.categories, {
215+
keys: ['name', 'slug', 'link'],
216+
});
211217

212218
this.fuse_ok.value = true;
213219
}

src/utils/load-script.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export async function loadScript(config: { url?: string | null; script?: string | null }) {
1+
export async function loadScript(config: {
2+
url?: string | null;
3+
script?: string | null;
4+
}) {
25
if (config.url) {
36
config.script = await fetch(config.url).then((r) => r.text());
47
}

0 commit comments

Comments
 (0)