@pplancq/eslint-config 6.0.17 → 6.0.19
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/CHANGELOG.md +28 -0
- package/README.md +1 -1
- package/bin/init.mjs +4 -4
- package/main.js +18 -18
- package/package.json +10 -10
- package/rules/base.js +509 -509
- package/rules/import.js +87 -87
- package/rules/playwright.js +55 -55
- package/rules/prettier.js +107 -107
- package/rules/react-jsx-a11y.js +70 -70
- package/rules/react.js +256 -256
- package/rules/typescript.js +157 -157
- package/rules/vitest.js +56 -56
package/rules/vitest.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import vitestPlugin from
|
|
1
|
+
import vitestPlugin from "@vitest/eslint-plugin";
|
|
2
2
|
|
|
3
3
|
export const vitestRules = {
|
|
4
4
|
plugins: {
|
|
5
|
-
|
|
5
|
+
"@vitest": vitestPlugin,
|
|
6
6
|
},
|
|
7
7
|
languageOptions: {
|
|
8
8
|
globals: {
|
|
@@ -14,220 +14,220 @@ export const vitestRules = {
|
|
|
14
14
|
|
|
15
15
|
// import/no-extraneous-dependencies
|
|
16
16
|
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
|
|
17
|
-
|
|
17
|
+
"import/no-extraneous-dependencies": "off",
|
|
18
18
|
|
|
19
19
|
// eslint-plugin-vitest https://github.com/veritem/eslint-plugin-vitest
|
|
20
20
|
|
|
21
21
|
// Require `.spec` test file pattern
|
|
22
22
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
23
|
-
|
|
23
|
+
"@vitest/consistent-test-filename": "off",
|
|
24
24
|
|
|
25
25
|
// Enforce using `test` or `it` but not both
|
|
26
26
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md
|
|
27
|
-
|
|
27
|
+
"@vitest/consistent-test-it": "off",
|
|
28
28
|
|
|
29
29
|
// Enforce having expectation in test body
|
|
30
30
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
|
|
31
|
-
|
|
31
|
+
"@vitest/expect-expect": "off",
|
|
32
32
|
|
|
33
33
|
// Enforce a maximum number of `expect` per test
|
|
34
34
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
|
|
35
|
-
|
|
35
|
+
"@vitest/max-expects": "off",
|
|
36
36
|
|
|
37
37
|
// Require `describe` block to be less than set max value or default value
|
|
38
38
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md
|
|
39
|
-
|
|
39
|
+
"@vitest/max-nested-describe": "off",
|
|
40
40
|
|
|
41
41
|
// Disallow alias methods
|
|
42
42
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-alias-methods.md
|
|
43
|
-
|
|
43
|
+
"@vitest/no-alias-methods": "off",
|
|
44
44
|
|
|
45
45
|
// Disallow commented out tests
|
|
46
46
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-commented-out-tests.md
|
|
47
|
-
|
|
47
|
+
"@vitest/no-commented-out-tests": "off",
|
|
48
48
|
|
|
49
49
|
// Disallow conditional expects
|
|
50
50
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
|
|
51
|
-
|
|
51
|
+
"@vitest/no-conditional-expect": "error",
|
|
52
52
|
|
|
53
53
|
// Disallow conditional tests
|
|
54
54
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
|
|
55
|
-
|
|
55
|
+
"@vitest/no-conditional-in-test": "off",
|
|
56
56
|
|
|
57
57
|
// Disallow conditional tests
|
|
58
58
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-tests.md
|
|
59
|
-
|
|
59
|
+
"@vitest/no-conditional-tests": "off",
|
|
60
60
|
|
|
61
61
|
// Disallow disabled tests
|
|
62
62
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-disabled-tests.md
|
|
63
|
-
|
|
63
|
+
"@vitest/no-disabled-tests": "off",
|
|
64
64
|
|
|
65
65
|
// Disallow using a callback in asynchronous tests and hooks
|
|
66
66
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-done-callback.md
|
|
67
|
-
|
|
67
|
+
"@vitest/no-done-callback": "off",
|
|
68
68
|
|
|
69
69
|
// Disallow duplicate hooks and teardown hooks
|
|
70
70
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-duplicate-hooks.md
|
|
71
|
-
|
|
71
|
+
"@vitest/no-duplicate-hooks": "off",
|
|
72
72
|
|
|
73
73
|
// Disallow focused tests
|
|
74
74
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-focused-tests.md
|
|
75
|
-
|
|
75
|
+
"@vitest/no-focused-tests": "off",
|
|
76
76
|
|
|
77
77
|
// Disallow setup and teardown hooks
|
|
78
78
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-hooks.md
|
|
79
|
-
|
|
79
|
+
"@vitest/no-hooks": "off",
|
|
80
80
|
|
|
81
81
|
// Disallow identical titles
|
|
82
82
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-identical-title.md
|
|
83
|
-
|
|
83
|
+
"@vitest/no-identical-title": "error",
|
|
84
84
|
|
|
85
85
|
// Disallow importing `node:test`
|
|
86
86
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-import-node-test.md
|
|
87
|
-
|
|
87
|
+
"@vitest/no-import-node-test": "off",
|
|
88
88
|
|
|
89
89
|
// Disallow string interpolation in snapshots
|
|
90
90
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-interpolation-in-snapshots.md
|
|
91
|
-
|
|
91
|
+
"@vitest/no-interpolation-in-snapshots": "error",
|
|
92
92
|
|
|
93
93
|
// Disallow large snapshots
|
|
94
94
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-large-snapshots.md
|
|
95
|
-
|
|
95
|
+
"@vitest/no-large-snapshots": "off",
|
|
96
96
|
|
|
97
97
|
// Disallow importing from `mocks` directory
|
|
98
98
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-mocks-import.md
|
|
99
|
-
|
|
99
|
+
"@vitest/no-mocks-import": "error",
|
|
100
100
|
|
|
101
101
|
// Disallow the use of certain matchers
|
|
102
102
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-matchers.md
|
|
103
|
-
|
|
103
|
+
"@vitest/no-restricted-matchers": "off",
|
|
104
104
|
|
|
105
105
|
// Disallow specific `vi.` methods
|
|
106
106
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-vi-methods.md
|
|
107
|
-
|
|
107
|
+
"@vitest/no-restricted-vi-methods": "off",
|
|
108
108
|
|
|
109
109
|
// Disallow using `expect` outside of `it` or `test` blocks
|
|
110
110
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-standalone-expect.md
|
|
111
|
-
|
|
111
|
+
"@vitest/no-standalone-expect": "off",
|
|
112
112
|
|
|
113
113
|
// Disallow using `test` as a prefix
|
|
114
114
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-prefixes.md
|
|
115
|
-
|
|
115
|
+
"@vitest/no-test-prefixes": "off",
|
|
116
116
|
|
|
117
117
|
// Disallow `return` statements in tests
|
|
118
118
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
|
|
119
|
-
|
|
119
|
+
"@vitest/no-test-return-statement": "off",
|
|
120
120
|
|
|
121
121
|
// Enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`
|
|
122
122
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
|
|
123
|
-
|
|
123
|
+
"@vitest/prefer-called-with": "error",
|
|
124
124
|
|
|
125
125
|
// Enforce using the built-in comparison matchers
|
|
126
126
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-comparison-matcher.md
|
|
127
|
-
|
|
127
|
+
"@vitest/prefer-comparison-matcher": "off",
|
|
128
128
|
|
|
129
129
|
// Enforce using `each` rather than manual loops
|
|
130
130
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
|
|
131
|
-
|
|
131
|
+
"@vitest/prefer-each": "off",
|
|
132
132
|
|
|
133
133
|
// Enforce using the built-in quality matchers
|
|
134
134
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
|
|
135
|
-
|
|
135
|
+
"@vitest/prefer-equality-matcher": "off",
|
|
136
136
|
|
|
137
137
|
// Enforce using `expect` assertions instead of callbacks
|
|
138
138
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-assertions.md
|
|
139
|
-
|
|
139
|
+
"@vitest/prefer-expect-assertions": "off",
|
|
140
140
|
|
|
141
141
|
// Enforce using `expect().resolves` over `expect(await ...)` syntax
|
|
142
142
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-resolves.md
|
|
143
|
-
|
|
143
|
+
"@vitest/prefer-expect-resolves": "off",
|
|
144
144
|
|
|
145
145
|
// Enforce having hooks in consistent order (`vitest/prefer-hooks-in-order`)
|
|
146
146
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
|
|
147
|
-
|
|
147
|
+
"@vitest/prefer-hooks-in-order": "off",
|
|
148
148
|
|
|
149
149
|
// Enforce having hooks before any test cases
|
|
150
150
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-on-top.md
|
|
151
|
-
|
|
151
|
+
"@vitest/prefer-hooks-on-top": "off",
|
|
152
152
|
|
|
153
153
|
// Enforce lowercase titles
|
|
154
154
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
|
|
155
|
-
|
|
155
|
+
"@vitest/prefer-lowercase-title": "off",
|
|
156
156
|
|
|
157
157
|
// Enforce mock resolved/rejected shorthands for promises
|
|
158
158
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
|
|
159
|
-
|
|
159
|
+
"@vitest/prefer-mock-promise-shorthand": "off",
|
|
160
160
|
|
|
161
161
|
// Enforce including a hint with external snapshots
|
|
162
162
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
|
|
163
|
-
|
|
163
|
+
"@vitest/prefer-snapshot-hint": "off",
|
|
164
164
|
|
|
165
165
|
// Enforce using `vi.spyOn`
|
|
166
166
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md
|
|
167
|
-
|
|
167
|
+
"@vitest/prefer-spy-on": "off",
|
|
168
168
|
|
|
169
169
|
// Enforce strict equal over equal
|
|
170
170
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-equal.md
|
|
171
|
-
|
|
171
|
+
"@vitest/prefer-strict-equal": "error",
|
|
172
172
|
|
|
173
173
|
// Enforce using `toBe()`
|
|
174
174
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be.md
|
|
175
|
-
|
|
175
|
+
"@vitest/prefer-to-be": "off",
|
|
176
176
|
|
|
177
177
|
// Enforce using `toBeFalsy()`
|
|
178
178
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-falsy.md
|
|
179
|
-
|
|
179
|
+
"@vitest/prefer-to-be-falsy": "error",
|
|
180
180
|
|
|
181
181
|
// Enforce using `toBeObject()`
|
|
182
182
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-object.md
|
|
183
|
-
|
|
183
|
+
"@vitest/prefer-to-be-object": "error",
|
|
184
184
|
|
|
185
185
|
// Enforce using `toBeTruthy`
|
|
186
186
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-truthy.md
|
|
187
|
-
|
|
187
|
+
"@vitest/prefer-to-be-truthy": "error",
|
|
188
188
|
|
|
189
189
|
// Enforce using `toContain()`
|
|
190
190
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
|
|
191
|
-
|
|
191
|
+
"@vitest/prefer-to-contain": "error",
|
|
192
192
|
|
|
193
193
|
// Enforce using `toHaveLength()`
|
|
194
194
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
|
|
195
|
-
|
|
195
|
+
"@vitest/prefer-to-have-length": "error",
|
|
196
196
|
|
|
197
197
|
// Enforce using `test.todo`
|
|
198
198
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-todo.md
|
|
199
|
-
|
|
199
|
+
"@vitest/prefer-todo": "off",
|
|
200
200
|
|
|
201
201
|
// Require setup and teardown to be within a hook
|
|
202
202
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
203
|
-
|
|
203
|
+
"@vitest/require-hook": "off",
|
|
204
204
|
|
|
205
205
|
// Require local Test Context for concurrent snapshot tests
|
|
206
206
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
|
|
207
|
-
|
|
207
|
+
"@vitest/require-local-test-context-for-concurrent-snapshots": "off",
|
|
208
208
|
|
|
209
209
|
// Require `toThrow()` to be called with an error message
|
|
210
210
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-to-throw-message.md
|
|
211
|
-
|
|
211
|
+
"@vitest/require-to-throw-message": "off",
|
|
212
212
|
|
|
213
213
|
// Enforce that all tests are in a top-level `describe`
|
|
214
214
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-top-level-describe.md
|
|
215
|
-
|
|
215
|
+
"@vitest/require-top-level-describe": "off",
|
|
216
216
|
|
|
217
217
|
// Enforce unbound methods are called with their expected scope
|
|
218
218
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/unbound-method.md
|
|
219
|
-
|
|
219
|
+
"@vitest/unbound-method": "off",
|
|
220
220
|
|
|
221
221
|
// Enforce valid `describe` callback
|
|
222
222
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-describe-callback.md
|
|
223
|
-
|
|
223
|
+
"@vitest/valid-describe-callback": "error",
|
|
224
224
|
|
|
225
225
|
// Enforce valid `expect()` usage
|
|
226
226
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect.md
|
|
227
|
-
|
|
227
|
+
"@vitest/valid-expect": "error",
|
|
228
228
|
|
|
229
229
|
// Enforce valid titles
|
|
230
230
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md
|
|
231
|
-
|
|
231
|
+
"@vitest/valid-title": "warn",
|
|
232
232
|
},
|
|
233
233
|
};
|