|
1 | 1 | { |
2 | 2 | "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", |
| 3 | + "extends": [ |
| 4 | + "@chainsafe/biomejs-config", |
| 5 | + "@chainsafe/biomejs-config/recommended", |
| 6 | + "@chainsafe/biomejs-config/nodejs", |
| 7 | + "@chainsafe/biomejs-config/esm" |
| 8 | + ], |
3 | 9 | "vcs": { |
4 | | - "clientKind": "git", |
5 | | - "enabled": true, |
6 | | - "useIgnoreFile": true, |
7 | 10 | "defaultBranch": "unstable" |
8 | 11 | }, |
9 | 12 | "files": { |
10 | 13 | "include": ["packages/*/src/**/*.ts", "packages/*/test/**/*.ts", "configs/**/*.ts", "./vitest.config.ts"] |
11 | 14 | }, |
12 | 15 | "formatter": { |
13 | | - "enabled": true, |
14 | | - "formatWithErrors": true, |
15 | | - "useEditorconfig": true, |
16 | | - "lineWidth": 120, |
17 | | - "attributePosition": "auto", |
18 | | - "bracketSpacing": false, |
19 | 16 | "ignore": ["**/lib", "**/.nyc_output", "./packages/*/spec-tests", "**/node_modules", "./packages/*/node_modules/**"] |
20 | 17 | }, |
21 | 18 | "organizeImports": { |
22 | 19 | "enabled": true |
23 | 20 | }, |
24 | 21 | "linter": { |
25 | | - "enabled": true, |
26 | 22 | "rules": { |
27 | | - "recommended": true, |
28 | 23 | "correctness": { |
29 | | - "noUnusedVariables": "error", |
30 | 24 | "useImportExtensions": { |
31 | 25 | "level": "error", |
32 | 26 | "options": { |
|
37 | 31 | } |
38 | 32 | } |
39 | 33 | } |
40 | | - }, |
41 | | - "useArrayLiterals": "error", |
42 | | - "noUndeclaredVariables": "error", |
43 | | - // TODO: We want this rule but it's not working properly with mono repos |
44 | | - "noUndeclaredDependencies": "off" |
| 34 | + } |
45 | 35 | }, |
46 | 36 | "performance": { |
47 | 37 | // This rule should be enabled but with considerations and careful review |
|
58 | 48 | "deniedGlobals": ["fetch"] |
59 | 49 | } |
60 | 50 | }, |
61 | | - // We prefer to use `Math.pow` over `**` operator |
62 | | - "useExponentiationOperator": "off", |
63 | 51 | // In some cases the enums are initialized with values of other enums |
64 | 52 | "useLiteralEnumMembers": "off", |
65 | | - // We prefer to have multiple declarations lines |
66 | | - "useSingleVarDeclarator": "off", |
67 | 53 | // We use `+` operator for string concatenation a lot |
68 | 54 | "useTemplate": "off", |
69 | 55 | // We use to export types and object without differentiating |
70 | 56 | "useExportType": "off", |
71 | 57 | // We use to import types and object without differentiating |
72 | 58 | "useImportType": "off", |
73 | | - // It's nice to use `Number` namespace but should be done in a separate PR |
74 | | - "useNumberNamespace": "off", |
75 | 59 | // We prefer to auto-initialize enums |
76 | 60 | "useEnumInitializers": "off", |
77 | | - // Namespaces are deprecated way to organize modules in TS |
78 | | - "noNamespace": "error", |
79 | 61 | "useNamingConvention": { |
80 | 62 | "level": "error", |
81 | 63 | "options": { |
|
101 | 83 | }, |
102 | 84 | "formats": ["camelCase", "snake_case", "PascalCase", "CONSTANT_CASE"] |
103 | 85 | }, |
104 | | - { |
105 | | - "selector": { |
106 | | - "kind": "enum" |
107 | | - }, |
108 | | - "formats": ["PascalCase"] |
109 | | - }, |
110 | 86 | { |
111 | 87 | "selector": { |
112 | 88 | "kind": "objectLiteralProperty" |
|
167 | 143 | } |
168 | 144 | }, |
169 | 145 | "suspicious": { |
170 | | - // `void` as type is useful in our case when used as generic constraint e.g. K extends number | void |
171 | | - "noConfusingVoidType": "off", |
172 | 146 | // There is a lot of empty code blocks, should be enabled and clean up separately. |
173 | | - "noEmptyBlockStatements": "off", |
174 | | - "noConsoleLog": "error" |
| 147 | + "noEmptyBlockStatements": "off" |
175 | 148 | }, |
176 | 149 | "nursery": { |
177 | | - "useConsistentMemberAccessibility": { |
178 | | - "level": "error", |
179 | | - "options": { |
180 | | - "accessibility": "noPublic" |
181 | | - } |
182 | | - }, |
183 | | - "noCommonJs": "error", |
184 | | - "noRestrictedImports": { |
185 | | - "level": "error", |
186 | | - "options": { |
187 | | - "paths": { |
188 | | - "child_process": "Please use node:child_process instead.", |
189 | | - "crypto": "Please use node:crypto instead.", |
190 | | - "fs": "Please use node:fs instead.", |
191 | | - "http": "Please use node:https instead.", |
192 | | - "net": "Please use node:net instead.", |
193 | | - "os": "Please use node:os instead.", |
194 | | - "path": "Please use node:path instead.", |
195 | | - "stream": "Please use node:stream instead.", |
196 | | - "util": "Please use node:util instead.", |
197 | | - "url": "Please use node:url instead.", |
198 | | - "worker_threads": "Please use node:worker_threads instead." |
199 | | - } |
200 | | - } |
201 | | - }, |
202 | | - "noDuplicateElseIf": "error", |
203 | | - "noUselessEscapeInRegex": "error", |
204 | | - "noIrregularWhitespace": "error", |
205 | | - "noOctalEscape": "error", |
206 | 150 | // Need to enable this rule with exception to anonymous functions |
207 | | - "useExplicitType": "off", |
208 | | - "useGuardForIn": "error", |
209 | | - "noDuplicateProperties": "error", |
210 | | - "useAtIndex": "error", |
211 | | - "useCollapsedIf": "error" |
| 151 | + "useExplicitType": "off" |
212 | 152 | } |
213 | 153 | } |
214 | 154 | }, |
215 | | - "javascript": { |
216 | | - "formatter": { |
217 | | - "jsxQuoteStyle": "double", |
218 | | - "quoteProperties": "asNeeded", |
219 | | - "trailingCommas": "es5", |
220 | | - "semicolons": "always", |
221 | | - "arrowParentheses": "always", |
222 | | - "bracketSpacing": false, |
223 | | - "bracketSameLine": false, |
224 | | - "quoteStyle": "double", |
225 | | - "attributePosition": "auto", |
226 | | - "enabled": true |
227 | | - }, |
228 | | - "linter": { |
229 | | - "enabled": true |
230 | | - }, |
231 | | - "globals": ["BigInt"] |
232 | | - }, |
233 | 155 | "overrides": [ |
234 | 156 | // Code using console output |
235 | 157 | { |
236 | 158 | "include": ["packages/cli/src/", "packages/test-utils/src", "packages/flare/src"], |
237 | 159 | "linter": { |
238 | 160 | "rules": { |
239 | 161 | "suspicious": { |
240 | | - "noConsoleLog": "off" |
| 162 | + "noConsole": "off" |
241 | 163 | } |
242 | 164 | } |
243 | 165 | } |
|
257 | 179 | // During testing we use `any` type for quick assignments |
258 | 180 | "noExplicitAny": "off", |
259 | 181 | // Console logging is often used in tests |
260 | | - "noConsoleLog": "off" |
| 182 | + "noConsole": "off" |
261 | 183 | } |
262 | 184 | } |
263 | 185 | } |
|
0 commit comments