forked from expatfile/next-runtime-env
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbiome.jsonc
More file actions
203 lines (189 loc) · 13.2 KB
/
biome.jsonc
File metadata and controls
203 lines (189 loc) · 13.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
{
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// ◆ VCS INTEGRATION
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true // Respect .gitignore patterns
},
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// ◆ FILE HANDLING
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"files": {
"ignoreUnknown": true // Don't error on unknown file types (MD/JSON/YAML handled by Prettier)
},
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// ◆ FORMATTER CONFIGURATION
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 120
},
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// ◆ JAVASCRIPT/TYPESCRIPT FORMATTING
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"javascript": {
"formatter": {
"quoteStyle": "single", // JS: 'single quotes'
"jsxQuoteStyle": "double", // JSX: "double quotes"
"trailingCommas": "all", // Add trailing commas everywhere
"semicolons": "asNeeded", // Only when required
"arrowParentheses": "always" // (param) => {}
}
},
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// ◆ LINTER CONFIGURATION
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"linter": {
"enabled": true,
"rules": {
"recommended": true,
// ────────────────────────────────────────────────────────────────────
// → Accessibility Rules (React/JSX)
// ────────────────────────────────────────────────────────────────────
"a11y": {
"noAccessKey": "error",
"noAriaUnsupportedElements": "error",
"noAutofocus": "warn",
"noDistractingElements": "error",
"noHeaderScope": "error",
"noInteractiveElementToNoninteractiveRole": "error",
"noNoninteractiveElementToInteractiveRole": "error",
"noNoninteractiveTabindex": "error",
"noPositiveTabindex": "error",
"noRedundantAlt": "error",
"noRedundantRoles": "error",
"noStaticElementInteractions": "warn",
"useFocusableInteractive": "error",
"useSemanticElements": "off",
"useKeyWithClickEvents": "error",
"useKeyWithMouseEvents": "error",
"useValidAnchor": "error"
},
// ────────────────────────────────────────────────────────────────────
// → Complexity Rules
// ────────────────────────────────────────────────────────────────────
"complexity": {
"useLiteralKeys": "off", // Allow computed object keys
"noStaticOnlyClass": "off" // Allow static-only classes for namespace pattern
},
// ────────────────────────────────────────────────────────────────────
// → Correctness Rules
// ────────────────────────────────────────────────────────────────────
"correctness": {
"noChildrenProp": "error",
"noRenderReturnValue": "error",
"noVoidElementsWithChildren": "error",
"useHookAtTopLevel": "error",
"useJsxKeyInIterable": "error",
"noUnusedVariables": "warn", // Warn for flexibility
"useExhaustiveDependencies": "warn" // Warn for React hooks
},
// ────────────────────────────────────────────────────────────────────
// → Performance Rules
// ────────────────────────────────────────────────────────────────────
"performance": {
"noImgElement": "off" // Next.js Image component handles optimization
},
// ────────────────────────────────────────────────────────────────────
// → Security Rules
// ────────────────────────────────────────────────────────────────────
"security": {
"noDangerouslySetInnerHtml": "off" // Allow for trusted content
},
// ────────────────────────────────────────────────────────────────────
// → Style Rules
// ────────────────────────────────────────────────────────────────────
"style": {
"noInferrableTypes": "error",
"noNonNullAssertion": "warn",
"noParameterAssign": "error",
"noUnusedTemplateLiteral": "error",
"noUselessElse": "error",
"useAsConstAssertion": "error",
"useConst": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useImportType": "off", // Allow value imports
"useNumberNamespace": "error",
"useSelfClosingElements": "error",
"useShorthandFunctionType": "error",
"useSingleVarDeclarator": "error",
"noImplicitBoolean": "error",
"useTemplate": "error"
},
// ────────────────────────────────────────────────────────────────────
// → Suspicious Code Patterns
// ────────────────────────────────────────────────────────────────────
"suspicious": {
"noArrayIndexKey": "off", // Allow array indices as React keys
"noCommentText": "error",
"noDuplicateJsxProps": "error",
"noExplicitAny": "off", // Allow 'any' type for flexibility
"noConsole": "off", // Allow console.log for debugging
"noVar": "error" // Enforce const/let over var
}
}
},
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// ◆ CODE ASSIST FEATURES
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"assist": {
"enabled": true,
"actions": {
"source": {
"useSortedAttributes": "on" // Auto-sort JSX attributes only
// useSortedKeys disabled - preserve intentional key ordering
}
}
},
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// ◆ FILE-SPECIFIC OVERRIDES
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"overrides": [
{
// ────────────────────────────────────────────────────────────────
// → VitePress Theme (skip linting - uses non-standard CSS)
// ────────────────────────────────────────────────────────────────
"includes": ["docs/.vitepress/theme/**"],
"linter": {
"enabled": false
},
"formatter": {
"enabled": false
}
},
{
// ────────────────────────────────────────────────────────────────
// → JSON Configuration Files
// ────────────────────────────────────────────────────────────────
"includes": ["**/.vscode/*.json", "**/tsconfig*.json"],
"json": {
"parser": {
"allowComments": true, // Allow // comments in JSON
"allowTrailingCommas": true // Allow trailing commas
}
}
},
{
// ────────────────────────────────────────────────────────────────
// → Test Files (allow more flexibility)
// ────────────────────────────────────────────────────────────────
"includes": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off" // Allow 'any' in tests
},
"correctness": {
"noUnusedVariables": "off" // Test setup may have unused vars
}
}
}
}
]
}