@prowise/eslint-config-linting-rules 2.0.3 → 2.0.5
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/README.md +4 -0
- package/front-react.js +3 -1
- package/front-solid.js +3 -1
- package/package.json +1 -1
- package/rules/baseSettings.js +131 -130
- package/rules/plugin-import-rules.js +74 -68
- package/rules/plugin-jest-rules.js +3 -3
- package/rules/plugin-jsdoc-rules.js +12 -12
- package/rules/plugin-jsx-a11y-rules.js +2 -2
- package/rules/plugin-node-rules.js +6 -6
- package/rules/plugin-prefer-arrow-rules.js +10 -6
- package/rules/plugin-react-rules.js +54 -54
- package/rules/plugin-solid-rules.js +21 -21
- package/rules/plugin-stylistic-rules.js +21 -21
- package/rules/plugin-typescript-rules.js +20 -16
- package/rules/plugin-vitest-rules.js +6 -6
- package/rules/test-rules.js +11 -11
- package/rules/plugin-react-hooks-rules.js +0 -18
|
@@ -91,7 +91,7 @@ export default {
|
|
|
91
91
|
* https://typescript-eslint.io/rules/consistent-type-definitions.
|
|
92
92
|
* Turned off => we want to keep difference between defining type and interface.
|
|
93
93
|
*/
|
|
94
|
-
"@typescript-eslint/consistent-type-definitions": "off",
|
|
94
|
+
// "@typescript-eslint/consistent-type-definitions": "off",
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* Enforce consistent usage of type exports 🔧 💭
|
|
@@ -104,7 +104,11 @@ export default {
|
|
|
104
104
|
* https://typescript-eslint.io/rules/consistent-type-imports.
|
|
105
105
|
* Turned off to allow us to use type import to prevent circular import warning.
|
|
106
106
|
*/
|
|
107
|
-
"@typescript-eslint/consistent-type-imports": ["
|
|
107
|
+
"@typescript-eslint/consistent-type-imports": ["warn", {
|
|
108
|
+
prefer: "type-imports",
|
|
109
|
+
fixStyle: "inline-type-imports",
|
|
110
|
+
disallowTypeAnnotations: false,
|
|
111
|
+
}],
|
|
108
112
|
|
|
109
113
|
/**
|
|
110
114
|
* Enforce default parameters to be last.
|
|
@@ -165,7 +169,7 @@ export default {
|
|
|
165
169
|
* Require a consistent member declaration order
|
|
166
170
|
* https://typescript-eslint.io/rules/member-ordering.
|
|
167
171
|
*/
|
|
168
|
-
"@typescript-eslint/member-ordering": "off",
|
|
172
|
+
// "@typescript-eslint/member-ordering": "off",
|
|
169
173
|
|
|
170
174
|
/**
|
|
171
175
|
* Enforce using a particular method signature syntax 🔧
|
|
@@ -278,7 +282,7 @@ export default {
|
|
|
278
282
|
* Disallow classes used as namespaces 🔒
|
|
279
283
|
* https://typescript-eslint.io/rules/no-extraneous-class.
|
|
280
284
|
*/
|
|
281
|
-
"@typescript-eslint/no-extraneous-class": "off",
|
|
285
|
+
// "@typescript-eslint/no-extraneous-class": "off",
|
|
282
286
|
|
|
283
287
|
/**
|
|
284
288
|
* Require Promise-like statements to be handled appropriately ✅ 💡 💭
|
|
@@ -318,7 +322,7 @@ export default {
|
|
|
318
322
|
* Disallow void type outside of generic or return types 🔒
|
|
319
323
|
* https://typescript-eslint.io/rules/no-invalid-void-type.
|
|
320
324
|
*/
|
|
321
|
-
"@typescript-eslint/no-invalid-void-type": "off",
|
|
325
|
+
// "@typescript-eslint/no-invalid-void-type": "off",
|
|
322
326
|
|
|
323
327
|
/**
|
|
324
328
|
* Disallow function declarations that contain unsafe references inside loop statements.
|
|
@@ -432,7 +436,7 @@ export default {
|
|
|
432
436
|
* https://typescript-eslint.io/rules/no-unnecessary-condition.
|
|
433
437
|
* Turned off for now: a lot of false positives which breaks code!!
|
|
434
438
|
*/
|
|
435
|
-
"@typescript-eslint/no-unnecessary-condition": "off",
|
|
439
|
+
// "@typescript-eslint/no-unnecessary-condition": "off",
|
|
436
440
|
|
|
437
441
|
/**
|
|
438
442
|
* Disallow unnecessary namespace qualifiers 🔧 💭
|
|
@@ -469,20 +473,20 @@ export default {
|
|
|
469
473
|
* Off: catched by tsc
|
|
470
474
|
* https://typescript-eslint.io/rules/no-unsafe-assignment.
|
|
471
475
|
*/
|
|
472
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
476
|
+
// "@typescript-eslint/no-unsafe-assignment": "off",
|
|
473
477
|
|
|
474
478
|
/**
|
|
475
479
|
* Disallow calling a value with type any ✅ 💭
|
|
476
480
|
* Off: gives too much false positive
|
|
477
481
|
* https://typescript-eslint.io/rules/no-unsafe-call.
|
|
478
482
|
*/
|
|
479
|
-
"@typescript-eslint/no-unsafe-call": "off",
|
|
483
|
+
// "@typescript-eslint/no-unsafe-call": "off",
|
|
480
484
|
|
|
481
485
|
/**
|
|
482
486
|
* Disallow member access on a value with type any ✅ 💭
|
|
483
487
|
* https://typescript-eslint.io/rules/no-unsafe-member-access.
|
|
484
488
|
*/
|
|
485
|
-
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
489
|
+
// "@typescript-eslint/no-unsafe-member-access": "off",
|
|
486
490
|
|
|
487
491
|
/**
|
|
488
492
|
* Disallow returning a value with type any from a function ✅ 💭
|
|
@@ -552,7 +556,7 @@ export default {
|
|
|
552
556
|
* Require each enum member value to be explicitly initialized 💡
|
|
553
557
|
* https://typescript-eslint.io/rules/prefer-enum-initializers.
|
|
554
558
|
*/
|
|
555
|
-
"@typescript-eslint/prefer-enum-initializers": "off",
|
|
559
|
+
// "@typescript-eslint/prefer-enum-initializers": "off",
|
|
556
560
|
|
|
557
561
|
/**
|
|
558
562
|
* Enforce the use of for-of loop over the standard for loop where possible 🔒
|
|
@@ -588,7 +592,7 @@ export default {
|
|
|
588
592
|
* Enforce using the nullish coalescing operator instead of logical chaining 🔒 💡 💭
|
|
589
593
|
* https://typescript-eslint.io/rules/prefer-nullish-coalescing.
|
|
590
594
|
*/
|
|
591
|
-
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
595
|
+
// "@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
592
596
|
|
|
593
597
|
/**
|
|
594
598
|
* Enforce using concise optional chain expressions instead of chained logical ands 🔒 💡
|
|
@@ -606,7 +610,7 @@ export default {
|
|
|
606
610
|
* Require function parameters to be typed as readonly to prevent accidental mutation of inputs 💭
|
|
607
611
|
* https://typescript-eslint.io/rules/prefer-readonly-parameter-types.
|
|
608
612
|
*/
|
|
609
|
-
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
613
|
+
// "@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
610
614
|
|
|
611
615
|
/**
|
|
612
616
|
* Enforce using type parameter when calling Array#reduce instead of casting 🔒 🔧 💭
|
|
@@ -657,7 +661,7 @@ export default {
|
|
|
657
661
|
* Off: not really needed
|
|
658
662
|
* https://typescript-eslint.io/rules/restrict-plus-operands.
|
|
659
663
|
*/
|
|
660
|
-
"@typescript-eslint/restrict-plus-operands": "off",
|
|
664
|
+
// "@typescript-eslint/restrict-plus-operands": "off",
|
|
661
665
|
|
|
662
666
|
/**
|
|
663
667
|
* Enforce template literal expressions to be of string type ✅ 💭
|
|
@@ -669,13 +673,13 @@ export default {
|
|
|
669
673
|
* Enforce members of a type union/intersection to be sorted alphabetically 🔧 💡
|
|
670
674
|
* https://typescript-eslint.io/rules/sort-type-union-intersection-members.
|
|
671
675
|
*/
|
|
672
|
-
"@typescript-eslint/sort-type-union-intersection-members": "off",
|
|
676
|
+
// "@typescript-eslint/sort-type-union-intersection-members": "off",
|
|
673
677
|
|
|
674
678
|
/**
|
|
675
679
|
* Disallow certain types in boolean expressions 🔧 💡 💭
|
|
676
680
|
* https://typescript-eslint.io/rules/strict-boolean-expressions.
|
|
677
681
|
*/
|
|
678
|
-
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
682
|
+
// "@typescript-eslint/strict-boolean-expressions": "off",
|
|
679
683
|
|
|
680
684
|
/**
|
|
681
685
|
* Require switch-case statements to be exhaustive with union type 💡 💭
|
|
@@ -707,7 +711,7 @@ export default {
|
|
|
707
711
|
* While this rule should be enabled, it gives to many problems with external libraries
|
|
708
712
|
* https://typescript-eslint.io/rules/unbound-method.
|
|
709
713
|
*/
|
|
710
|
-
"@typescript-eslint/unbound-method": "off",
|
|
714
|
+
// "@typescript-eslint/unbound-method": "off",
|
|
711
715
|
|
|
712
716
|
/**
|
|
713
717
|
* Disallow two overloads that could be unified into one with a union or an optional/rest parameter
|
|
@@ -30,13 +30,13 @@ export default {
|
|
|
30
30
|
* Forbidden test file pattern: default only "test" accepted
|
|
31
31
|
* https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
32
32
|
*/
|
|
33
|
-
"vitest/consistent-test-filename": ["
|
|
33
|
+
"vitest/consistent-test-filename": ["warn", { pattern: ".*\\.test\\.[tj]sx?$" }],
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Do not use conditionals to run tests
|
|
37
37
|
* https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-tests.md
|
|
38
38
|
*/
|
|
39
|
-
"vitest/no-conditional-tests": "off",
|
|
39
|
+
// "vitest/no-conditional-tests": "off",
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Disallow importing node:test ✅ 🔧
|
|
@@ -48,25 +48,25 @@ export default {
|
|
|
48
48
|
* Disallow specific vi. methods
|
|
49
49
|
* https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-vi-methods.md
|
|
50
50
|
*/
|
|
51
|
-
"vitest/no-restricted-vi-methods": "off",
|
|
51
|
+
// "vitest/no-restricted-vi-methods": "off",
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Suggest using toBeFalsy() 🔧
|
|
55
55
|
* https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-falsy.md
|
|
56
56
|
*/
|
|
57
|
-
"vitest/prefer-to-be-falsy)": "off",
|
|
57
|
+
// "vitest/prefer-to-be-falsy)": "off",
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Prefer toBeObject() 🔧
|
|
61
61
|
* https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-object.md
|
|
62
62
|
*/
|
|
63
|
-
"vitest/prefer-to-be-object": "off",
|
|
63
|
+
// "vitest/prefer-to-be-object": "off",
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* Suggest using toBeTruthy 🔧
|
|
67
67
|
* https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-truthy.md
|
|
68
68
|
*/
|
|
69
|
-
"vitest/prefer-to-be-truthy": "off",
|
|
69
|
+
// "vitest/prefer-to-be-truthy": "off",
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* Require local Test Context for concurrent snapshot tests ✅
|
package/rules/test-rules.js
CHANGED
|
@@ -28,7 +28,7 @@ const rules = {
|
|
|
28
28
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
|
|
29
29
|
* Rule turned off: gives too many false positives
|
|
30
30
|
*/
|
|
31
|
-
"max-expects": ["off", { max: 10 }],
|
|
31
|
+
// "max-expects": ["off", { max: 10 }],
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Enforces a maximum depth to nested describe calls
|
|
@@ -63,7 +63,7 @@ const rules = {
|
|
|
63
63
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-in-test.md
|
|
64
64
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
|
|
65
65
|
*/
|
|
66
|
-
"no-conditional-in-test": "off",
|
|
66
|
+
// "no-conditional-in-test": "off",
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Disallow disabled tests ✅
|
|
@@ -91,7 +91,7 @@ const rules = {
|
|
|
91
91
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-hooks.md
|
|
92
92
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/no-hooks.md
|
|
93
93
|
*/
|
|
94
|
-
"no-hooks": "off",
|
|
94
|
+
// "no-hooks": "off",
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* Disallow identical titles ✅
|
|
@@ -126,7 +126,7 @@ const rules = {
|
|
|
126
126
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-restricted-matchers.md
|
|
127
127
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-matchers.md
|
|
128
128
|
*/
|
|
129
|
-
"no-restricted-matchers": "off",
|
|
129
|
+
// "no-restricted-matchers": "off",
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* Disallow using expect outside of it or test blocks ✅
|
|
@@ -168,7 +168,7 @@ const rules = {
|
|
|
168
168
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-each.md
|
|
169
169
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
|
|
170
170
|
*/
|
|
171
|
-
"prefer-each": "off",
|
|
171
|
+
// "prefer-each": "off",
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
174
|
* Suggest using the built-in equality matchers
|
|
@@ -182,7 +182,7 @@ const rules = {
|
|
|
182
182
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-expect-assertions.md
|
|
183
183
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-assertions.md
|
|
184
184
|
*/
|
|
185
|
-
"prefer-expect-assertions": "off",
|
|
185
|
+
// "prefer-expect-assertions": "off",
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
188
|
* Suggest using expect().resolves over expect(await ...) syntax 🔧
|
|
@@ -222,7 +222,7 @@ const rules = {
|
|
|
222
222
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-snapshot-hint.md
|
|
223
223
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
|
|
224
224
|
*/
|
|
225
|
-
"prefer-snapshot-hint": "off",
|
|
225
|
+
// "prefer-snapshot-hint": "off",
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
228
|
* Suggest using .spyOn()
|
|
@@ -236,7 +236,7 @@ const rules = {
|
|
|
236
236
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-strict-equal.md
|
|
237
237
|
* Vitest https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-equal.md
|
|
238
238
|
*/
|
|
239
|
-
"prefer-strict-equal": "off",
|
|
239
|
+
// "prefer-strict-equal": "off",
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
242
|
* Suggest using toBe() for primitive literals 🔧
|
|
@@ -271,7 +271,7 @@ const rules = {
|
|
|
271
271
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-hook.md
|
|
272
272
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
273
273
|
*/
|
|
274
|
-
"require-hook": "off",
|
|
274
|
+
// "require-hook": "off",
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
277
|
* Require a message for toThrow()
|
|
@@ -285,14 +285,14 @@ const rules = {
|
|
|
285
285
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-top-level-describe.md
|
|
286
286
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/require-top-level-describe.md
|
|
287
287
|
*/
|
|
288
|
-
"require-top-level-describe": "off",
|
|
288
|
+
// "require-top-level-describe": "off",
|
|
289
289
|
|
|
290
290
|
/**
|
|
291
291
|
* Enforce unbound methods are called with their expected scope
|
|
292
292
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md
|
|
293
293
|
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/unbound-method.md
|
|
294
294
|
*/
|
|
295
|
-
"unbound-method": "off",
|
|
295
|
+
// "unbound-method": "off",
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
298
|
* Enforce valid describe() ✅
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
plugins: {},
|
|
3
|
-
|
|
4
|
-
rules: {
|
|
5
|
-
// TODO: enable when compatible with eslint version 9
|
|
6
|
-
/**
|
|
7
|
-
* Enforce Rules of Hooks
|
|
8
|
-
* https://reactjs.org/docs/hooks-rules.html.
|
|
9
|
-
*/
|
|
10
|
-
// "react-hooks/rules-of-hooks": "error",
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Verify the list of the dependencies for Hooks like useEffect and similar
|
|
14
|
-
* https://reactjs.org/docs/hooks-rules.html.
|
|
15
|
-
*/
|
|
16
|
-
// "react-hooks/exhaustive-deps": "error",
|
|
17
|
-
},
|
|
18
|
-
};
|