@wistia/oxlint-config 0.6.1 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/oxlint-config",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Wistia's Oxlint configurations",
5
5
  "packageManager": "yarn@4.14.1",
6
6
  "type": "module",
@@ -54,7 +54,7 @@
54
54
  "oxlint-tsgolint": ">= 1.0.0"
55
55
  },
56
56
  "dependencies": {
57
- "@eslint-react/eslint-plugin": "^4.2.3",
57
+ "@eslint-react/eslint-plugin": "^5.7.2",
58
58
  "@vitest/eslint-plugin": "^1.6.16",
59
59
  "confusing-browser-globals": "^1.0.11",
60
60
  "eslint-plugin-barrel-files": "^3.0.1",
package/rules/import.mjs CHANGED
@@ -170,5 +170,190 @@ export const importRules = {
170
170
  // Use this rule to prevent importing packages through relative paths
171
171
  // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-relative-packages.md
172
172
  'import-x-js/no-relative-packages': 'error',
173
+
174
+ // Ensure named imports coupled with named exports
175
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/named.md
176
+ // decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
177
+ 'import-x-js/named': 'off',
178
+
179
+ // Ensure default import coupled with default export
180
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/default.md
181
+ // decision: handled by native import/default
182
+ 'import-x-js/default': 'off',
183
+
184
+ // Ensure imported namespaces contain dereferenced properties as they are dereferenced
185
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/namespace.md
186
+ // decision: handled by native import/namespace
187
+ 'import-x-js/namespace': 'off',
188
+
189
+ // Disallow namespace (a.k.a. "wildcard" *) imports
190
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-namespace.md
191
+ // decision: too restrictive for general use
192
+ 'import-x-js/no-namespace': 'off',
193
+
194
+ // Forbid mutable exports
195
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-mutable-exports.md
196
+ // decision: handled by native import/no-mutable-exports
197
+ 'import-x-js/no-mutable-exports': 'off',
198
+
199
+ // Restrict which files can be imported in a given folder
200
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-restricted-paths.md
201
+ // decision: project-specific, not configured by default
202
+ 'import-x-js/no-restricted-paths': 'off',
203
+
204
+ // Prevent importing the submodules of other modules
205
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-internal-modules.md
206
+ // decision: project-specific, not configured by default
207
+ 'import-x-js/no-internal-modules': 'off',
208
+
209
+ // Prefer named exports to be grouped together in a single export declaration
210
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/group-exports.md
211
+ // decision: too restrictive for general use
212
+ 'import-x-js/group-exports': 'off',
213
+
214
+ // Forbid importing modules from parent directories
215
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-relative-parent-imports.md
216
+ // decision: too restrictive for general use
217
+ 'import-x-js/no-relative-parent-imports': 'off',
218
+
219
+ // Enforce consistent type import style
220
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/consistent-type-specifier-style.md
221
+ // decision: handled by TypeScript config
222
+ 'import-x-js/consistent-type-specifier-style': 'off',
223
+
224
+ // Forbid a module from importing itself
225
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-self-import.md
226
+ // decision: handled by native import/no-self-import
227
+ 'import-x-js/no-self-import': 'off',
228
+
229
+ // Forbid cyclical dependencies between modules
230
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-cycle.md
231
+ // decision: handled by native import/no-cycle
232
+ 'import-x-js/no-cycle': 'off',
233
+
234
+ // Prevent importing the default as if it were named
235
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-default.md
236
+ // decision: handled by native import/no-named-default
237
+ 'import-x-js/no-named-default': 'off',
238
+
239
+ // Do not allow a default import name to match a named export
240
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default.md
241
+ // decision: handled by native import/no-named-as-default
242
+ 'import-x-js/no-named-as-default': 'off',
243
+
244
+ // Warn on accessing default export property names that are also named exports
245
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default-member.md
246
+ // decision: handled by native import/no-named-as-default-member
247
+ 'import-x-js/no-named-as-default-member': 'off',
248
+
249
+ // Reports if a module's default export is unnamed
250
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-anonymous-default-export.md
251
+ // decision: handled by native import/no-anonymous-default-export
252
+ 'import-x-js/no-anonymous-default-export': 'off',
253
+
254
+ // Reports modules without any exports, or with unused exports
255
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unused-modules.md
256
+ // decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
257
+ 'import-x-js/no-unused-modules': 'off',
258
+
259
+ // Disallow require()
260
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-commonjs.md
261
+ // decision: handled by native import/no-commonjs
262
+ 'import-x-js/no-commonjs': 'off',
263
+
264
+ // Disallow AMD require/define
265
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-amd.md
266
+ // decision: handled by native import/no-amd
267
+ 'import-x-js/no-amd': 'off',
268
+
269
+ // Disallow duplicate imports
270
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-duplicates.md
271
+ // decision: handled by native import/no-duplicates
272
+ 'import-x-js/no-duplicates': 'off',
273
+
274
+ // Disallow non-import statements appearing before import statements
275
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/first.md
276
+ // decision: handled by native import/first
277
+ 'import-x-js/first': 'off',
278
+
279
+ // Enforce a maximum number of dependencies per module
280
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/max-dependencies.md
281
+ // decision: too restrictive for general use
282
+ 'import-x-js/max-dependencies': 'off',
283
+
284
+ // Forbid import of modules using absolute paths
285
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-absolute-path.md
286
+ // decision: handled by native import/no-absolute-path
287
+ 'import-x-js/no-absolute-path': 'off',
288
+
289
+ // Disallow Node.js builtin modules
290
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-nodejs-modules.md
291
+ // decision: too restrictive for general use
292
+ 'import-x-js/no-nodejs-modules': 'off',
293
+
294
+ // Forbid Webpack loader syntax in imports
295
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-webpack-loader-syntax.md
296
+ // decision: handled by native import/no-webpack-loader-syntax
297
+ 'import-x-js/no-webpack-loader-syntax': 'off',
298
+
299
+ // Require modules with a single export to use a default export
300
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-default-export.md
301
+ // decision: handled by native import/prefer-default-export
302
+ 'import-x-js/prefer-default-export': 'off',
303
+
304
+ // Prefer namespace (wildcard *) imports
305
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-namespace-import.md
306
+ // decision: too restrictive for general use
307
+ 'import-x-js/prefer-namespace-import': 'off',
308
+
309
+ // Forbid default exports
310
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-default-export.md
311
+ // decision: handled by native import/no-default-export
312
+ 'import-x-js/no-default-export': 'off',
313
+
314
+ // Forbid named exports
315
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-export.md
316
+ // decision: conflicts with no-default-export which is enabled
317
+ 'import-x-js/no-named-export': 'off',
318
+
319
+ // Forbid require() calls with expressions
320
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-dynamic-require.md
321
+ // decision: handled by native import/no-dynamic-require
322
+ 'import-x-js/no-dynamic-require': 'off',
323
+
324
+ // Report potentially ambiguous parse goal
325
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/unambiguous.md
326
+ // decision: not useful with ESM
327
+ 'import-x-js/unambiguous': 'off',
328
+
329
+ // Forbid unassigned imports (side-effect imports)
330
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unassigned-import.md
331
+ // decision: too restrictive — CSS imports, polyfills, etc. are valid
332
+ 'import-x-js/no-unassigned-import': 'off',
333
+
334
+ // Enforce a leading comment with the webpackChunkName for dynamic imports
335
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/dynamic-import-chunkname.md
336
+ // decision: webpack-specific, not applicable
337
+ 'import-x-js/dynamic-import-chunkname': 'off',
338
+
339
+ // Forbid empty named import blocks
340
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-empty-named-blocks.md
341
+ // decision: handled by native import/no-empty-named-blocks
342
+ 'import-x-js/no-empty-named-blocks': 'off',
343
+
344
+ // Require exports to be placed at the end of the file
345
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/exports-last.md
346
+ // decision: too restrictive for general use
347
+ 'import-x-js/exports-last': 'off',
348
+
349
+ // Report imported names marked as @deprecated
350
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-deprecated.md
351
+ // decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
352
+ 'import-x-js/no-deprecated': 'off',
353
+
354
+ // Disallow non-import statements appearing before import statements (alias)
355
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/imports-first.md
356
+ // decision: deprecated alias for first, handled by native import/first
357
+ 'import-x-js/imports-first': 'off',
173
358
  },
174
359
  };
package/rules/node.mjs CHANGED
@@ -125,5 +125,87 @@ export const nodeRules = {
125
125
  // Enforce using the node: protocol when importing Node.js builtins
126
126
  // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-node-protocol.md
127
127
  'n/prefer-node-protocol': 'error',
128
+
129
+ // Require error handling in callbacks
130
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/handle-callback-err.md
131
+ // decision: handled by native node/handle-callback-err
132
+ 'n/handle-callback-err': 'off',
133
+
134
+ // Disallow the assignment to exports
135
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-exports-assign.md
136
+ // decision: handled by native node/no-exports-assign
137
+ 'n/no-exports-assign': 'off',
138
+
139
+ // Disallow new operators with calls to require
140
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-new-require.md
141
+ // decision: handled by native node/no-new-require
142
+ 'n/no-new-require': 'off',
143
+
144
+ // Disallow string concatenation with __dirname and __filename
145
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-path-concat.md
146
+ // decision: handled by native node/no-path-concat
147
+ 'n/no-path-concat': 'off',
148
+
149
+ // Enforce file extensions in import declarations
150
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/file-extension-in-import.md
151
+ // decision: handled by native import/extensions and import-x-js config
152
+ 'n/file-extension-in-import': 'off',
153
+
154
+ // Disallow string callbacks in setTimeout/setInterval
155
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-callback-literal.md
156
+ 'n/no-callback-literal': 'error',
157
+
158
+ // Disallow import declarations which import extraneous modules
159
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-extraneous-import.md
160
+ // decision: handled by import-x-js/no-extraneous-dependencies
161
+ 'n/no-extraneous-import': 'off',
162
+
163
+ // Disallow require() expressions which import extraneous modules
164
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-extraneous-require.md
165
+ // decision: handled by import-x-js/no-extraneous-dependencies
166
+ 'n/no-extraneous-require': 'off',
167
+
168
+ // Disallow import declarations which import non-existent modules
169
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-missing-import.md
170
+ // decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
171
+ 'n/no-missing-import': 'off',
172
+
173
+ // Disallow require() expressions which import non-existent modules
174
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-missing-require.md
175
+ // decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
176
+ 'n/no-missing-require': 'off',
177
+
178
+ // Disallow the use of process.env
179
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-process-env.md
180
+ // decision: too restrictive for general use
181
+ 'n/no-process-env': 'off',
182
+
183
+ // Disallow the use of process.exit()
184
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-process-exit.md
185
+ // decision: too restrictive for general use
186
+ 'n/no-process-exit': 'off',
187
+
188
+ // Disallow synchronous methods
189
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-sync.md
190
+ // decision: too restrictive for general use
191
+ 'n/no-sync': 'off',
192
+
193
+ // Enforce the use of the global crypto
194
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/crypto.md
195
+ 'n/prefer-global/crypto': 'error',
196
+
197
+ // Enforce the use of the global timers
198
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/timers.md
199
+ 'n/prefer-global/timers': 'error',
200
+
201
+ // Disallow hiding core modules
202
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-hide-core-modules.md
203
+ // decision: deprecated rule
204
+ 'n/no-hide-core-modules': 'off',
205
+
206
+ // Require correct usage of hashbang (alias)
207
+ // https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/shebang.md
208
+ // decision: handled by n/hashbang (shebang is a deprecated alias)
209
+ 'n/shebang': 'off',
128
210
  },
129
211
  };
package/rules/react.mjs CHANGED
@@ -236,14 +236,14 @@ export const reactRules = {
236
236
 
237
237
  //rules via jsPlugins (@eslint-react/eslint-plugin)
238
238
 
239
- // Validates higher order functions defining nested components or hooks
240
- // https://eslint-react.xyz/docs/rules/component-hook-factories
241
- '@eslint-react/component-hook-factories': 'error',
242
-
243
239
  // Validates usage of Error Boundaries instead of try/catch for child errors
244
240
  // https://eslint-react.xyz/docs/rules/error-boundaries
245
241
  '@eslint-react/error-boundaries': 'error',
246
242
 
243
+ // Restricts usage of global variables in React components
244
+ // https://eslint-react.xyz/docs/rules/globals
245
+ '@eslint-react/globals': 'error',
246
+
247
247
  // Verify the list of the dependencies for Hooks like useEffect and similar
248
248
  // https://eslint-react.xyz/docs/rules/exhaustive-deps
249
249
  // redundant: covered by native react/exhaustive-deps
@@ -404,11 +404,6 @@ export const reactRules = {
404
404
  // https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
405
405
  '@eslint-react/no-nested-lazy-component-declarations': 'error',
406
406
 
407
- // Prevent usage of shouldComponentUpdate when extending React.PureComponent
408
- // https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
409
- // redundant: covered by native react/no-redundant-should-component-update
410
- '@eslint-react/no-redundant-should-component-update': 'off',
411
-
412
407
  // Prevent usage of setState in componentDidMount
413
408
  // https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
414
409
  // redundant: covered by native react/no-did-mount-set-state
@@ -423,14 +418,6 @@ export const reactRules = {
423
418
  // redundant: covered by native react/no-will-update-set-state
424
419
  '@eslint-react/no-set-state-in-component-will-update': 'off',
425
420
 
426
- // Disallow unnecessary useCallback hooks
427
- // https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
428
- '@eslint-react/no-unnecessary-use-callback': 'error',
429
-
430
- // Disallow unnecessary useMemo hooks
431
- // https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
432
- '@eslint-react/no-unnecessary-use-memo': 'error',
433
-
434
421
  // Disallow unnecessary "use" prefix on custom hooks
435
422
  // https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
436
423
  '@eslint-react/no-unnecessary-use-prefix': 'error',
@@ -473,15 +460,6 @@ export const reactRules = {
473
460
  // https://eslint-react.xyz/docs/rules/no-use-context
474
461
  '@eslint-react/no-use-context': 'error',
475
462
 
476
- // Enforce consistent usage of destructuring assignment of props, state, and context
477
- // decision: best left up to the implementer
478
- // https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment
479
- '@eslint-react/prefer-destructuring-assignment': 'off',
480
-
481
- // Enforce importing React via a namespace import
482
- // https://eslint-react.xyz/docs/rules/prefer-namespace-import
483
- '@eslint-react/prefer-namespace-import': 'off',
484
-
485
463
  // Validates that components/hooks are pure
486
464
  // https://eslint-react.xyz/docs/rules/purity
487
465
  '@eslint-react/purity': 'error',
@@ -503,6 +481,10 @@ export const reactRules = {
503
481
  // https://eslint-react.xyz/docs/rules/set-state-in-render
504
482
  '@eslint-react/set-state-in-render': 'error',
505
483
 
484
+ // Enforces static component definitions
485
+ // https://eslint-react.xyz/docs/rules/static-components
486
+ '@eslint-react/static-components': 'error',
487
+
506
488
  // Validates against syntax that React does not support
507
489
  // https://eslint-react.xyz/docs/rules/unsupported-syntax
508
490
  '@eslint-react/unsupported-syntax': 'error',
@@ -592,10 +574,6 @@ export const reactRules = {
592
574
  // redundant: covered by native react/void-dom-elements-no-children
593
575
  '@eslint-react/dom-no-void-elements-with-children': 'off',
594
576
 
595
- // Enforce importing React DOM via a namespace import
596
- // https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
597
- '@eslint-react/dom-prefer-namespace-import': 'off',
598
-
599
577
  // --- RSC rules ---
600
578
 
601
579
  // Enforce correct function definition for React Server Components
@@ -633,5 +611,9 @@ export const reactRules = {
633
611
  // Prevent leaked setTimeout calls
634
612
  // https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
635
613
  '@eslint-react/web-api-no-leaked-timeout': 'error',
614
+
615
+ // Prevent leaked fetch calls in effects
616
+ // https://eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
617
+ '@eslint-react/web-api-no-leaked-fetch': 'error',
636
618
  },
637
619
  };
package/rules/vitest.mjs CHANGED
@@ -94,6 +94,22 @@ export const vitestRules = {
94
94
  // https://oxc.rs/docs/guide/usage/linter/rules/vitest/warn-todo.html
95
95
  'vitest/warn-todo': 'error',
96
96
 
97
+ // Disallow the use of certain vi methods
98
+ // https://oxc.rs/docs/guide/usage/linter/rules/vitest/no-restricted-vi-methods.html
99
+ 'vitest/no-restricted-vi-methods': 'error',
100
+
101
+ // Prefer toHaveBeenCalledExactlyOnceWith over manual assertions
102
+ // https://oxc.rs/docs/guide/usage/linter/rules/vitest/prefer-called-exactly-once-with.html
103
+ 'vitest/prefer-called-exactly-once-with': 'error',
104
+
105
+ // Prefer importing vitest globals
106
+ // https://oxc.rs/docs/guide/usage/linter/rules/vitest/prefer-importing-vitest-globals.html
107
+ 'vitest/prefer-importing-vitest-globals': 'error',
108
+
109
+ // Prefer snapshot hint for inline/external snapshots
110
+ // https://oxc.rs/docs/guide/usage/linter/rules/vitest/prefer-snapshot-hint.html
111
+ 'vitest/prefer-snapshot-hint': 'error',
112
+
97
113
  //oxlint uses the "jest/" prefix for these unfortunately
98
114
 
99
115
  // Prefer test or it but not both
@@ -288,19 +304,23 @@ export const vitestRules = {
288
304
 
289
305
  // Disallow the use of certain vi methods
290
306
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-vi-methods.md
291
- 'vitest-js/no-restricted-vi-methods': 'error',
307
+ // decision: handled by native vitest/no-restricted-vi-methods
308
+ 'vitest-js/no-restricted-vi-methods': 'off',
292
309
 
293
310
  // Prefer toHaveBeenCalledExactlyOnceWith over manual assertions
294
311
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-exactly-once-with.md
295
- 'vitest-js/prefer-called-exactly-once-with': 'error',
312
+ // decision: handled by native vitest/prefer-called-exactly-once-with
313
+ 'vitest-js/prefer-called-exactly-once-with': 'off',
296
314
 
297
315
  // Prefer importing vitest globals
298
316
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-importing-vitest-globals.md
299
- 'vitest-js/prefer-importing-vitest-globals': 'error',
317
+ // decision: handled by native vitest/prefer-importing-vitest-globals
318
+ 'vitest-js/prefer-importing-vitest-globals': 'off',
300
319
 
301
320
  // Prefer snapshot hint for inline/external snapshots
302
321
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
303
- 'vitest-js/prefer-snapshot-hint': 'error',
322
+ // decision: handled by native vitest/prefer-snapshot-hint
323
+ 'vitest-js/prefer-snapshot-hint': 'off',
304
324
 
305
325
  // Enforce padding around afterAll blocks
306
326
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
@@ -325,5 +345,349 @@ export const vitestRules = {
325
345
  // Enforce padding around describe blocks
326
346
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-describe-blocks.md
327
347
  'vitest-js/padding-around-describe-blocks': 'error',
348
+
349
+ // Enforce consistent usage of each with for...of
350
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-each-for.md
351
+ // decision: handled by native vitest/consistent-each-for
352
+ 'vitest-js/consistent-each-for': 'off',
353
+
354
+ // Require .test test file pattern
355
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
356
+ // decision: handled by native vitest/consistent-test-filename
357
+ 'vitest-js/consistent-test-filename': 'off',
358
+
359
+ // Prefer test or it but not both
360
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md
361
+ // decision: handled by native jest/consistent-test-it
362
+ 'vitest-js/consistent-test-it': 'off',
363
+
364
+ // Enforce consistent usage of vi vs vitest
365
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-vitest-vi.md
366
+ // decision: handled by native vitest/consistent-vitest-vi
367
+ 'vitest-js/consistent-vitest-vi': 'off',
368
+
369
+ // Enforce having expectation in test body
370
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
371
+ // decision: handled by native jest/expect-expect
372
+ 'vitest-js/expect-expect': 'off',
373
+
374
+ // Ensure hoisted APIs (vi.mock, vi.hoisted, etc.) are at the top
375
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/hoisted-apis-on-top.md
376
+ // decision: handled by native vitest/hoisted-apis-on-top
377
+ 'vitest-js/hoisted-apis-on-top': 'off',
378
+
379
+ // Enforce a maximum number of expect per test
380
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
381
+ // decision: handled by native jest/max-expects
382
+ 'vitest-js/max-expects': 'off',
383
+
384
+ // Nested describe block should be less than set max value or default value
385
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md
386
+ // decision: handled by native jest/max-nested-describe
387
+ 'vitest-js/max-nested-describe': 'off',
388
+
389
+ // Disallow alias methods
390
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-alias-methods.md
391
+ // decision: handled by native jest/no-alias-methods
392
+ 'vitest-js/no-alias-methods': 'off',
393
+
394
+ // Disallow commented out tests
395
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-commented-out-tests.md
396
+ // decision: handled by native jest/no-commented-out-tests
397
+ 'vitest-js/no-commented-out-tests': 'off',
398
+
399
+ // Disallow conditional expects
400
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
401
+ // decision: handled by native jest/no-conditional-expect
402
+ 'vitest-js/no-conditional-expect': 'off',
403
+
404
+ // Disallow conditional tests
405
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
406
+ // decision: handled by native vitest/no-conditional-in-test
407
+ 'vitest-js/no-conditional-in-test': 'off',
408
+
409
+ // Disallow conditional tests
410
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-tests.md
411
+ // decision: handled by native vitest/no-conditional-tests
412
+ 'vitest-js/no-conditional-tests': 'off',
413
+
414
+ // Disallow disabled tests
415
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-disabled-tests.md
416
+ // decision: handled by native jest/no-disabled-tests
417
+ 'vitest-js/no-disabled-tests': 'off',
418
+
419
+ // Disallow duplicate hooks and teardown hooks
420
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-duplicate-hooks.md
421
+ // decision: handled by native jest/no-duplicate-hooks
422
+ 'vitest-js/no-duplicate-hooks': 'off',
423
+
424
+ // Disallow focused tests
425
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-focused-tests.md
426
+ // decision: handled by native jest/no-focused-tests
427
+ 'vitest-js/no-focused-tests': 'off',
428
+
429
+ // Disallow setup and teardown hooks
430
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-hooks.md
431
+ // decision: handled by native jest/no-hooks
432
+ 'vitest-js/no-hooks': 'off',
433
+
434
+ // Disallow identical titles
435
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-identical-title.md
436
+ // decision: handled by native jest/no-identical-title
437
+ 'vitest-js/no-identical-title': 'off',
438
+
439
+ // Disallow importing node:test
440
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-import-node-test.md
441
+ // decision: handled by native vitest/no-import-node-test
442
+ 'vitest-js/no-import-node-test': 'off',
443
+
444
+ // Disallow importing vitest globals
445
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-importing-vitest-globals.md
446
+ // decision: handled by native vitest/no-importing-vitest-globals
447
+ 'vitest-js/no-importing-vitest-globals': 'off',
448
+
449
+ // Disallow string interpolation in snapshots
450
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-interpolation-in-snapshots.md
451
+ // decision: handled by native jest/no-interpolation-in-snapshots
452
+ 'vitest-js/no-interpolation-in-snapshots': 'off',
453
+
454
+ // Disallow large snapshots
455
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-large-snapshots.md
456
+ // decision: handled by native jest/no-large-snapshots
457
+ 'vitest-js/no-large-snapshots': 'off',
458
+
459
+ // Disallow importing from mocks directory
460
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-mocks-import.md
461
+ // decision: handled by native jest/no-mocks-import
462
+ 'vitest-js/no-mocks-import': 'off',
463
+
464
+ // Disallow the use of certain matchers
465
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-matchers.md
466
+ // decision: handled by native jest/no-restricted-matchers
467
+ 'vitest-js/no-restricted-matchers': 'off',
468
+
469
+ // Disallow using expect outside of it or test blocks
470
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-standalone-expect.md
471
+ // decision: handled by native jest/no-standalone-expect
472
+ 'vitest-js/no-standalone-expect': 'off',
473
+
474
+ // Disallow using test as a prefix
475
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-prefixes.md
476
+ // decision: handled by native jest/no-test-prefixes
477
+ 'vitest-js/no-test-prefixes': 'off',
478
+
479
+ // Disallow return statements in tests
480
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
481
+ // decision: handled by native jest/no-test-return-statement
482
+ 'vitest-js/no-test-return-statement': 'off',
483
+
484
+ // Disallow unnecessary async in expect functions
485
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-unneeded-async-expect-function.md
486
+ // decision: handled by native jest/no-unneeded-async-expect-function
487
+ 'vitest-js/no-unneeded-async-expect-function': 'off',
488
+
489
+ // Enforce padding around all blocks
490
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-all.md
491
+ // decision: redundant with individual padding rules configured above
492
+ 'vitest-js/padding-around-all': 'off',
493
+
494
+ // Enforce padding around test blocks
495
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
496
+ // decision: handled by native jest/padding-around-test-blocks
497
+ 'vitest-js/padding-around-test-blocks': 'off',
498
+
499
+ // Prefer toHaveBeenCalledOnce() over toHaveBeenCalledTimes(1)
500
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-once.md
501
+ // decision: handled by native vitest/prefer-called-once
502
+ 'vitest-js/prefer-called-once': 'off',
503
+
504
+ // Prefer toHaveBeenCalledTimes over multiple assertions
505
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-times.md
506
+ // decision: handled by native vitest/prefer-called-times
507
+ 'vitest-js/prefer-called-times': 'off',
508
+
509
+ // Suggest using toBeCalledWith() or toHaveBeenCalledWith()
510
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
511
+ // decision: handled by native jest/prefer-called-with
512
+ 'vitest-js/prefer-called-with': 'off',
513
+
514
+ // Suggest using the built-in comparison matchers
515
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-comparison-matcher.md
516
+ // decision: handled by native jest/prefer-comparison-matcher
517
+ 'vitest-js/prefer-comparison-matcher': 'off',
518
+
519
+ // Enforce describe titles to match function names
520
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-describe-function-title.md
521
+ // decision: handled by native vitest/prefer-describe-function-title
522
+ 'vitest-js/prefer-describe-function-title': 'off',
523
+
524
+ // Prefer each rather than manual loops
525
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
526
+ // decision: handled by native jest/prefer-each
527
+ 'vitest-js/prefer-each': 'off',
528
+
529
+ // Suggest using the built-in equality matchers
530
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
531
+ // decision: handled by native jest/prefer-equality-matcher
532
+ 'vitest-js/prefer-equality-matcher': 'off',
533
+
534
+ // Suggest using expect.assertions
535
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-assertions.md
536
+ // decision: too strict for general use
537
+ 'vitest-js/prefer-expect-assertions': 'off',
538
+
539
+ // Suggest using expect().resolves over expect(await ...) syntax
540
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-resolves.md
541
+ // decision: handled by native jest/prefer-expect-resolves
542
+ 'vitest-js/prefer-expect-resolves': 'off',
543
+
544
+ // Prefer expect.typeOf() usage
545
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-type-of.md
546
+ // decision: handled by native vitest/prefer-expect-type-of
547
+ 'vitest-js/prefer-expect-type-of': 'off',
548
+
549
+ // Prefer having hooks in consistent order
550
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
551
+ // decision: handled by native jest/prefer-hooks-in-order
552
+ 'vitest-js/prefer-hooks-in-order': 'off',
553
+
554
+ // Suggest having hooks before any test cases
555
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-on-top.md
556
+ // decision: handled by native jest/prefer-hooks-on-top
557
+ 'vitest-js/prefer-hooks-on-top': 'off',
558
+
559
+ // Prefer vi.importActual/vi.importMock in vi.mock factories
560
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-import-in-mock.md
561
+ // decision: handled by native vitest/prefer-import-in-mock
562
+ 'vitest-js/prefer-import-in-mock': 'off',
563
+
564
+ // Enforce lowercase titles
565
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
566
+ // decision: handled by native vitest/prefer-lowercase-title
567
+ 'vitest-js/prefer-lowercase-title': 'off',
568
+
569
+ // Prefer mock resolved/rejected shorthands for promises
570
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
571
+ // decision: handled by native jest/prefer-mock-promise-shorthand
572
+ 'vitest-js/prefer-mock-promise-shorthand': 'off',
573
+
574
+ // Suggest using vi.spyOn
575
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md
576
+ // decision: handled by native jest/prefer-spy-on
577
+ 'vitest-js/prefer-spy-on': 'off',
578
+
579
+ // Prefer strict boolean matchers (toBe(true) over toBeTruthy())
580
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-boolean-matchers.md
581
+ // decision: handled by native vitest/prefer-strict-boolean-matchers
582
+ 'vitest-js/prefer-strict-boolean-matchers': 'off',
583
+
584
+ // Prefer strict equal over equal
585
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-equal.md
586
+ // decision: handled by native jest/prefer-strict-equal
587
+ 'vitest-js/prefer-strict-equal': 'off',
588
+
589
+ // Suggest using toBe()
590
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be.md
591
+ // decision: handled by native jest/prefer-to-be
592
+ 'vitest-js/prefer-to-be': 'off',
593
+
594
+ // Suggest using toBeFalsy()
595
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-falsy.md
596
+ // decision: handled by native vitest/prefer-to-be-falsy
597
+ 'vitest-js/prefer-to-be-falsy': 'off',
598
+
599
+ // Prefer toBeObject()
600
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-object.md
601
+ // decision: handled by native vitest/prefer-to-be-object
602
+ 'vitest-js/prefer-to-be-object': 'off',
603
+
604
+ // Suggest using toBeTruthy
605
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-truthy.md
606
+ // decision: handled by native vitest/prefer-to-be-truthy
607
+ 'vitest-js/prefer-to-be-truthy': 'off',
608
+
609
+ // Prefer using toContain()
610
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
611
+ // decision: handled by native jest/prefer-to-contain
612
+ 'vitest-js/prefer-to-contain': 'off',
613
+
614
+ // Prefer toHaveBeenCalledTimes over multiple assertions
615
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-been-called-times.md
616
+ // decision: handled by native vitest/prefer-called-times
617
+ 'vitest-js/prefer-to-have-been-called-times': 'off',
618
+
619
+ // Suggest using toHaveLength()
620
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
621
+ // decision: handled by native jest/prefer-to-have-length
622
+ 'vitest-js/prefer-to-have-length': 'off',
623
+
624
+ // Suggest using test.todo
625
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-todo.md
626
+ // decision: handled by native jest/prefer-todo
627
+ 'vitest-js/prefer-todo': 'off',
628
+
629
+ // Prefer vi.mocked() over type casting
630
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-vi-mocked.md
631
+ 'vitest-js/prefer-vi-mocked': 'error',
632
+
633
+ // Require awaited expect.poll() calls
634
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-awaited-expect-poll.md
635
+ // decision: handled by native vitest/require-awaited-expect-poll
636
+ 'vitest-js/require-awaited-expect-poll': 'off',
637
+
638
+ // Require setup and teardown to be within a hook
639
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
640
+ // decision: handled by native jest/require-hook
641
+ 'vitest-js/require-hook': 'off',
642
+
643
+ // Require local Test Context for concurrent snapshot tests
644
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
645
+ // decision: handled by native vitest/require-local-test-context-for-concurrent-snapshots
646
+ 'vitest-js/require-local-test-context-for-concurrent-snapshots': 'off',
647
+
648
+ // Require type parameters on mock function calls
649
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-mock-type-parameters.md
650
+ // decision: handled by native vitest/require-mock-type-parameters
651
+ 'vitest-js/require-mock-type-parameters': 'off',
652
+
653
+ // Require test timeout
654
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-test-timeout.md
655
+ // decision: too strict for general use
656
+ 'vitest-js/require-test-timeout': 'off',
657
+
658
+ // Require toThrow() to be called with an error message
659
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-to-throw-message.md
660
+ // decision: handled by native jest/require-to-throw-message
661
+ 'vitest-js/require-to-throw-message': 'off',
662
+
663
+ // Enforce that all tests are in a top-level describe
664
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-top-level-describe.md
665
+ // decision: handled by native jest/require-top-level-describe
666
+ 'vitest-js/require-top-level-describe': 'off',
667
+
668
+ // Enforce unbound methods are called with their expected scope
669
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/unbound-method.md
670
+ // decision: requires type information that jsPlugins may not have access to
671
+ 'vitest-js/unbound-method': 'off',
672
+
673
+ // Enforce valid describe callback
674
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-describe-callback.md
675
+ // decision: handled by native jest/valid-describe-callback
676
+ 'vitest-js/valid-describe-callback': 'off',
677
+
678
+ // Enforce valid expect() usage
679
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect.md
680
+ // decision: handled by native jest/valid-expect
681
+ 'vitest-js/valid-expect': 'off',
682
+
683
+ // Enforce valid expect in promise
684
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect-in-promise.md
685
+ // decision: too strict for general use
686
+ 'vitest-js/valid-expect-in-promise': 'off',
687
+
688
+ // Enforce valid titles
689
+ // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md
690
+ // decision: handled by native jest/valid-title
691
+ 'vitest-js/valid-title': 'off',
328
692
  },
329
693
  };