eslint-config-heck 9.5.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/biomeComplexity.json +48 -0
- package/biomeJsTs.json +12 -25
- package/biomePlaywright.json +22 -0
- package/biomeReactNative.json +15 -0
- package/eslint.config.js +1 -3
- package/nodeWithBiome.js +6 -6
- package/package.json +6 -10
- package/readme.md +31 -82
- package/complexity.js +0 -26
- package/groupImports.js +0 -33
- package/node.js +0 -1308
- package/reactNative.js +0 -19
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
+
"root": false,
|
|
4
|
+
"linter": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"rules": {
|
|
7
|
+
"complexity": {
|
|
8
|
+
"noExcessiveCognitiveComplexity": "warn",
|
|
9
|
+
"noExcessiveLinesPerFunction": {
|
|
10
|
+
"level": "error",
|
|
11
|
+
"options": {
|
|
12
|
+
"maxLines": 20,
|
|
13
|
+
"skipBlankLines": true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"useMaxParams": {
|
|
17
|
+
"level": "error",
|
|
18
|
+
"options": {
|
|
19
|
+
"max": 3
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"overrides": [
|
|
26
|
+
{
|
|
27
|
+
"includes": [
|
|
28
|
+
"**/*.spec.ts",
|
|
29
|
+
"**/*.spec.tsx",
|
|
30
|
+
"**/*.test.ts",
|
|
31
|
+
"**/*.test.tsx",
|
|
32
|
+
"**/*.spec.js",
|
|
33
|
+
"**/*.spec.jsx",
|
|
34
|
+
"**/*.test.js",
|
|
35
|
+
"**/*.test.jsx"
|
|
36
|
+
],
|
|
37
|
+
"linter": {
|
|
38
|
+
"rules": {
|
|
39
|
+
"complexity": {
|
|
40
|
+
"noExcessiveCognitiveComplexity": "off",
|
|
41
|
+
"noExcessiveLinesPerFunction": "off",
|
|
42
|
+
"useMaxParams": "off"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
package/biomeJsTs.json
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"noBannedTypes": "error",
|
|
49
49
|
"noCommaOperator": "error",
|
|
50
50
|
"noEmptyTypeParameters": "error",
|
|
51
|
-
"noExcessiveCognitiveComplexity": "
|
|
51
|
+
"noExcessiveCognitiveComplexity": "off",
|
|
52
52
|
"noExcessiveLinesPerFunction": "off",
|
|
53
53
|
"noExcessiveNestedTestSuites": "error",
|
|
54
54
|
"noExtraBooleanCast": "error",
|
|
@@ -107,14 +107,13 @@
|
|
|
107
107
|
"noNodejsModules": "off",
|
|
108
108
|
"noNonoctalDecimalEscape": "error",
|
|
109
109
|
"noPrecisionLoss": "error",
|
|
110
|
-
"noPrivateImports": "
|
|
110
|
+
"noPrivateImports": "error",
|
|
111
111
|
"noProcessGlobal": "error",
|
|
112
112
|
"noReactPropAssignments": "error",
|
|
113
113
|
"noRenderReturnValue": "error",
|
|
114
114
|
"noRestrictedElements": "off",
|
|
115
115
|
"noSelfAssign": "error",
|
|
116
116
|
"noSetterReturn": "error",
|
|
117
|
-
"noSolidDestructuredProps": "off",
|
|
118
117
|
"noStringCaseMismatch": "error",
|
|
119
118
|
"noSwitchDeclarations": "error",
|
|
120
119
|
"noUndeclaredDependencies": "error",
|
|
@@ -155,7 +154,6 @@
|
|
|
155
154
|
"noConditionalExpect": "error",
|
|
156
155
|
"noContinue": "off",
|
|
157
156
|
"noDivRegex": "off",
|
|
158
|
-
"noDuplicateArgumentNames": "off",
|
|
159
157
|
"noDuplicatedSpreadProps": "error",
|
|
160
158
|
"noEqualsToNull": "off",
|
|
161
159
|
"noExcessiveClassesPerFile": "off",
|
|
@@ -167,25 +165,17 @@
|
|
|
167
165
|
"noImpliedEval": "error",
|
|
168
166
|
"noIncrementDecrement": "off",
|
|
169
167
|
"noInlineStyles": "warn",
|
|
168
|
+
"noJsxLeakedDollar": "warn",
|
|
170
169
|
"noJsxNamespace": "error",
|
|
171
170
|
"noJsxPropsBind": "off",
|
|
172
171
|
"noLeakedRender": "error",
|
|
173
|
-
"
|
|
172
|
+
"noLoopFunc": "error",
|
|
173
|
+
"noMisleadingReturnType": "info",
|
|
174
174
|
"noMisusedPromises": "error",
|
|
175
175
|
"noMultiAssign": "error",
|
|
176
176
|
"noMultiStr": "error",
|
|
177
177
|
"noNestedPromises": "error",
|
|
178
178
|
"noParametersOnlyUsedInRecursion": "warn",
|
|
179
|
-
"noPlaywrightElementHandle": "off",
|
|
180
|
-
"noPlaywrightEval": "off",
|
|
181
|
-
"noPlaywrightForceOption": "off",
|
|
182
|
-
"noPlaywrightMissingAwait": "off",
|
|
183
|
-
"noPlaywrightNetworkidle": "off",
|
|
184
|
-
"noPlaywrightPagePause": "off",
|
|
185
|
-
"noPlaywrightUselessAwait": "off",
|
|
186
|
-
"noPlaywrightWaitForNavigation": "off",
|
|
187
|
-
"noPlaywrightWaitForSelector": "off",
|
|
188
|
-
"noPlaywrightWaitForTimeout": "off",
|
|
189
179
|
"noProto": "error",
|
|
190
180
|
"noRedundantDefaultExport": "error",
|
|
191
181
|
"noReturnAssign": "error",
|
|
@@ -196,12 +186,13 @@
|
|
|
196
186
|
"noUndeclaredEnvVars": "off",
|
|
197
187
|
"noUnknownAttribute": "error",
|
|
198
188
|
"noUnnecessaryConditions": "off",
|
|
189
|
+
"noUnnecessaryTemplateExpression": "error",
|
|
199
190
|
"noUnsafePlusOperands": "error",
|
|
200
191
|
"noUselessReturn": "error",
|
|
201
192
|
"noUselessTypeConversion": "error",
|
|
202
193
|
"useArraySome": "error",
|
|
203
194
|
"useArraySortCompare": "error",
|
|
204
|
-
"useAwaitThenable": "
|
|
195
|
+
"useAwaitThenable": "error",
|
|
205
196
|
"useConsistentEnumValueType": "error",
|
|
206
197
|
"useConsistentMethodSignatures": "error",
|
|
207
198
|
"useConsistentTestIt": {
|
|
@@ -213,6 +204,8 @@
|
|
|
213
204
|
},
|
|
214
205
|
"useDestructuring": "off",
|
|
215
206
|
"useDisposables": "error",
|
|
207
|
+
"useDomNodeTextContent": "error",
|
|
208
|
+
"useDomQuerySelector": "error",
|
|
216
209
|
"useErrorCause": {
|
|
217
210
|
"level": "error",
|
|
218
211
|
"options": {
|
|
@@ -235,10 +228,10 @@
|
|
|
235
228
|
"useImportsFirst": "error",
|
|
236
229
|
"useNamedCaptureGroup": "error",
|
|
237
230
|
"useNullishCoalescing": "error",
|
|
238
|
-
"usePlaywrightValidDescribeCallback": "off",
|
|
239
231
|
"useReactAsyncServerFunction": "warn",
|
|
240
232
|
"useReduceTypeParameter": "error",
|
|
241
233
|
"useRegexpExec": "error",
|
|
234
|
+
"useRegexpTest": "error",
|
|
242
235
|
"useSortedClasses": "off",
|
|
243
236
|
"useSpread": "error",
|
|
244
237
|
"useStringStartsEndsWith": "error",
|
|
@@ -251,12 +244,10 @@
|
|
|
251
244
|
"noBarrelFile": "error",
|
|
252
245
|
"noDelete": "error",
|
|
253
246
|
"noDynamicNamespaceImportAccess": "error",
|
|
254
|
-
"noImgElement": "off",
|
|
255
247
|
"noNamespaceImport": "error",
|
|
256
248
|
"noReExportAll": "error",
|
|
257
249
|
"noUnwantedPolyfillio": "off",
|
|
258
250
|
"useGoogleFontPreconnect": "error",
|
|
259
|
-
"useSolidForComponent": "off",
|
|
260
251
|
"useTopLevelRegex": "error"
|
|
261
252
|
},
|
|
262
253
|
"security": {
|
|
@@ -272,7 +263,6 @@
|
|
|
272
263
|
"noDoneCallback": "error",
|
|
273
264
|
"noEnum": "error",
|
|
274
265
|
"noExportedImports": "error",
|
|
275
|
-
"noHeadElement": "off",
|
|
276
266
|
"noImplicitBoolean": "off",
|
|
277
267
|
"noInferrableTypes": "error",
|
|
278
268
|
"noJsxLiterals": "error",
|
|
@@ -335,7 +325,7 @@
|
|
|
335
325
|
}
|
|
336
326
|
},
|
|
337
327
|
"useForOf": "error",
|
|
338
|
-
"useFragmentSyntax": "
|
|
328
|
+
"useFragmentSyntax": "info",
|
|
339
329
|
"useGroupedAccessorPairs": "error",
|
|
340
330
|
"useImportType": "error",
|
|
341
331
|
"useLiteralEnumMembers": "error",
|
|
@@ -393,9 +383,8 @@
|
|
|
393
383
|
"noConstantBinaryExpressions": "error",
|
|
394
384
|
"noControlCharactersInRegex": "error",
|
|
395
385
|
"noDebugger": "error",
|
|
396
|
-
"noDeprecatedImports": "
|
|
386
|
+
"noDeprecatedImports": "warn",
|
|
397
387
|
"noDocumentCookie": "error",
|
|
398
|
-
"noDocumentImportInPage": "off",
|
|
399
388
|
"noDoubleEquals": "error",
|
|
400
389
|
"noDuplicateCase": "error",
|
|
401
390
|
"noDuplicateClassMembers": "error",
|
|
@@ -417,7 +406,6 @@
|
|
|
417
406
|
"noGlobalAssign": "error",
|
|
418
407
|
"noGlobalIsFinite": "error",
|
|
419
408
|
"noGlobalIsNan": "error",
|
|
420
|
-
"noHeadImportInDocument": "off",
|
|
421
409
|
"noImplicitAnyLet": "error",
|
|
422
410
|
"noImportAssign": "error",
|
|
423
411
|
"noImportCycles": "error",
|
|
@@ -431,7 +419,6 @@
|
|
|
431
419
|
"noOctalEscape": "error",
|
|
432
420
|
"noPrototypeBuiltins": "error",
|
|
433
421
|
"noReactForwardRef": "error",
|
|
434
|
-
"noReactSpecificProps": "off",
|
|
435
422
|
"noRedeclare": "error",
|
|
436
423
|
"noRedundantUseStrict": "error",
|
|
437
424
|
"noSelfCompare": "error",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
+
"root": false,
|
|
4
|
+
"linter": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"rules": {
|
|
7
|
+
"nursery": {
|
|
8
|
+
"noPlaywrightElementHandle": "error",
|
|
9
|
+
"noPlaywrightEval": "error",
|
|
10
|
+
"noPlaywrightForceOption": "error",
|
|
11
|
+
"noPlaywrightMissingAwait": "error",
|
|
12
|
+
"noPlaywrightNetworkidle": "error",
|
|
13
|
+
"noPlaywrightPagePause": "error",
|
|
14
|
+
"noPlaywrightUselessAwait": "error",
|
|
15
|
+
"noPlaywrightWaitForNavigation": "error",
|
|
16
|
+
"noPlaywrightWaitForSelector": "error",
|
|
17
|
+
"noPlaywrightWaitForTimeout": "error",
|
|
18
|
+
"usePlaywrightValidDescribeCallback": "error"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
+
"root": false,
|
|
4
|
+
"linter": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"rules": {
|
|
7
|
+
"nursery": {
|
|
8
|
+
"noReactNativeDeepImports": "error",
|
|
9
|
+
"noReactNativeLiteralColors": "error",
|
|
10
|
+
"noReactNativeRawText": "error",
|
|
11
|
+
"useReactNativePlatformComponents": "error"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/eslint.config.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { defineConfig } from "eslint/config";
|
|
2
|
-
import complexity from "./complexity.js";
|
|
3
|
-
import groupImports from "./groupImports.js";
|
|
4
2
|
import nodeWithBiome from "./nodeWithBiome.js";
|
|
5
3
|
|
|
6
4
|
// biome-ignore lint/style/noDefaultExport: Required for ESLint configuration
|
|
7
5
|
export default defineConfig({
|
|
8
|
-
extends: [nodeWithBiome
|
|
6
|
+
extends: [nodeWithBiome],
|
|
9
7
|
});
|
package/nodeWithBiome.js
CHANGED
|
@@ -383,7 +383,7 @@ export default [
|
|
|
383
383
|
allowDestructuredState: true,
|
|
384
384
|
},
|
|
385
385
|
],
|
|
386
|
-
"react/iframe-missing-sandbox": "
|
|
386
|
+
"react/iframe-missing-sandbox": "off",
|
|
387
387
|
"react/jsx-boolean-value": "off",
|
|
388
388
|
"react/jsx-child-element-spacing": "error",
|
|
389
389
|
"react/jsx-closing-bracket-location": "off",
|
|
@@ -613,7 +613,7 @@ export default [
|
|
|
613
613
|
"unicorn/prefer-dom-node-append": "error",
|
|
614
614
|
"unicorn/prefer-dom-node-dataset": "error",
|
|
615
615
|
"unicorn/prefer-dom-node-remove": "error",
|
|
616
|
-
"unicorn/prefer-dom-node-text-content": "
|
|
616
|
+
"unicorn/prefer-dom-node-text-content": "off",
|
|
617
617
|
"unicorn/prefer-event-target": "off",
|
|
618
618
|
"unicorn/prefer-export-from": "off",
|
|
619
619
|
"unicorn/prefer-global-this": "off",
|
|
@@ -636,7 +636,7 @@ export default [
|
|
|
636
636
|
"unicorn/prefer-prototype-methods": "off",
|
|
637
637
|
"unicorn/prefer-query-selector": "off",
|
|
638
638
|
"unicorn/prefer-reflect-apply": "error",
|
|
639
|
-
"unicorn/prefer-regexp-test": "
|
|
639
|
+
"unicorn/prefer-regexp-test": "off",
|
|
640
640
|
"unicorn/prefer-response-static-json": "error",
|
|
641
641
|
"unicorn/prefer-set-has": "error",
|
|
642
642
|
"unicorn/prefer-set-size": "error",
|
|
@@ -784,7 +784,7 @@ export default [
|
|
|
784
784
|
"@typescript-eslint/no-base-to-string": "error",
|
|
785
785
|
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
786
786
|
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
787
|
-
"@typescript-eslint/no-deprecated": "
|
|
787
|
+
"@typescript-eslint/no-deprecated": "off",
|
|
788
788
|
"no-dupe-class-members": "off",
|
|
789
789
|
"@typescript-eslint/no-dupe-class-members": "off",
|
|
790
790
|
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
@@ -806,7 +806,7 @@ export default [
|
|
|
806
806
|
"@typescript-eslint/no-invalid-this": "error",
|
|
807
807
|
"@typescript-eslint/no-invalid-void-type": "off",
|
|
808
808
|
"no-loop-func": "off",
|
|
809
|
-
"@typescript-eslint/no-loop-func": "
|
|
809
|
+
"@typescript-eslint/no-loop-func": "off",
|
|
810
810
|
"no-magic-numbers": "off",
|
|
811
811
|
"@typescript-eslint/no-magic-numbers": "off",
|
|
812
812
|
"@typescript-eslint/no-meaningless-void-operator": "off",
|
|
@@ -839,7 +839,7 @@ export default [
|
|
|
839
839
|
"@typescript-eslint/no-unnecessary-parameter-property-assignment":
|
|
840
840
|
"error",
|
|
841
841
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
842
|
-
"@typescript-eslint/no-unnecessary-template-expression": "
|
|
842
|
+
"@typescript-eslint/no-unnecessary-template-expression": "off",
|
|
843
843
|
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
844
844
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
845
845
|
"@typescript-eslint/no-unnecessary-type-constraint": "off",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-heck",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Contains an ESLint configuration for ES2015+, TypeScript, and React.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -8,11 +8,7 @@
|
|
|
8
8
|
"./biomeJsTs": "./biomeJsTs.json",
|
|
9
9
|
"./biomeCss": "./biomeCss.json",
|
|
10
10
|
"./biomeJson": "./biomeJson.json",
|
|
11
|
-
"./
|
|
12
|
-
"./nodeWithBiome": "./nodeWithBiome.js",
|
|
13
|
-
"./complexity": "./complexity.js",
|
|
14
|
-
"./groupImports": "./groupImports.js",
|
|
15
|
-
"./reactNative": "./reactNative.js"
|
|
11
|
+
"./nodeWithBiome": "./nodeWithBiome.js"
|
|
16
12
|
},
|
|
17
13
|
"scripts": {
|
|
18
14
|
"update": "npx -y npm-check-updates -i --cooldown 2 --install never && npx -y npm-check-updates -i --cooldown 2 --target minor --install never && npx -y npm-check-updates -i --cooldown 2 --target patch --install never && npm update --force",
|
|
@@ -20,6 +16,7 @@
|
|
|
20
16
|
"semantic-release": "semantic-release"
|
|
21
17
|
},
|
|
22
18
|
"keywords": [
|
|
19
|
+
"Biome",
|
|
23
20
|
"ESLint",
|
|
24
21
|
"ES2015",
|
|
25
22
|
"TypeScript",
|
|
@@ -29,20 +26,19 @@
|
|
|
29
26
|
"license": "MIT",
|
|
30
27
|
"dependencies": {
|
|
31
28
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
33
|
-
"@typescript-eslint/parser": "8.
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "8.59.0",
|
|
30
|
+
"@typescript-eslint/parser": "8.59.0",
|
|
34
31
|
"eslint": "9.39.4",
|
|
35
32
|
"eslint-plugin-import": "2.32.0",
|
|
36
33
|
"eslint-plugin-jest": "29.15.2",
|
|
37
34
|
"eslint-plugin-react": "7.37.5",
|
|
38
35
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
39
|
-
"eslint-plugin-react-native": "5.0.0",
|
|
40
36
|
"eslint-plugin-testing-library": "7.16.2",
|
|
41
37
|
"eslint-plugin-unicorn": "64.0.0",
|
|
42
38
|
"typescript": "6.0.3"
|
|
43
39
|
},
|
|
44
40
|
"devDependencies": {
|
|
45
|
-
"@biomejs/biome": "2.4.
|
|
41
|
+
"@biomejs/biome": "2.4.13",
|
|
46
42
|
"@testing-library/dom": "10.4.1",
|
|
47
43
|
"@testing-library/react": "16.3.2",
|
|
48
44
|
"@types/jest": "30.0.0",
|
package/readme.md
CHANGED
|
@@ -1,103 +1,52 @@
|
|
|
1
1
|
# eslint-config-heck
|
|
2
2
|
|
|
3
|
-
eslint-config-heck contains
|
|
3
|
+
eslint-config-heck contains ESLint and Biome configurations for ES2015+, TypeScript, and React.
|
|
4
|
+
|
|
5
|
+
**Both ESLint and Biome are required.** Biome handles formatting, import/export sorting, and a large set of linting rules. ESLint covers rules that Biome does not yet support. Using one without the other will leave significant gaps in your linting coverage.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
~~~sh
|
|
8
|
-
npm install --save-dev eslint@9 eslint-config-heck
|
|
9
|
-
~~~
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
To use one of the included configurations, create a `eslint.config.js` and import the configuration you want to use.
|
|
14
|
-
|
|
15
|
-
For a Node.js project use:
|
|
16
|
-
|
|
17
|
-
~~~js
|
|
18
|
-
{
|
|
19
|
-
import node from "eslint-config-heck/node";
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
...node,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
10
|
+
npm install --save-dev eslint@9 @biomejs/biome eslint-config-heck
|
|
25
11
|
~~~
|
|
26
12
|
|
|
27
|
-
##
|
|
13
|
+
## ESLint Setup
|
|
28
14
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Optionally you can enable some complexity rules by using the **complexity** configuration in addition to the **node** configuration:
|
|
15
|
+
Create an `eslint.config.js` and import the `nodeWithBiome` configuration. This configuration only enables rules that Biome does not yet support, so it is intended to be used alongside Biome.
|
|
32
16
|
|
|
33
17
|
~~~js
|
|
34
|
-
|
|
35
|
-
import node from "eslint-config-heck/node";
|
|
36
|
-
import complexity from "eslint-config-heck/complexity";
|
|
18
|
+
import nodeWithBiome from "eslint-config-heck/nodeWithBiome";
|
|
37
19
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
}
|
|
20
|
+
export default [
|
|
21
|
+
...nodeWithBiome,
|
|
22
|
+
];
|
|
43
23
|
~~~
|
|
44
24
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Optionally you can switch to another import sorting rule, which groups the imports by type and supports auto fixing. You can enable this rule by adding the **groupImports** configuration in addition to the **node** configuration:
|
|
48
|
-
|
|
49
|
-
~~~js
|
|
50
|
-
{
|
|
51
|
-
import node from "eslint-config-heck/node";
|
|
52
|
-
import groupImports from "eslint-config-heck/groupImports";
|
|
53
|
-
|
|
54
|
-
export default {
|
|
55
|
-
...node,
|
|
56
|
-
...groupImports,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
~~~
|
|
25
|
+
## Biome Setup
|
|
60
26
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
If you are using react-native, you can enable react-native specific rules:
|
|
64
|
-
|
|
65
|
-
~~~js
|
|
66
|
-
{
|
|
67
|
-
import node from "eslint-config-heck/node";
|
|
68
|
-
import reactNative from "eslint-config-heck/reactNative";
|
|
69
|
-
export default {
|
|
70
|
-
...node,
|
|
71
|
-
...reactNative,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
~~~
|
|
75
|
-
|
|
76
|
-
### Rules with usage of Biome
|
|
77
|
-
|
|
78
|
-
If you are using Biome you can use the "nodeWithBiome" configuration:
|
|
79
|
-
|
|
80
|
-
~~~js
|
|
81
|
-
{
|
|
82
|
-
import nodeWithBiome from "eslint-config-heck/nodeWithBiome";
|
|
83
|
-
|
|
84
|
-
export default {
|
|
85
|
-
...nodeWithBiome,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
~~~
|
|
89
|
-
|
|
90
|
-
If you are using Biome you can also extend your Biome config with the following Biome configurations:
|
|
91
|
-
|
|
92
|
-
- JavaScript/TypeScript: biomeJsTs
|
|
93
|
-
- CSS: biomeCss
|
|
94
|
-
- JSON: biomeJson
|
|
95
|
-
|
|
96
|
-
To enable all Biome rules, you can use the following configuration:
|
|
27
|
+
Create a `biome.jsonc` and extend the configurations you need:
|
|
97
28
|
|
|
98
29
|
~~~json
|
|
99
30
|
{
|
|
100
31
|
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
101
|
-
"extends": [
|
|
32
|
+
"extends": [
|
|
33
|
+
"eslint-config-heck/biomeJsTs",
|
|
34
|
+
"eslint-config-heck/biomeReactNative",
|
|
35
|
+
"eslint-config-heck/biomeCss",
|
|
36
|
+
"eslint-config-heck/biomeJson",
|
|
37
|
+
"eslint-config-heck/biomePlaywright",
|
|
38
|
+
"eslint-config-heck/biomeComplexity"
|
|
39
|
+
]
|
|
102
40
|
}
|
|
103
41
|
~~~
|
|
42
|
+
|
|
43
|
+
### Available Biome Configurations
|
|
44
|
+
|
|
45
|
+
| Configuration | Purpose |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `biomeJsTs` | JavaScript and TypeScript rules, formatting, and import/export sorting |
|
|
48
|
+
| `biomeReactNative` | React Native specific rules |
|
|
49
|
+
| `biomeCss` | CSS specific rules |
|
|
50
|
+
| `biomeJson` | JSON specific rules |
|
|
51
|
+
| `biomePlaywright` | Playwright test rules |
|
|
52
|
+
| `biomeComplexity` | Complexity rules |
|
package/complexity.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// biome-ignore lint/style/noDefaultExport: Required for ESLint configuration
|
|
2
|
-
export default [
|
|
3
|
-
{
|
|
4
|
-
rules: {
|
|
5
|
-
"max-depth": ["warn", 2],
|
|
6
|
-
"max-statements": ["warn", 20],
|
|
7
|
-
"max-params": ["warn", 3],
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
files: [
|
|
12
|
-
"**/*.spec.ts",
|
|
13
|
-
"**/*.spec.tsx",
|
|
14
|
-
"**/*.test.ts",
|
|
15
|
-
"**/*.test.tsx",
|
|
16
|
-
"**/*.spec.js",
|
|
17
|
-
"**/*.spec.jsx",
|
|
18
|
-
"**/*.test.js",
|
|
19
|
-
"**/*.test.jsx",
|
|
20
|
-
],
|
|
21
|
-
rules: {
|
|
22
|
-
"max-statements": "off",
|
|
23
|
-
"max-params": "off",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
];
|
package/groupImports.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// biome-ignore lint/style/noDefaultExport: Required for ESLint configuration
|
|
2
|
-
export default [
|
|
3
|
-
{
|
|
4
|
-
rules: {
|
|
5
|
-
"sort-imports": [
|
|
6
|
-
"error",
|
|
7
|
-
{
|
|
8
|
-
ignoreCase: true,
|
|
9
|
-
ignoreDeclarationSort: true,
|
|
10
|
-
},
|
|
11
|
-
],
|
|
12
|
-
"importPlugin/order": [
|
|
13
|
-
"error",
|
|
14
|
-
{
|
|
15
|
-
groups: [
|
|
16
|
-
"unknown",
|
|
17
|
-
"builtin",
|
|
18
|
-
"external",
|
|
19
|
-
"internal",
|
|
20
|
-
"parent",
|
|
21
|
-
"sibling",
|
|
22
|
-
"index",
|
|
23
|
-
"object",
|
|
24
|
-
],
|
|
25
|
-
alphabetize: {
|
|
26
|
-
order: "asc",
|
|
27
|
-
caseInsensitive: true,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
];
|