Skip to content

Commit 7af9503

Browse files
ericyangpanclaude
andcommitted
build: add Biome formatter and linter with development tooling
- Add Biome configuration with consistent code style rules - Configure formatter with single quotes, semicolons, and 100 line width - Setup linter with recommended rules and custom overrides - Add Husky pre-commit hook for lint-staged - Add VSCode settings for Biome integration - Update package.json with Biome scripts and dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5852e11 commit 7af9503

File tree

6 files changed

+931
-100
lines changed

6 files changed

+931
-100
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["biomejs.biome", "streetsidesoftware.code-spell-checker"]
3+
}

.vscode/settings.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "biomejs.biome",
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.biome": "explicit"
6+
},
7+
"[javascript]": {
8+
"editor.defaultFormatter": "biomejs.biome"
9+
},
10+
"[javascriptreact]": {
11+
"editor.defaultFormatter": "biomejs.biome"
12+
},
13+
"[typescript]": {
14+
"editor.defaultFormatter": "biomejs.biome"
15+
},
16+
"[typescriptreact]": {
17+
"editor.defaultFormatter": "biomejs.biome"
18+
},
19+
"[json]": {
20+
"editor.defaultFormatter": "vscode.json-language-features"
21+
},
22+
"[jsonc]": {
23+
"editor.defaultFormatter": "biomejs.biome"
24+
}
25+
}

biome.json

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.6/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"includes": ["**", "!cloudflare-env.d.ts"]
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "space",
15+
"indentWidth": 2,
16+
"lineWidth": 100
17+
},
18+
"linter": {
19+
"enabled": true,
20+
"rules": {
21+
"recommended": true,
22+
"a11y": {
23+
"useButtonType": "warn"
24+
},
25+
"style": {
26+
"noNonNullAssertion": "off",
27+
"useImportType": "warn"
28+
},
29+
"suspicious": {
30+
"noExplicitAny": "warn",
31+
"noArrayIndexKey": "warn",
32+
"noDocumentCookie": "warn",
33+
"useIterableCallbackReturn": "warn"
34+
},
35+
"correctness": {
36+
"useExhaustiveDependencies": "warn",
37+
"noUnusedVariables": "warn"
38+
}
39+
}
40+
},
41+
"javascript": {
42+
"formatter": {
43+
"quoteStyle": "single",
44+
"jsxQuoteStyle": "double",
45+
"semicolons": "asNeeded",
46+
"trailingCommas": "es5",
47+
"arrowParentheses": "asNeeded"
48+
}
49+
},
50+
"json": {
51+
"formatter": {
52+
"indentStyle": "space",
53+
"indentWidth": 2
54+
}
55+
},
56+
"css": {
57+
"parser": {
58+
"cssModules": false,
59+
"tailwindDirectives": true
60+
}
61+
},
62+
"assist": {
63+
"enabled": true,
64+
"actions": {
65+
"source": {
66+
"organizeImports": "on"
67+
}
68+
}
69+
},
70+
"overrides": [
71+
{
72+
"includes": ["**/*.mdx"],
73+
"linter": {
74+
"enabled": false
75+
}
76+
},
77+
{
78+
"includes": ["src/app/*/layout.tsx", "src/components/JsonLd.tsx"],
79+
"linter": {
80+
"rules": {
81+
"security": {
82+
"noDangerouslySetInnerHtml": "off"
83+
}
84+
}
85+
}
86+
}
87+
]
88+
}

0 commit comments

Comments
 (0)