-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbiome.jsonc
More file actions
270 lines (266 loc) · 9.17 KB
/
biome.jsonc
File metadata and controls
270 lines (266 loc) · 9.17 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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
{
"$schema": "https://biomejs.dev/schemas/2.4.0/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "beta"
},
"formatter": {
"enabled": true,
"useEditorconfig": true,
"indentStyle": "space",
"lineWidth": 120
},
"files": {
"ignoreUnknown": true,
// Adding folders to the ignore list is GREAT for performance because it prevents biome from descending into them
// and having to verify whether each individual file is ignored
"includes": [
"**",
"!.github/**/*.*", // workaround due to bug/design limitation, should be `"!.github"`
".github/**/*.ts",
".github/**/*.mts",
"!!.vscode",
"!!build",
"!!coverage",
"!!dist",
"!!docs",
"!public/**/*.*", // workaround due to bug/design limitation, should be `"!public"`
"public/service-worker.js",
"!!typedoc",
"!pnpm-lock.yml",
// this file is too big
"!src/data/tms.ts"
]
},
"assist": {
"actions": {
"source": {
"organizeImports": {
"level": "on",
"options": {
"groups": [":ALIAS:", ":NODE:", ":PACKAGE_WITH_PROTOCOL:", ":PACKAGE:", ":PATH:"]
}
}
}
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true, // see https://biomejs.dev/linter/javascript/rules/#recommended-rules and https://biomejs.dev/linter/css/rules/#recommended-rules
"correctness": {
"noUndeclaredVariables": "off", // handled by TypeScript
"noUnusedVariables": "error",
"noSwitchDeclarations": "error",
"noVoidTypeReturn": "error",
"noUnusedImports": {
"level": "error",
"fix": "safe",
"options": {}
},
"noUnusedFunctionParameters": "error",
"noUnusedLabels": "error",
"noPrivateImports": "error",
"noUndeclaredDependencies": "error",
"useJsonImportAttributes": "off", // "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. ts(2823)"
"useSingleJsDocAsterisk": "error",
"noUnusedPrivateClassMembers": "error"
},
"style": {
"useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome
"useBlockStatements": "error",
"useConst": "error",
"useImportType": "error",
"noNonNullAssertion": "off", // TODO: fix all non-null assertions in non-test files and turn this on
"noParameterAssign": "info", // TODO: refactor and make "error"
"useExponentiationOperator": "off", // Too typo-prone and easy to mixup with standard multiplication (* vs **)
"useDefaultParameterLast": "error",
"useSingleVarDeclarator": "error",
"useNodejsImportProtocol": "error",
"useTemplate": "off", // string concatenation is faster: https://stackoverflow.com/questions/29055518/are-es6-template-literals-faster-than-string-concatenation
"noInferrableTypes": "off", // Explicit > Implicit
"useConsistentArrayType": "error", // Standardize on `T[]`
"useFilenamingConvention": {
"level": "error",
"options": {
"filenameCases": ["kebab-case"],
"requireAscii": true,
"strictCase": false
}
},
"useAsConstAssertion": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noUselessElse": "error",
"noCommonJs": "error",
"noRestrictedTypes": {
"level": "error",
"options": {
"types": {
"integer": {
"message": "This is an alias for 'number' that can provide false impressions of what values can actually be contained in this variable. Use 'number' instead.",
"use": "number"
}
}
}
},
"useConsistentMemberAccessibility": {
"level": "off", // TODO: refactor and make this an error
"options": {
"accessibility": "explicit"
}
},
"useShorthandAssign": "error",
"useGroupedAccessorPairs": "error",
"useObjectSpread": "error",
"useNumericSeparators": "off", // TODO: enable?
"noNamespace": "error",
"noDefaultExport": "error",
"noShoutyConstants": "error",
"noSubstr": "error",
"noYodaExpression": "error",
"useThrowNewError": "error",
"useThrowOnlyError": "error",
"useTrimStartEnd": "error",
"useForOf": "error",
"useConsistentObjectDefinitions": "error",
"useConsistentBuiltinInstantiation": "error",
"useCollapsedIf": "error",
"useCollapsedElseIf": "error",
"noNegationElse": "error",
"noParameterProperties": "error", // a step toward enabling `erasableSyntaxOnly` in `tsconfig.json`
"useAtIndex": "error",
"useReadonlyClassProperties": "error",
"useExplicitLengthCheck": "info", // TODO: refactor and make "error"
"noNestedTernary": "error"
},
"suspicious": {
"noDoubleEquals": "error",
"noExplicitAny": "off", // TODO: Refactor and make this an error
"noAssignInExpressions": "error",
"noPrototypeBuiltins": "error",
"noFallthroughSwitchClause": "error", // Prevents accidental automatic fallthroughs in switch cases (use disable comment if needed)
"noImplicitAnyLet": "error",
"noRedeclare": "error",
"noGlobalIsNan": "error",
"noAsyncPromiseExecutor": "warn", // TODO: Refactor and make this an error
"useDefaultSwitchClauseLast": "error",
"noVar": "error",
"noDocumentCookie": "off", // Firefox has minimal support for the "Cookie Store API"
"noConstantBinaryExpressions": "error",
"noTsIgnore": "error",
"useIterableCallbackReturn": {
"level": "error",
"options": {
"checkForEach": false
}
},
"useErrorMessage": "error",
"useGuardForIn": "error",
"useNumberToFixedDigitsArgument": "error",
"noEvolvingTypes": "error",
"noNonNullAssertedOptionalChain": "error",
"noImportCycles": "error" // overlaps with depcruiser but this will allow diagnostics to be shown in the IDE
},
"complexity": {
"noExcessiveCognitiveComplexity": "info",
"useLiteralKeys": "off",
"noForEach": "off", // Foreach vs for of is not that simple.
"noUselessSwitchCase": "off", // Explicit > Implicit
"noUselessConstructor": "error",
"noBannedTypes": "error",
"useRegexLiterals": "off", // Was broken for some reason; TODO: re-enable
"noThisInStatic": "error",
"noUselessThisAlias": "error",
"noUselessTernary": "error",
"useIndexOf": "error",
"noVoid": "error",
"useWhile": "error",
"noUselessStringConcat": "error",
"noUselessUndefined": "error"
},
"nursery": {
"noShadow": "error",
"useExplicitType": "off", // TODO: refactor and make "error"
"noFloatingPromises": "warn", // TODO: refactor and make "error"
"noMisusedPromises": "warn", // TODO: refactor and make "error"
"useExhaustiveSwitchCases": "error",
"noUnnecessaryConditions": "off", // TODO: enable when the false positives are fixed
"useArraySortCompare": "error",
"useFind": "error",
"noParametersOnlyUsedInRecursion": "error",
"useSpread": "error",
"noProto": "error",
"noMultiStr": "error",
"useRegexpExec": "error",
"noReturnAssign": "error",
"noMultiAssign": "error"
},
"performance": {
"noNamespaceImport": "error",
"noDelete": "error",
"noAwaitInLoops": "off", // Necessary for our codebase
"noBarrelFile": "error"
}
}
},
"javascript": {
"formatter": {
"operatorLinebreak": "before"
},
"parser": {
"jsxEverywhere": false
}
},
"css": {
"formatter": {
"enabled": false
}
},
"overrides": [
{
"includes": ["**/test/**"],
"javascript": { "globals": [] },
"linter": {
"rules": {
"performance": {
"noDelete": "off", // TODO: evaluate if this is necessary for the test(s) to function
"noNamespaceImport": "off"
},
"style": {
"noNonNullAssertion": "off" // tests are able to make assumptions about the game state that normally can't be made
},
"nursery": {
"noFloatingPromises": "error"
}
}
}
},
{
// This section is to improve the bug tester workflow
"includes": ["src/overrides.ts"],
"linter": {
"rules": {
"correctness": {
"noUnusedImports": "off"
},
"style": {
"useImportType": "off"
}
}
}
},
{
"includes": ["src/plugins/i18n.ts", "**/vite.config.ts", "**/vitest.config.ts"],
"linter": {
"rules": {
"style": {
"noDefaultExport": "off"
}
}
}
}
]
}