Skip to content

Commit dcfe766

Browse files
authored
Simply BiomeJS configuration (#606)
1 parent 244e7d9 commit dcfe766

File tree

3 files changed

+23
-175
lines changed

3 files changed

+23
-175
lines changed

lefthook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pre-commit:
22
commands:
33
check:
44
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
5-
run: npx --yes @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
5+
run: npx --yes @biomejs/biome check --write --error-on-warnings --no-errors-on-unmatched --colors=off {staged_files}
66
stage_fixed: true
77
rustywind:
88
glob: "*.{js,ts,jsx,tsx}"

react/biome.json

Lines changed: 21 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -1,199 +1,47 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"files": {
4+
"ignoreUnknown": true
5+
},
36
"formatter": {
47
"enabled": true,
5-
"formatWithErrors": false,
68
"indentStyle": "space",
79
"indentWidth": 2,
810
"lineEnding": "lf",
911
"lineWidth": 80,
1012
"attributePosition": "auto",
11-
"ignore": [
12-
"**/node_modules/",
13-
"**/.husky/",
14-
"**/.vim/",
15-
"**/.vscode/",
16-
"**/.yarn/",
17-
"**/public/",
18-
"**/.env",
19-
"**/.env.example",
20-
"react/src/index.css"
21-
]
13+
"ignore": ["**/node_modules/", "**/.vscode/", "**/.idea", "**/public/"]
2214
},
23-
"organizeImports": { "enabled": true },
2415
"linter": {
2516
"enabled": true,
2617
"rules": {
27-
"recommended": false,
28-
"a11y": { "noBlankTarget": "error" },
29-
"complexity": {
30-
"noExtraBooleanCast": "error",
31-
"noMultipleSpacesInRegularExpressionLiterals": "error",
32-
"noUselessCatch": "error",
33-
"noUselessThisAlias": "error",
34-
"noUselessTypeConstraint": "error",
35-
"noWith": "error",
36-
"useLiteralKeys": "error",
37-
"useOptionalChain": "error"
38-
},
39-
"correctness": {
40-
"noChildrenProp": "error",
41-
"noConstAssign": "error",
42-
"noConstantCondition": "error",
43-
"noEmptyCharacterClassInRegex": "error",
44-
"noEmptyPattern": "error",
45-
"noGlobalObjectCalls": "error",
46-
"noInnerDeclarations": "error",
47-
"noInvalidConstructorSuper": "error",
48-
"noInvalidNewBuiltin": "error",
49-
"noNewSymbol": "error",
50-
"noNonoctalDecimalEscape": "error",
51-
"noPrecisionLoss": "error",
52-
"noSelfAssign": "error",
53-
"noSetterReturn": "error",
54-
"noSwitchDeclarations": "error",
55-
"noUndeclaredVariables": "error",
56-
"noUnreachable": "error",
57-
"noUnreachableSuper": "error",
58-
"noUnsafeFinally": "error",
59-
"noUnsafeOptionalChaining": "error",
60-
"noUnusedLabels": "error",
61-
"noUnusedPrivateClassMembers": "error",
62-
"noUnusedVariables": "error",
63-
"useArrayLiterals": "off",
64-
"useExhaustiveDependencies": "warn",
65-
"useHookAtTopLevel": "error",
66-
"useIsNan": "error",
67-
"useJsxKeyInIterable": "error",
68-
"useValidForDirection": "error",
69-
"useYield": "error",
70-
"noUnusedImports": {
71-
"level": "warn",
72-
"fix": "safe"
73-
}
74-
},
75-
"security": { "noDangerouslySetInnerHtmlWithChildren": "error" },
76-
"style": {
77-
"noInferrableTypes": "error",
78-
"noNamespace": "error",
79-
"useAsConstAssertion": "error",
80-
"useConsistentArrayType": "error",
81-
"useForOf": "error",
82-
"useShorthandFunctionType": "error"
83-
},
84-
"suspicious": {
85-
"noAssignInExpressions": "error",
86-
"noAsyncPromiseExecutor": "error",
87-
"noCatchAssign": "error",
88-
"noClassAssign": "error",
89-
"noCommentText": "error",
90-
"noCompareNegZero": "error",
91-
"noControlCharactersInRegex": "error",
92-
"noDebugger": "error",
93-
"noDuplicateCase": "error",
94-
"noDuplicateClassMembers": "error",
95-
"noDuplicateJsxProps": "error",
96-
"noDuplicateObjectKeys": "error",
97-
"noDuplicateParameters": "error",
98-
"noEmptyBlockStatements": "error",
99-
"noExplicitAny": "error",
100-
"noExtraNonNullAssertion": "error",
101-
"noFallthroughSwitchClause": "error",
102-
"noFunctionAssign": "error",
103-
"noGlobalAssign": "error",
104-
"noImportAssign": "error",
105-
"noMisleadingCharacterClass": "error",
106-
"noMisleadingInstantiator": "error",
107-
"noPrototypeBuiltins": "error",
108-
"noRedeclare": "error",
109-
"noShadowRestrictedNames": "error",
110-
"noUnsafeDeclarationMerging": "error",
111-
"noUnsafeNegation": "error",
112-
"useAwait": "error",
113-
"useGetterReturn": "error",
114-
"useNamespaceKeyword": "error",
115-
"useValidTypeof": "error"
116-
}
18+
"recommended": true
11719
},
118-
"ignore": ["**/dist", "**/.eslintrc.cjs", "src/index.css"]
20+
"ignore": ["**/node_modules/", "**/dist", "**/.eslintrc.cjs"]
11921
},
120-
"javascript": {
22+
"organizeImports": { "enabled": true },
23+
"json": {
24+
"parser": {
25+
"allowComments": true
26+
}
27+
},
28+
"css": {
29+
"parser": {
30+
"cssModules": true
31+
},
32+
"linter": {
33+
"enabled": false
34+
},
12135
"formatter": {
122-
"jsxQuoteStyle": "double",
123-
"quoteProperties": "asNeeded",
124-
"trailingCommas": "all",
125-
"semicolons": "asNeeded",
126-
"arrowParentheses": "always",
127-
"bracketSpacing": true,
128-
"bracketSameLine": false,
129-
"quoteStyle": "single",
130-
"attributePosition": "auto"
36+
"enabled": false
13137
}
13238
},
13339
"overrides": [
13440
{
13541
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
13642
"linter": {
13743
"rules": {
138-
"correctness": {
139-
"noConstAssign": "off",
140-
"noGlobalObjectCalls": "off",
141-
"noInvalidConstructorSuper": "off",
142-
"noInvalidNewBuiltin": "off",
143-
"noNewSymbol": "off",
144-
"noSetterReturn": "off",
145-
"noUndeclaredVariables": "off",
146-
"noUnreachable": "off",
147-
"noUnreachableSuper": "off"
148-
},
149-
"style": {
150-
"noArguments": "error",
151-
"noVar": "error",
152-
"useConst": "error"
153-
},
154-
"suspicious": {
155-
"noDuplicateClassMembers": "off",
156-
"noDuplicateObjectKeys": "off",
157-
"noDuplicateParameters": "off",
158-
"noFunctionAssign": "off",
159-
"noImportAssign": "off",
160-
"noRedeclare": "off",
161-
"noUnsafeNegation": "off",
162-
"useGetterReturn": "off"
163-
}
164-
}
165-
}
166-
},
167-
{
168-
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
169-
"linter": {
170-
"rules": {
171-
"correctness": {
172-
"noConstAssign": "off",
173-
"noGlobalObjectCalls": "off",
174-
"noInvalidConstructorSuper": "off",
175-
"noInvalidNewBuiltin": "off",
176-
"noNewSymbol": "off",
177-
"noSetterReturn": "off",
178-
"noUndeclaredVariables": "off",
179-
"noUnreachable": "off",
180-
"noUnreachableSuper": "off"
181-
},
182-
"style": {
183-
"noArguments": "error",
184-
"noVar": "error",
185-
"useConst": "error"
186-
},
187-
"suspicious": {
188-
"noDuplicateClassMembers": "off",
189-
"noDuplicateObjectKeys": "off",
190-
"noDuplicateParameters": "off",
191-
"noFunctionAssign": "off",
192-
"noImportAssign": "off",
193-
"noRedeclare": "off",
194-
"noUnsafeNegation": "off",
195-
"useGetterReturn": "off"
196-
}
44+
"recommended": true
19745
}
19846
}
19947
}

react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dev": "vite",
88
"build": "tsc && vite build",
99
"preview": "vite preview",
10-
"check": "biome check --write src",
10+
"check": "biome check --write --error-on-warnings --no-errors-on-unmatched src",
1111
"postinstall": "lefthook install",
1212
"serve": "serve /website/dist --no-clipboard"
1313
},

0 commit comments

Comments
 (0)