@fullstacksjs/eslint-config 13.3.1 → 13.5.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/cjs/modules/base.js +3 -0
- package/cjs/modules/node.js +1 -1
- package/cjs/modules/react.js +12 -10
- package/cjs/modules/tests.js +9 -8
- package/cjs/modules/typescript.js +3 -2
- package/cjs/modules/vitest.js +21 -5
- package/package.json +13 -14
- package/src/modules/base.mjs +6 -0
- package/src/modules/node.mjs +1 -1
- package/src/modules/react.mjs +14 -12
- package/src/modules/tests.mjs +9 -8
- package/src/modules/typescript.mjs +1 -1
- package/src/modules/vitest.mjs +18 -2
package/cjs/modules/base.js
CHANGED
|
@@ -185,6 +185,9 @@ function base(options = {}) {
|
|
|
185
185
|
allowUnboundThis: true
|
|
186
186
|
}],
|
|
187
187
|
'prefer-const': 'warn',
|
|
188
|
+
'preserve-caught-error': (0, _conditions.strict)(options, ['warn', {
|
|
189
|
+
requireCatchParameter: true
|
|
190
|
+
}]),
|
|
188
191
|
'prefer-exponentiation-operator': 'warn',
|
|
189
192
|
'prefer-numeric-literals': 'error',
|
|
190
193
|
'prefer-object-has-own': 'warn',
|
package/cjs/modules/node.js
CHANGED
|
@@ -48,7 +48,6 @@ function node(options = {}) {
|
|
|
48
48
|
// Nice but not a general rule
|
|
49
49
|
'n/prefer-global/buffer': 'warn',
|
|
50
50
|
'n/prefer-global/console': 'warn',
|
|
51
|
-
'n/prefer-global/process': 'warn',
|
|
52
51
|
'n/prefer-global/text-decoder': 'warn',
|
|
53
52
|
'n/prefer-global/text-encoder': 'warn',
|
|
54
53
|
'n/prefer-global/url-search-params': 'warn',
|
|
@@ -58,6 +57,7 @@ function node(options = {}) {
|
|
|
58
57
|
'n/prefer-promises/fs': 'warn',
|
|
59
58
|
'n/process-exit-as-throw': 'error',
|
|
60
59
|
// Disabled
|
|
60
|
+
'n/prefer-global/process': 'off',
|
|
61
61
|
'n/file-extension-in-import': 'off',
|
|
62
62
|
'n/no-extraneous-import': 'off',
|
|
63
63
|
'n/no-extraneous-require': 'off',
|
package/cjs/modules/react.js
CHANGED
|
@@ -41,7 +41,11 @@ function react() {
|
|
|
41
41
|
'@eslint-react/jsx-key-before-spread': 'error',
|
|
42
42
|
'@eslint-react/jsx-no-undef': 'off',
|
|
43
43
|
'@eslint-react/jsx-no-iife': 'warn',
|
|
44
|
+
'@eslint-react/jsx-no-duplicate-props': 'error',
|
|
45
|
+
'@eslint-react/jsx-no-comment-textnodes': 'warn',
|
|
44
46
|
'@eslint-react/jsx-uses-react': 'off',
|
|
47
|
+
'@eslint-react/jsx-shorthand-boolean': 'warn',
|
|
48
|
+
'@eslint-react/jsx-shorthand-fragment': 'warn',
|
|
45
49
|
'@eslint-react/no-access-state-in-setstate': 'error',
|
|
46
50
|
'@eslint-react/no-array-index-key': 'warn',
|
|
47
51
|
'@eslint-react/no-children-count': 'warn',
|
|
@@ -51,7 +55,6 @@ function react() {
|
|
|
51
55
|
'@eslint-react/no-children-prop': 'warn',
|
|
52
56
|
'@eslint-react/no-children-to-array': 'warn',
|
|
53
57
|
'@eslint-react/no-clone-element': 'warn',
|
|
54
|
-
'@eslint-react/no-comment-textnodes': 'warn',
|
|
55
58
|
'@eslint-react/no-component-will-mount': 'error',
|
|
56
59
|
'@eslint-react/no-component-will-receive-props': 'error',
|
|
57
60
|
'@eslint-react/no-component-will-update': 'error',
|
|
@@ -60,7 +63,6 @@ function react() {
|
|
|
60
63
|
'@eslint-react/no-direct-mutation-state': 'error',
|
|
61
64
|
'@eslint-react/no-duplicate-key': 'error',
|
|
62
65
|
'@eslint-react/no-default-props': 'warn',
|
|
63
|
-
'@eslint-react/jsx-no-duplicate-props': 'error',
|
|
64
66
|
'@eslint-react/no-forward-ref': 'warn',
|
|
65
67
|
'@eslint-react/no-implicit-key': 'error',
|
|
66
68
|
'@eslint-react/no-missing-context-display-name': 'warn',
|
|
@@ -73,6 +75,7 @@ function react() {
|
|
|
73
75
|
'@eslint-react/no-set-state-in-component-did-update': 'warn',
|
|
74
76
|
'@eslint-react/no-set-state-in-component-will-update': 'warn',
|
|
75
77
|
'@eslint-react/no-string-refs': 'error',
|
|
78
|
+
'@eslint-react/dom/no-string-style-prop': 'error',
|
|
76
79
|
'@eslint-react/no-unsafe-component-will-mount': 'warn',
|
|
77
80
|
'@eslint-react/no-unsafe-component-will-receive-props': 'warn',
|
|
78
81
|
'@eslint-react/no-unsafe-component-will-update': 'warn',
|
|
@@ -80,18 +83,17 @@ function react() {
|
|
|
80
83
|
'@eslint-react/no-unstable-default-props': 'error',
|
|
81
84
|
'@eslint-react/no-unused-class-component-members': 'warn',
|
|
82
85
|
'@eslint-react/no-unused-state': 'warn',
|
|
86
|
+
'@eslint-react/no-unused-props': 'off',
|
|
83
87
|
'@eslint-react/no-useless-forward-ref': 'off',
|
|
84
88
|
'@eslint-react/no-useless-fragment': 'warn',
|
|
85
89
|
'@eslint-react/no-use-context': 'warn',
|
|
90
|
+
'@eslint-react/no-unnecessary-use-callback': 'warn',
|
|
91
|
+
'@eslint-react/no-unnecessary-use-memo': 'warn',
|
|
92
|
+
'@eslint-react/no-unnecessary-use-prefix': 'warn',
|
|
93
|
+
'@eslint-react/no-unnecessary-key': 'warn',
|
|
94
|
+
'@eslint-react/prefer-use-state-lazy-initialization': 'warn',
|
|
86
95
|
'@eslint-react/prefer-destructuring-assignment': 'warn',
|
|
87
|
-
'@eslint-react/
|
|
88
|
-
'@eslint-react/avoid-shorthand-boolean': 'off',
|
|
89
|
-
'@eslint-react/prefer-shorthand-fragment': 'warn',
|
|
90
|
-
'@eslint-react/avoid-shorthand-fragment': 'off',
|
|
91
|
-
'@eslint-react/hooks-extra/prefer-use-state-lazy-initialization': 'warn',
|
|
92
|
-
'@eslint-react/hooks-extra/no-unnecessary-use-callback': 'warn',
|
|
93
|
-
'@eslint-react/hooks-extra/no-unnecessary-use-prefix': 'warn',
|
|
94
|
-
'@eslint-react/hooks-extra/no-unnecessary-use-memo': 'warn',
|
|
96
|
+
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 'warn',
|
|
95
97
|
'@eslint-react/naming-convention/component-name': 'warn',
|
|
96
98
|
'@eslint-react/naming-convention/context-name': 'warn',
|
|
97
99
|
'@eslint-react/naming-convention/filename-extension': ['error', {
|
package/cjs/modules/tests.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _eslintPlugin = _interopRequireDefault(require("@vitest/eslint-plugin"));
|
|
8
8
|
var _globals = _interopRequireDefault(require("globals"));
|
|
9
9
|
var _conditions = require("../utils/conditions.js");
|
|
10
10
|
var _globs = require("../utils/globs.js");
|
|
@@ -16,7 +16,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
16
16
|
function tests(options = {}) {
|
|
17
17
|
return {
|
|
18
18
|
plugins: {
|
|
19
|
-
|
|
19
|
+
vitest: _eslintPlugin.default
|
|
20
20
|
},
|
|
21
21
|
files: [..._globs.globs.test, ..._globs.globs.e2e],
|
|
22
22
|
languageOptions: {
|
|
@@ -26,12 +26,13 @@ function tests(options = {}) {
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
rules: {
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
29
|
+
'vitest/padding-around-after-all-blocks': 'warn',
|
|
30
|
+
'vitest/padding-around-after-each-blocks': 'warn',
|
|
31
|
+
'vitest/padding-around-before-all-blocks': 'warn',
|
|
32
|
+
'vitest/padding-around-before-each-blocks': 'warn',
|
|
33
|
+
'vitest/padding-around-describe-blocks': 'warn',
|
|
34
|
+
'vitest/padding-around-expect-groups': 'warn',
|
|
35
|
+
'vitest/padding-around-test-blocks': 'warn',
|
|
35
36
|
'max-lines-per-function': 'off',
|
|
36
37
|
'no-sparse-arrays': 'off',
|
|
37
38
|
'no-empty-function': 'off',
|
|
@@ -70,8 +70,9 @@ function typescript(options = {}) {
|
|
|
70
70
|
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
71
71
|
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
72
72
|
'@typescript-eslint/no-empty-function': 'error',
|
|
73
|
-
'@typescript-eslint/no-empty-
|
|
74
|
-
|
|
73
|
+
'@typescript-eslint/no-empty-object-type': ['warn', {
|
|
74
|
+
allowInterfaces: 'with-single-extends'
|
|
75
|
+
}],
|
|
75
76
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
76
77
|
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
77
78
|
'@typescript-eslint/no-extraneous-class': ['warn', {
|
package/cjs/modules/vitest.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _eslintPlugin = _interopRequireDefault(require("@vitest/eslint-plugin"));
|
|
8
8
|
var _globs = require("../utils/globs.js");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
/**
|
|
@@ -14,7 +14,7 @@ function vitest() {
|
|
|
14
14
|
return {
|
|
15
15
|
files: _globs.globs.test,
|
|
16
16
|
plugins: {
|
|
17
|
-
vitest:
|
|
17
|
+
vitest: _eslintPlugin.default
|
|
18
18
|
},
|
|
19
19
|
languageOptions: {
|
|
20
20
|
globals: {
|
|
@@ -22,19 +22,25 @@ function vitest() {
|
|
|
22
22
|
test: 'writable',
|
|
23
23
|
describe: 'writable',
|
|
24
24
|
it: 'writable',
|
|
25
|
+
expectTypeOf: 'writable',
|
|
26
|
+
assertType: 'writable',
|
|
25
27
|
expect: 'writable',
|
|
26
28
|
assert: 'writable',
|
|
29
|
+
chai: 'writable',
|
|
27
30
|
vitest: 'writable',
|
|
28
31
|
vi: 'writable',
|
|
29
32
|
beforeAll: 'writable',
|
|
30
33
|
afterAll: 'writable',
|
|
31
34
|
beforeEach: 'writable',
|
|
32
|
-
afterEach: 'writable'
|
|
35
|
+
afterEach: 'writable',
|
|
36
|
+
onTestFailed: 'writable',
|
|
37
|
+
onTestFinished: 'writable'
|
|
33
38
|
}
|
|
34
39
|
},
|
|
35
40
|
rules: {
|
|
36
41
|
'vitest/consistent-test-filename': 'off',
|
|
37
42
|
'vitest/consistent-test-it': 'warn',
|
|
43
|
+
'vitest/consistent-vitest-vi': 'warn',
|
|
38
44
|
'vitest/expect-expect': 'warn',
|
|
39
45
|
'vitest/max-expects': 'off',
|
|
40
46
|
'vitest/max-nested-describe': 'off',
|
|
@@ -50,6 +56,7 @@ function vitest() {
|
|
|
50
56
|
'vitest/no-hooks': 'off',
|
|
51
57
|
'vitest/no-identical-title': 'error',
|
|
52
58
|
'vitest/no-import-node-test': 'error',
|
|
59
|
+
'vitest/no-importing-vitest-globals': 'off',
|
|
53
60
|
'vitest/no-interpolation-in-snapshots': 'warn',
|
|
54
61
|
'vitest/no-large-snapshots': 'warn',
|
|
55
62
|
'vitest/no-mocks-import': 'warn',
|
|
@@ -58,18 +65,23 @@ function vitest() {
|
|
|
58
65
|
'vitest/no-standalone-expect': 'warn',
|
|
59
66
|
'vitest/no-test-prefixes': 'warn',
|
|
60
67
|
'vitest/no-test-return-statement': 'warn',
|
|
68
|
+
'vitest/prefer-called-once': 'warn',
|
|
69
|
+
'vitest/prefer-called-times': 'off',
|
|
61
70
|
'vitest/prefer-called-with': 'warn',
|
|
62
71
|
'vitest/prefer-comparison-matcher': 'warn',
|
|
72
|
+
'vitest/prefer-describe-function-title': 'off',
|
|
63
73
|
'vitest/prefer-each': 'warn',
|
|
64
74
|
'vitest/prefer-equality-matcher': 'warn',
|
|
65
75
|
'vitest/prefer-expect-assertions': 'off',
|
|
66
76
|
'vitest/prefer-expect-resolves': 'warn',
|
|
67
77
|
'vitest/prefer-hooks-in-order': 'warn',
|
|
68
78
|
'vitest/prefer-hooks-on-top': 'warn',
|
|
69
|
-
'vitest/prefer-
|
|
79
|
+
'vitest/prefer-importing-vitest-globals': 'off',
|
|
80
|
+
'vitest/prefer-lowercase-title': 'warn',
|
|
70
81
|
'vitest/prefer-mock-promise-shorthand': 'warn',
|
|
71
82
|
'vitest/prefer-snapshot-hint': 'warn',
|
|
72
83
|
'vitest/prefer-spy-on': 'warn',
|
|
84
|
+
'vitest/prefer-strict-boolean-matchers': 'off',
|
|
73
85
|
'vitest/prefer-strict-equal': 'off',
|
|
74
86
|
'vitest/prefer-to-be': 'warn',
|
|
75
87
|
'vitest/prefer-to-be-falsy': 'off',
|
|
@@ -78,13 +90,17 @@ function vitest() {
|
|
|
78
90
|
'vitest/prefer-to-contain': 'warn',
|
|
79
91
|
'vitest/prefer-to-have-length': 'warn',
|
|
80
92
|
'vitest/prefer-todo': 'warn',
|
|
93
|
+
'vitest/prefer-vi-mocked': 'warn',
|
|
81
94
|
'vitest/require-hook': 'warn',
|
|
82
95
|
'vitest/require-local-test-context-for-concurrent-snapshots': 'warn',
|
|
96
|
+
'vitest/require-mock-type-parameters': 'off',
|
|
83
97
|
'vitest/require-to-throw-message': 'warn',
|
|
84
98
|
'vitest/require-top-level-describe': 'warn',
|
|
85
99
|
'vitest/valid-describe-callback': 'warn',
|
|
86
100
|
'vitest/valid-expect': 'warn',
|
|
87
|
-
'vitest/valid-
|
|
101
|
+
'vitest/valid-expect-in-promise': 'warn',
|
|
102
|
+
'vitest/valid-title': 'warn',
|
|
103
|
+
'vitest/warn-todo': 'warn'
|
|
88
104
|
}
|
|
89
105
|
};
|
|
90
106
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstacksjs/eslint-config",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "fullstacks <fullstacksjs@gmail.com>",
|
|
6
6
|
"description": "fullstacks eslint config",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@eslint-react/eslint-plugin": "
|
|
39
|
-
"@eslint/compat": "1.
|
|
40
|
-
"@next/eslint-plugin-next": "15.5.
|
|
41
|
-
"@stylistic/eslint-plugin": "5.
|
|
38
|
+
"@eslint-react/eslint-plugin": "2.0.0",
|
|
39
|
+
"@eslint/compat": "1.4.0",
|
|
40
|
+
"@next/eslint-plugin-next": "15.5.4",
|
|
41
|
+
"@stylistic/eslint-plugin": "5.4.0",
|
|
42
|
+
"@vitest/eslint-plugin": "1.3.13",
|
|
42
43
|
"deepmerge": "4.3.1",
|
|
43
|
-
"eslint-plugin-better-tailwindcss": "3.7.
|
|
44
|
+
"eslint-plugin-better-tailwindcss": "3.7.9",
|
|
44
45
|
"eslint-plugin-cypress": "5.1.1",
|
|
45
46
|
"eslint-plugin-import-x": "4.16.1",
|
|
46
47
|
"eslint-plugin-jest": "29.0.1",
|
|
47
|
-
"eslint-plugin-jest-formatting": "3.1.0",
|
|
48
48
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
49
|
-
"eslint-plugin-n": "17.
|
|
49
|
+
"eslint-plugin-n": "17.23.1",
|
|
50
50
|
"eslint-plugin-perfectionist": "4.15.0",
|
|
51
51
|
"eslint-plugin-playwright": "2.2.2",
|
|
52
52
|
"eslint-plugin-prettier": "5.5.4",
|
|
@@ -54,26 +54,25 @@
|
|
|
54
54
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
55
55
|
"eslint-plugin-regexp": "2.10.0",
|
|
56
56
|
"eslint-plugin-storybook": "0.12.0",
|
|
57
|
-
"eslint-plugin-vitest": "0.5.4",
|
|
58
57
|
"globals": "16.4.0",
|
|
59
58
|
"local-pkg": "1.1.2",
|
|
60
|
-
"typescript-eslint": "8.
|
|
59
|
+
"typescript-eslint": "8.44.1"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@eslint/eslintrc": "3.3.1",
|
|
64
|
-
"@eslint/js": "9.
|
|
63
|
+
"@eslint/js": "9.36.0",
|
|
65
64
|
"@semantic-release/github": "11.0.6",
|
|
66
65
|
"@semantic-release/npm": "12.0.2",
|
|
67
66
|
"@semantic-release/release-notes-generator": "14.1.0",
|
|
68
67
|
"@types/eslint": "9.6.1",
|
|
69
68
|
"cspell": "9.2.1",
|
|
70
|
-
"eslint": "9.
|
|
69
|
+
"eslint": "9.36.0",
|
|
71
70
|
"husky": "9.1.7",
|
|
72
71
|
"jest": "30.1.3",
|
|
73
|
-
"lint-staged": "16.1
|
|
72
|
+
"lint-staged": "16.2.1",
|
|
74
73
|
"pinst": "3.0.0",
|
|
75
74
|
"prettier": "3.6.2",
|
|
76
|
-
"semantic-release": "24.2.
|
|
75
|
+
"semantic-release": "24.2.9",
|
|
77
76
|
"typescript": "5.9.2",
|
|
78
77
|
"unbuild": "3.6.1"
|
|
79
78
|
},
|
package/src/modules/base.mjs
CHANGED
|
@@ -157,6 +157,12 @@ function base(options = {}) {
|
|
|
157
157
|
'one-var': ['error', { uninitialized: 'never', initialized: 'never' }],
|
|
158
158
|
'prefer-arrow-callback': ['warn', { allowNamedFunctions: true, allowUnboundThis: true }],
|
|
159
159
|
'prefer-const': 'warn',
|
|
160
|
+
'preserve-caught-error': strict(options, [
|
|
161
|
+
'warn',
|
|
162
|
+
{
|
|
163
|
+
requireCatchParameter: true,
|
|
164
|
+
},
|
|
165
|
+
]),
|
|
160
166
|
'prefer-exponentiation-operator': 'warn',
|
|
161
167
|
'prefer-numeric-literals': 'error',
|
|
162
168
|
'prefer-object-has-own': 'warn',
|
package/src/modules/node.mjs
CHANGED
|
@@ -35,7 +35,6 @@ function node(options = {}) {
|
|
|
35
35
|
'n/no-unsupported-features/node-builtins': 'off', // Nice but not a general rule
|
|
36
36
|
'n/prefer-global/buffer': 'warn',
|
|
37
37
|
'n/prefer-global/console': 'warn',
|
|
38
|
-
'n/prefer-global/process': 'warn',
|
|
39
38
|
'n/prefer-global/text-decoder': 'warn',
|
|
40
39
|
'n/prefer-global/text-encoder': 'warn',
|
|
41
40
|
'n/prefer-global/url-search-params': 'warn',
|
|
@@ -46,6 +45,7 @@ function node(options = {}) {
|
|
|
46
45
|
'n/process-exit-as-throw': 'error',
|
|
47
46
|
|
|
48
47
|
// Disabled
|
|
48
|
+
'n/prefer-global/process': 'off',
|
|
49
49
|
'n/file-extension-in-import': 'off',
|
|
50
50
|
'n/no-extraneous-import': 'off',
|
|
51
51
|
'n/no-extraneous-require': 'off',
|
package/src/modules/react.mjs
CHANGED
|
@@ -36,7 +36,12 @@ function react() {
|
|
|
36
36
|
'@eslint-react/jsx-key-before-spread': 'error',
|
|
37
37
|
'@eslint-react/jsx-no-undef': 'off',
|
|
38
38
|
'@eslint-react/jsx-no-iife': 'warn',
|
|
39
|
+
'@eslint-react/jsx-no-duplicate-props': 'error',
|
|
40
|
+
'@eslint-react/jsx-no-comment-textnodes': 'warn',
|
|
39
41
|
'@eslint-react/jsx-uses-react': 'off',
|
|
42
|
+
'@eslint-react/jsx-shorthand-boolean': 'warn',
|
|
43
|
+
'@eslint-react/jsx-shorthand-fragment': 'warn',
|
|
44
|
+
|
|
40
45
|
'@eslint-react/no-access-state-in-setstate': 'error',
|
|
41
46
|
'@eslint-react/no-array-index-key': 'warn',
|
|
42
47
|
'@eslint-react/no-children-count': 'warn',
|
|
@@ -46,7 +51,6 @@ function react() {
|
|
|
46
51
|
'@eslint-react/no-children-prop': 'warn',
|
|
47
52
|
'@eslint-react/no-children-to-array': 'warn',
|
|
48
53
|
'@eslint-react/no-clone-element': 'warn',
|
|
49
|
-
'@eslint-react/no-comment-textnodes': 'warn',
|
|
50
54
|
'@eslint-react/no-component-will-mount': 'error',
|
|
51
55
|
'@eslint-react/no-component-will-receive-props': 'error',
|
|
52
56
|
'@eslint-react/no-component-will-update': 'error',
|
|
@@ -55,7 +59,6 @@ function react() {
|
|
|
55
59
|
'@eslint-react/no-direct-mutation-state': 'error',
|
|
56
60
|
'@eslint-react/no-duplicate-key': 'error',
|
|
57
61
|
'@eslint-react/no-default-props': 'warn',
|
|
58
|
-
'@eslint-react/jsx-no-duplicate-props': 'error',
|
|
59
62
|
'@eslint-react/no-forward-ref': 'warn',
|
|
60
63
|
'@eslint-react/no-implicit-key': 'error',
|
|
61
64
|
'@eslint-react/no-missing-context-display-name': 'warn',
|
|
@@ -68,6 +71,7 @@ function react() {
|
|
|
68
71
|
'@eslint-react/no-set-state-in-component-did-update': 'warn',
|
|
69
72
|
'@eslint-react/no-set-state-in-component-will-update': 'warn',
|
|
70
73
|
'@eslint-react/no-string-refs': 'error',
|
|
74
|
+
'@eslint-react/dom/no-string-style-prop': 'error',
|
|
71
75
|
'@eslint-react/no-unsafe-component-will-mount': 'warn',
|
|
72
76
|
'@eslint-react/no-unsafe-component-will-receive-props': 'warn',
|
|
73
77
|
'@eslint-react/no-unsafe-component-will-update': 'warn',
|
|
@@ -75,21 +79,19 @@ function react() {
|
|
|
75
79
|
'@eslint-react/no-unstable-default-props': 'error',
|
|
76
80
|
'@eslint-react/no-unused-class-component-members': 'warn',
|
|
77
81
|
'@eslint-react/no-unused-state': 'warn',
|
|
82
|
+
'@eslint-react/no-unused-props': 'off',
|
|
78
83
|
'@eslint-react/no-useless-forward-ref': 'off',
|
|
79
84
|
'@eslint-react/no-useless-fragment': 'warn',
|
|
80
85
|
'@eslint-react/no-use-context': 'warn',
|
|
81
|
-
'@eslint-react/
|
|
82
|
-
|
|
83
|
-
'@eslint-react/
|
|
84
|
-
'@eslint-react/
|
|
86
|
+
'@eslint-react/no-unnecessary-use-callback': 'warn',
|
|
87
|
+
'@eslint-react/no-unnecessary-use-memo': 'warn',
|
|
88
|
+
'@eslint-react/no-unnecessary-use-prefix': 'warn',
|
|
89
|
+
'@eslint-react/no-unnecessary-key': 'warn',
|
|
85
90
|
|
|
86
|
-
'@eslint-react/prefer-
|
|
87
|
-
'@eslint-react/
|
|
91
|
+
'@eslint-react/prefer-use-state-lazy-initialization': 'warn',
|
|
92
|
+
'@eslint-react/prefer-destructuring-assignment': 'warn',
|
|
88
93
|
|
|
89
|
-
'@eslint-react/hooks-extra/
|
|
90
|
-
'@eslint-react/hooks-extra/no-unnecessary-use-callback': 'warn',
|
|
91
|
-
'@eslint-react/hooks-extra/no-unnecessary-use-prefix': 'warn',
|
|
92
|
-
'@eslint-react/hooks-extra/no-unnecessary-use-memo': 'warn',
|
|
94
|
+
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 'warn',
|
|
93
95
|
|
|
94
96
|
'@eslint-react/naming-convention/component-name': 'warn',
|
|
95
97
|
'@eslint-react/naming-convention/context-name': 'warn',
|
package/src/modules/tests.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import plugin from 'eslint-plugin
|
|
1
|
+
import plugin from '@vitest/eslint-plugin';
|
|
2
2
|
import globals from 'globals';
|
|
3
3
|
|
|
4
4
|
import { predicate } from '../utils/conditions.mjs';
|
|
@@ -10,18 +10,19 @@ import { globs } from '../utils/globs.mjs';
|
|
|
10
10
|
*/
|
|
11
11
|
function tests(options = {}) {
|
|
12
12
|
return {
|
|
13
|
-
plugins: {
|
|
13
|
+
plugins: { vitest: plugin },
|
|
14
14
|
files: [...globs.test, ...globs.e2e],
|
|
15
15
|
languageOptions: {
|
|
16
16
|
globals: { ...globals['shared-node-browser'], ...globals.jest },
|
|
17
17
|
},
|
|
18
18
|
rules: {
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
19
|
+
'vitest/padding-around-after-all-blocks': 'warn',
|
|
20
|
+
'vitest/padding-around-after-each-blocks': 'warn',
|
|
21
|
+
'vitest/padding-around-before-all-blocks': 'warn',
|
|
22
|
+
'vitest/padding-around-before-each-blocks': 'warn',
|
|
23
|
+
'vitest/padding-around-describe-blocks': 'warn',
|
|
24
|
+
'vitest/padding-around-expect-groups': 'warn',
|
|
25
|
+
'vitest/padding-around-test-blocks': 'warn',
|
|
25
26
|
|
|
26
27
|
'max-lines-per-function': 'off',
|
|
27
28
|
'no-sparse-arrays': 'off',
|
|
@@ -74,7 +74,7 @@ function typescript(options = {}) {
|
|
|
74
74
|
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
75
75
|
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
76
76
|
'@typescript-eslint/no-empty-function': 'error',
|
|
77
|
-
'@typescript-eslint/no-empty-
|
|
77
|
+
'@typescript-eslint/no-empty-object-type': ['warn', { allowInterfaces: 'with-single-extends' }],
|
|
78
78
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
79
79
|
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
80
80
|
'@typescript-eslint/no-extraneous-class': ['warn', { allowWithDecorator: true }],
|
package/src/modules/vitest.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import plugin from 'eslint-plugin
|
|
1
|
+
import plugin from '@vitest/eslint-plugin';
|
|
2
2
|
|
|
3
3
|
import { globs } from '../utils/globs.mjs';
|
|
4
4
|
|
|
@@ -15,19 +15,25 @@ function vitest() {
|
|
|
15
15
|
test: 'writable',
|
|
16
16
|
describe: 'writable',
|
|
17
17
|
it: 'writable',
|
|
18
|
+
expectTypeOf: 'writable',
|
|
19
|
+
assertType: 'writable',
|
|
18
20
|
expect: 'writable',
|
|
19
21
|
assert: 'writable',
|
|
22
|
+
chai: 'writable',
|
|
20
23
|
vitest: 'writable',
|
|
21
24
|
vi: 'writable',
|
|
22
25
|
beforeAll: 'writable',
|
|
23
26
|
afterAll: 'writable',
|
|
24
27
|
beforeEach: 'writable',
|
|
25
28
|
afterEach: 'writable',
|
|
29
|
+
onTestFailed: 'writable',
|
|
30
|
+
onTestFinished: 'writable',
|
|
26
31
|
},
|
|
27
32
|
},
|
|
28
33
|
rules: {
|
|
29
34
|
'vitest/consistent-test-filename': 'off',
|
|
30
35
|
'vitest/consistent-test-it': 'warn',
|
|
36
|
+
'vitest/consistent-vitest-vi': 'warn',
|
|
31
37
|
'vitest/expect-expect': 'warn',
|
|
32
38
|
'vitest/max-expects': 'off',
|
|
33
39
|
'vitest/max-nested-describe': 'off',
|
|
@@ -43,6 +49,7 @@ function vitest() {
|
|
|
43
49
|
'vitest/no-hooks': 'off',
|
|
44
50
|
'vitest/no-identical-title': 'error',
|
|
45
51
|
'vitest/no-import-node-test': 'error',
|
|
52
|
+
'vitest/no-importing-vitest-globals': 'off',
|
|
46
53
|
'vitest/no-interpolation-in-snapshots': 'warn',
|
|
47
54
|
'vitest/no-large-snapshots': 'warn',
|
|
48
55
|
'vitest/no-mocks-import': 'warn',
|
|
@@ -51,18 +58,23 @@ function vitest() {
|
|
|
51
58
|
'vitest/no-standalone-expect': 'warn',
|
|
52
59
|
'vitest/no-test-prefixes': 'warn',
|
|
53
60
|
'vitest/no-test-return-statement': 'warn',
|
|
61
|
+
'vitest/prefer-called-once': 'warn',
|
|
62
|
+
'vitest/prefer-called-times': 'off',
|
|
54
63
|
'vitest/prefer-called-with': 'warn',
|
|
55
64
|
'vitest/prefer-comparison-matcher': 'warn',
|
|
65
|
+
'vitest/prefer-describe-function-title': 'off',
|
|
56
66
|
'vitest/prefer-each': 'warn',
|
|
57
67
|
'vitest/prefer-equality-matcher': 'warn',
|
|
58
68
|
'vitest/prefer-expect-assertions': 'off',
|
|
59
69
|
'vitest/prefer-expect-resolves': 'warn',
|
|
60
70
|
'vitest/prefer-hooks-in-order': 'warn',
|
|
61
71
|
'vitest/prefer-hooks-on-top': 'warn',
|
|
62
|
-
'vitest/prefer-
|
|
72
|
+
'vitest/prefer-importing-vitest-globals': 'off',
|
|
73
|
+
'vitest/prefer-lowercase-title': 'warn',
|
|
63
74
|
'vitest/prefer-mock-promise-shorthand': 'warn',
|
|
64
75
|
'vitest/prefer-snapshot-hint': 'warn',
|
|
65
76
|
'vitest/prefer-spy-on': 'warn',
|
|
77
|
+
'vitest/prefer-strict-boolean-matchers': 'off',
|
|
66
78
|
'vitest/prefer-strict-equal': 'off',
|
|
67
79
|
'vitest/prefer-to-be': 'warn',
|
|
68
80
|
'vitest/prefer-to-be-falsy': 'off',
|
|
@@ -71,13 +83,17 @@ function vitest() {
|
|
|
71
83
|
'vitest/prefer-to-contain': 'warn',
|
|
72
84
|
'vitest/prefer-to-have-length': 'warn',
|
|
73
85
|
'vitest/prefer-todo': 'warn',
|
|
86
|
+
'vitest/prefer-vi-mocked': 'warn',
|
|
74
87
|
'vitest/require-hook': 'warn',
|
|
75
88
|
'vitest/require-local-test-context-for-concurrent-snapshots': 'warn',
|
|
89
|
+
'vitest/require-mock-type-parameters': 'off',
|
|
76
90
|
'vitest/require-to-throw-message': 'warn',
|
|
77
91
|
'vitest/require-top-level-describe': 'warn',
|
|
78
92
|
'vitest/valid-describe-callback': 'warn',
|
|
79
93
|
'vitest/valid-expect': 'warn',
|
|
94
|
+
'vitest/valid-expect-in-promise': 'warn',
|
|
80
95
|
'vitest/valid-title': 'warn',
|
|
96
|
+
'vitest/warn-todo': 'warn',
|
|
81
97
|
},
|
|
82
98
|
};
|
|
83
99
|
}
|