@vitest/eslint-plugin 1.3.23 → 1.3.24

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ## eslint-plugin-vitest
2
2
 
3
3
  ![npm](https://img.shields.io/npm/v/@vitest/eslint-plugin)
4
- [![ci](https://github.com/vitest-dev/eslint-plugin-vitest/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/veritem/eslint-plugin-vitest/actions/workflows/ci.yml)
4
+ [![ci](https://github.com/vitest-dev/eslint-plugin-vitest/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/veritem/eslint-plugin-vitest/actions/workflows/ci.yaml)
5
5
 
6
6
  ESLint plugin for Vitest
7
7
 
@@ -73,7 +73,7 @@ If you're using old ESLint configuration, make sure to use legacy key like the f
73
73
  }
74
74
  ```
75
75
 
76
- #### Enabling with type-testing
76
+ #### Enabling with Type-Testing
77
77
 
78
78
  Vitest ships with an optional [type-testing feature](https://vitest.dev/guide/testing-types), which is disabled by default.
79
79
 
@@ -130,7 +130,7 @@ export default [
130
130
  ]
131
131
  ```
132
132
 
133
- ### Shareable configurations
133
+ ### Shareable Configurations
134
134
 
135
135
  #### Recommended
136
136
 
@@ -178,83 +178,83 @@ export default [
178
178
  💭 Requires [type information](https://typescript-eslint.io/linting/typed-linting).\
179
179
  ❌ Deprecated.
180
180
 
181
- | Name | Description | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | 💭 | ❌ |
182
- |:-------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------| :-- | :-- | :-- | :-- | :-- | :-- | :-- |
183
- | [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | 🌐 | | | | | |
184
- | [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌐 | | 🔧 | | | |
185
- | [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌐 | | 🔧 | | | |
186
- | [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | ✅ | 🌐 | | | | | |
181
+ | Name | Description | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | 💭 | ❌ |
182
+ | :----------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | :-- | :-- |
183
+ | [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | 🌐 | | | | | |
184
+ | [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌐 | | 🔧 | | | |
185
+ | [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌐 | | 🔧 | | | |
186
+ | [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | ✅ | 🌐 | | | | | |
187
187
  | [hoisted-apis-on-top](docs/rules/hoisted-apis-on-top.md) | enforce hoisted APIs to be on top of the file | | 🌐 | | | 💡 | | |
188
- | [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | 🌐 | | | | | |
189
- | [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | 🌐 | | | | | |
190
- | [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | 🌐 | | 🔧 | | | |
191
- | [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | ✅ | 🌐 | | | | | |
192
- | [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | 🌐 | | | | | |
193
- | [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | 🌐 | | | | | |
194
- | [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | 🌐 | | | | | |
195
- | [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | 🌐 | | | | | |
196
- | [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | 🌐 | | | 💡 | | ❌ |
197
- | [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | 🌐 | | | | | |
198
- | [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | 🌐 | | 🔧 | | | |
199
- | [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | 🌐 | | | | | |
200
- | [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | ✅ | 🌐 | | 🔧 | | | |
201
- | [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | ✅ | 🌐 | | 🔧 | | | |
202
- | [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | 🌐 | 🔧 | | | |
203
- | [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | 🌐 | | 🔧 | | | |
204
- | [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | 🌐 | | | | | |
205
- | [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from **mocks** directory | | 🌐 | | | | | |
206
- | [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | 🌐 | | | | | |
207
- | [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | 🌐 | | | | | |
208
- | [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌐 | | | | | |
209
- | [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | 🌐 | | 🔧 | | | |
210
- | [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌐 | | | | | |
211
- | [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | 🌐 | | 🔧 | | | |
212
- | [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | 🌐 | | 🔧 | | | |
213
- | [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | 🌐 | | 🔧 | | | |
214
- | [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | 🌐 | | 🔧 | | | |
215
- | [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | 🌐 | | 🔧 | | | |
216
- | [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | 🌐 | | 🔧 | | | |
217
- | [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | 🌐 | | 🔧 | | | |
218
- | [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | 🌐 | | 🔧 | | | |
188
+ | [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | 🌐 | | | | | |
189
+ | [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | 🌐 | | | | | |
190
+ | [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | 🌐 | | 🔧 | | | |
191
+ | [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | ✅ | 🌐 | | | | | |
192
+ | [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | 🌐 | | | | | |
193
+ | [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | 🌐 | | | | | |
194
+ | [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | 🌐 | | | | | |
195
+ | [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | 🌐 | | | | | |
196
+ | [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | 🌐 | | | 💡 | | ❌ |
197
+ | [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | 🌐 | | | | | |
198
+ | [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | 🌐 | | 🔧 | | | |
199
+ | [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | 🌐 | | | | | |
200
+ | [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | ✅ | 🌐 | | 🔧 | | | |
201
+ | [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | ✅ | 🌐 | | 🔧 | | | |
202
+ | [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | 🌐 | 🔧 | | | |
203
+ | [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | 🌐 | | 🔧 | | | |
204
+ | [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | 🌐 | | | | | |
205
+ | [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from **mocks** directory | | 🌐 | | | | | |
206
+ | [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | 🌐 | | | | | |
207
+ | [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | 🌐 | | | | | |
208
+ | [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌐 | | | | | |
209
+ | [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | 🌐 | | 🔧 | | | |
210
+ | [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌐 | | | | | |
211
+ | [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | 🌐 | | 🔧 | | | |
212
+ | [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | 🌐 | | 🔧 | | | |
213
+ | [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | 🌐 | | 🔧 | | | |
214
+ | [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | 🌐 | | 🔧 | | | |
215
+ | [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | 🌐 | | 🔧 | | | |
216
+ | [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | 🌐 | | 🔧 | | | |
217
+ | [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | 🌐 | | 🔧 | | | |
218
+ | [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | 🌐 | | 🔧 | | | |
219
219
  | [prefer-called-exactly-once-with](docs/rules/prefer-called-exactly-once-with.md) | Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith` | ✅ | 🌐 | | 🔧 | | | |
220
- | [prefer-called-once](docs/rules/prefer-called-once.md) | enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()` | | | 🌐 | 🔧 | | | |
221
- | [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | 🌐 | | 🔧 | | | |
222
- | [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌐 | | 🔧 | | | |
223
- | [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌐 | | 🔧 | | | |
224
- | [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | 🌐 | | 🔧 | | | |
225
- | [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌐 | | | | | |
226
- | [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | 🌐 | | | 💡 | | |
227
- | [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | 🌐 | | | 💡 | | |
228
- | [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | 🌐 | | 🔧 | | | |
229
- | [prefer-expect-type-of](docs/rules/prefer-expect-type-of.md) | enforce using `expectTypeOf` instead of `expect(typeof ...)` | |🌐 | | 🔧 | | | |
230
- | [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌐 | | | | | |
231
- | [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌐 | | | | | |
232
- | [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌐 | | 🔧 | | | |
233
- | [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌐 | | 🔧 | | | |
234
- | [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌐 | | 🔧 | | | |
235
- | [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | 🌐 | | | | | |
236
- | [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | 🌐 | | 🔧 | | | |
237
- | [prefer-strict-boolean-matchers](docs/rules/prefer-strict-boolean-matchers.md) | enforce using `toBe(true)` and `toBe(false)` over matchers that coerce types to boolean | | 🌐 | | 🔧 | | | |
238
- | [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | 🌐 | | | 💡 | | |
239
- | [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | 🌐 | | 🔧 | | | |
240
- | [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | 🌐 | 🔧 | | | |
241
- | [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | 🌐 | | 🔧 | | | |
242
- | [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | 🌐 | 🔧 | | | |
243
- | [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | 🌐 | | 🔧 | | | |
244
- | [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | 🌐 | | 🔧 | | | |
245
- | [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | 🌐 | | 🔧 | | | |
246
- | [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | 🌐 | | 🔧 | | 💭 | |
247
- | [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | 🌐 | | | | | |
248
- | [require-local-test-context-for-concurrent-snapshots](docs/rules/require-local-test-context-for-concurrent-snapshots.md) | require local Test Context for concurrent snapshot tests | ✅ | 🌐 | | | | | |
249
- | [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | 🌐 | | 🔧 | | | |
250
- | [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | 🌐 | | | | | |
251
- | [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | 🌐 | | | | | |
252
- | [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | ✅ | 🌐 | | | | | |
253
- | [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | ✅ | 🌐 | | 🔧 | | | |
254
- | [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | 🌐 | | | | | |
255
- | [valid-title](docs/rules/valid-title.md) | enforce valid titles | ✅ | 🌐 | | 🔧 | | | |
256
- | [warn-todo](docs/rules/warn-todo.md) | disallow `.todo` usage | | | | | | | |
257
- | [prefer-import-in-moc](docs/rules/prefer-import-in-moc.md) | enforce dynamic import in mock | ✅ | 🌐 | | 🔧 | | | |
220
+ | [prefer-called-once](docs/rules/prefer-called-once.md) | enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()` | | | 🌐 | 🔧 | | | |
221
+ | [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | 🌐 | | 🔧 | | | |
222
+ | [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌐 | | 🔧 | | | |
223
+ | [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌐 | | 🔧 | | | |
224
+ | [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | 🌐 | | 🔧 | | | |
225
+ | [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌐 | | | | | |
226
+ | [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | 🌐 | | | 💡 | | |
227
+ | [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | 🌐 | | | 💡 | | |
228
+ | [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | 🌐 | | 🔧 | | | |
229
+ | [prefer-expect-type-of](docs/rules/prefer-expect-type-of.md) | enforce using `expectTypeOf` instead of `expect(typeof ...)` | | 🌐 | | 🔧 | | | |
230
+ | [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌐 | | | | | |
231
+ | [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌐 | | | | | |
232
+ | [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌐 | | 🔧 | | | |
233
+ | [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌐 | | 🔧 | | | |
234
+ | [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌐 | | 🔧 | | | |
235
+ | [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | 🌐 | | | | | |
236
+ | [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | 🌐 | | 🔧 | | | |
237
+ | [prefer-strict-boolean-matchers](docs/rules/prefer-strict-boolean-matchers.md) | enforce using `toBe(true)` and `toBe(false)` over matchers that coerce types to boolean | | 🌐 | | 🔧 | | | |
238
+ | [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | 🌐 | | | 💡 | | |
239
+ | [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | 🌐 | | 🔧 | | | |
240
+ | [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | 🌐 | 🔧 | | | |
241
+ | [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | 🌐 | | 🔧 | | | |
242
+ | [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | 🌐 | 🔧 | | | |
243
+ | [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | 🌐 | | 🔧 | | | |
244
+ | [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | 🌐 | | 🔧 | | | |
245
+ | [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | 🌐 | | 🔧 | | | |
246
+ | [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | 🌐 | | 🔧 | | 💭 | |
247
+ | [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | 🌐 | | | | | |
248
+ | [require-local-test-context-for-concurrent-snapshots](docs/rules/require-local-test-context-for-concurrent-snapshots.md) | require local Test Context for concurrent snapshot tests | ✅ | 🌐 | | | | | |
249
+ | [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | 🌐 | | 🔧 | | | |
250
+ | [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | 🌐 | | | | | |
251
+ | [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | 🌐 | | | | | |
252
+ | [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | ✅ | 🌐 | | | | | |
253
+ | [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | ✅ | 🌐 | | 🔧 | | | |
254
+ | [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | 🌐 | | | | | |
255
+ | [valid-title](docs/rules/valid-title.md) | enforce valid titles | ✅ | 🌐 | | 🔧 | | | |
256
+ | [warn-todo](docs/rules/warn-todo.md) | disallow `.todo` usage | | | | | | | |
257
+ | [prefer-import-in-moc](docs/rules/prefer-import-in-moc.md) | enforce dynamic import in mock | ✅ | 🌐 | | 🔧 | | | |
258
258
 
259
259
  <!-- end auto-generated rules list -->
260
260
 
package/dist/index.cjs CHANGED
@@ -33,7 +33,7 @@ let __typescript_eslint_scope_manager = require("@typescript-eslint/scope-manage
33
33
  __typescript_eslint_scope_manager = __toESM(__typescript_eslint_scope_manager);
34
34
 
35
35
  //#region package.json
36
- var version = "1.3.23";
36
+ var version = "1.3.24";
37
37
 
38
38
  //#endregion
39
39
  //#region src/utils/index.ts
@@ -186,6 +186,7 @@ const ValidVitestFnCallChains = new Set([
186
186
  "it.skipIf",
187
187
  "it.runIf",
188
188
  "it.each",
189
+ "it.for",
189
190
  "it.skip.only",
190
191
  "it.skip.concurrent",
191
192
  "it.skip.sequential",
@@ -240,11 +241,20 @@ const ValidVitestFnCallChains = new Set([
240
241
  "it.sequential.each",
241
242
  "it.todo.each",
242
243
  "it.fails.each",
244
+ "it.skip.for",
245
+ "it.only.for",
246
+ "it.concurrent.for",
247
+ "it.sequential.for",
248
+ "it.todo.for",
249
+ "it.fails.for",
243
250
  "it.extend.skipIf",
244
251
  "it.extend.runIf",
245
252
  "it.extend.each",
253
+ "it.extend.for",
246
254
  "it.skipIf.each",
255
+ "it.skipIf.for",
247
256
  "it.runIf.each",
257
+ "it.runIf.for",
248
258
  "it.skip.only.concurrent",
249
259
  "it.skip.only.sequential",
250
260
  "it.skip.only.todo",
@@ -485,6 +495,36 @@ const ValidVitestFnCallChains = new Set([
485
495
  "it.fails.concurrent.each",
486
496
  "it.fails.sequential.each",
487
497
  "it.fails.todo.each",
498
+ "it.skip.only.for",
499
+ "it.skip.concurrent.for",
500
+ "it.skip.sequential.for",
501
+ "it.skip.todo.for",
502
+ "it.skip.fails.for",
503
+ "it.only.skip.for",
504
+ "it.only.concurrent.for",
505
+ "it.only.sequential.for",
506
+ "it.only.todo.for",
507
+ "it.only.fails.for",
508
+ "it.concurrent.skip.for",
509
+ "it.concurrent.only.for",
510
+ "it.concurrent.sequential.for",
511
+ "it.concurrent.todo.for",
512
+ "it.concurrent.fails.for",
513
+ "it.sequential.skip.for",
514
+ "it.sequential.only.for",
515
+ "it.sequential.concurrent.for",
516
+ "it.sequential.todo.for",
517
+ "it.sequential.fails.for",
518
+ "it.todo.skip.for",
519
+ "it.todo.only.for",
520
+ "it.todo.concurrent.for",
521
+ "it.todo.sequential.for",
522
+ "it.todo.fails.for",
523
+ "it.fails.skip.for",
524
+ "it.fails.only.for",
525
+ "it.fails.concurrent.for",
526
+ "it.fails.sequential.for",
527
+ "it.fails.todo.for",
488
528
  "it.extend.skipIf.skip",
489
529
  "it.extend.skipIf.only",
490
530
  "it.extend.skipIf.concurrent",
@@ -503,20 +543,40 @@ const ValidVitestFnCallChains = new Set([
503
543
  "it.extend.sequential.each",
504
544
  "it.extend.todo.each",
505
545
  "it.extend.fails.each",
546
+ "it.extend.skip.for",
547
+ "it.extend.only.for",
548
+ "it.extend.concurrent.for",
549
+ "it.extend.sequential.for",
550
+ "it.extend.todo.for",
551
+ "it.extend.fails.for",
506
552
  "it.skipIf.skip.each",
507
553
  "it.skipIf.only.each",
508
554
  "it.skipIf.concurrent.each",
509
555
  "it.skipIf.sequential.each",
510
556
  "it.skipIf.todo.each",
511
557
  "it.skipIf.fails.each",
558
+ "it.skipIf.skip.for",
559
+ "it.skipIf.only.for",
560
+ "it.skipIf.concurrent.for",
561
+ "it.skipIf.sequential.for",
562
+ "it.skipIf.todo.for",
563
+ "it.skipIf.fails.for",
512
564
  "it.runIf.skip.each",
513
565
  "it.runIf.only.each",
514
566
  "it.runIf.concurrent.each",
515
567
  "it.runIf.sequential.each",
516
568
  "it.runIf.todo.each",
517
569
  "it.runIf.fails.each",
570
+ "it.runIf.skip.for",
571
+ "it.runIf.only.for",
572
+ "it.runIf.concurrent.for",
573
+ "it.runIf.sequential.for",
574
+ "it.runIf.todo.for",
575
+ "it.runIf.fails.for",
518
576
  "it.extend.skipIf.each",
577
+ "it.extend.skipIf.for",
519
578
  "it.extend.runIf.each",
579
+ "it.extend.runIf.for",
520
580
  "test",
521
581
  "test.skip",
522
582
  "test.only",
@@ -528,6 +588,7 @@ const ValidVitestFnCallChains = new Set([
528
588
  "test.skipIf",
529
589
  "test.runIf",
530
590
  "test.each",
591
+ "test.for",
531
592
  "test.skip.only",
532
593
  "test.skip.concurrent",
533
594
  "test.skip.sequential",
@@ -582,11 +643,20 @@ const ValidVitestFnCallChains = new Set([
582
643
  "test.sequential.each",
583
644
  "test.todo.each",
584
645
  "test.fails.each",
646
+ "test.skip.for",
647
+ "test.only.for",
648
+ "test.concurrent.for",
649
+ "test.sequential.for",
650
+ "test.todo.for",
651
+ "test.fails.for",
585
652
  "test.extend.skipIf",
586
653
  "test.extend.runIf",
587
654
  "test.extend.each",
655
+ "test.extend.for",
588
656
  "test.skipIf.each",
657
+ "test.skipIf.for",
589
658
  "test.runIf.each",
659
+ "test.runIf.for",
590
660
  "test.skip.only.concurrent",
591
661
  "test.skip.only.sequential",
592
662
  "test.skip.only.todo",
@@ -827,6 +897,36 @@ const ValidVitestFnCallChains = new Set([
827
897
  "test.fails.concurrent.each",
828
898
  "test.fails.sequential.each",
829
899
  "test.fails.todo.each",
900
+ "test.skip.only.for",
901
+ "test.skip.concurrent.for",
902
+ "test.skip.sequential.for",
903
+ "test.skip.todo.for",
904
+ "test.skip.fails.for",
905
+ "test.only.skip.for",
906
+ "test.only.concurrent.for",
907
+ "test.only.sequential.for",
908
+ "test.only.todo.for",
909
+ "test.only.fails.for",
910
+ "test.concurrent.skip.for",
911
+ "test.concurrent.only.for",
912
+ "test.concurrent.sequential.for",
913
+ "test.concurrent.todo.for",
914
+ "test.concurrent.fails.for",
915
+ "test.sequential.skip.for",
916
+ "test.sequential.only.for",
917
+ "test.sequential.concurrent.for",
918
+ "test.sequential.todo.for",
919
+ "test.sequential.fails.for",
920
+ "test.todo.skip.for",
921
+ "test.todo.only.for",
922
+ "test.todo.concurrent.for",
923
+ "test.todo.sequential.for",
924
+ "test.todo.fails.for",
925
+ "test.fails.skip.for",
926
+ "test.fails.only.for",
927
+ "test.fails.concurrent.for",
928
+ "test.fails.sequential.for",
929
+ "test.fails.todo.for",
830
930
  "test.extend.skipIf.skip",
831
931
  "test.extend.skipIf.only",
832
932
  "test.extend.skipIf.concurrent",
@@ -845,20 +945,40 @@ const ValidVitestFnCallChains = new Set([
845
945
  "test.extend.sequential.each",
846
946
  "test.extend.todo.each",
847
947
  "test.extend.fails.each",
948
+ "test.extend.skip.for",
949
+ "test.extend.only.for",
950
+ "test.extend.concurrent.for",
951
+ "test.extend.sequential.for",
952
+ "test.extend.todo.for",
953
+ "test.extend.fails.for",
848
954
  "test.skipIf.skip.each",
849
955
  "test.skipIf.only.each",
850
956
  "test.skipIf.concurrent.each",
851
957
  "test.skipIf.sequential.each",
852
958
  "test.skipIf.todo.each",
853
959
  "test.skipIf.fails.each",
960
+ "test.skipIf.skip.for",
961
+ "test.skipIf.only.for",
962
+ "test.skipIf.concurrent.for",
963
+ "test.skipIf.sequential.for",
964
+ "test.skipIf.todo.for",
965
+ "test.skipIf.fails.for",
854
966
  "test.runIf.skip.each",
855
967
  "test.runIf.only.each",
856
968
  "test.runIf.concurrent.each",
857
969
  "test.runIf.sequential.each",
858
970
  "test.runIf.todo.each",
859
971
  "test.runIf.fails.each",
972
+ "test.runIf.skip.for",
973
+ "test.runIf.only.for",
974
+ "test.runIf.concurrent.for",
975
+ "test.runIf.sequential.for",
976
+ "test.runIf.todo.for",
977
+ "test.runIf.fails.for",
860
978
  "test.extend.skipIf.each",
979
+ "test.extend.skipIf.for",
861
980
  "test.extend.runIf.each",
981
+ "test.extend.runIf.for",
862
982
  "bench",
863
983
  "bench.skip",
864
984
  "bench.only",
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { isAbsolute, posix } from "node:path";
5
5
  import { DefinitionType } from "@typescript-eslint/scope-manager";
6
6
 
7
7
  //#region package.json
8
- var version = "1.3.23";
8
+ var version = "1.3.24";
9
9
 
10
10
  //#endregion
11
11
  //#region src/utils/index.ts
@@ -158,6 +158,7 @@ const ValidVitestFnCallChains = new Set([
158
158
  "it.skipIf",
159
159
  "it.runIf",
160
160
  "it.each",
161
+ "it.for",
161
162
  "it.skip.only",
162
163
  "it.skip.concurrent",
163
164
  "it.skip.sequential",
@@ -212,11 +213,20 @@ const ValidVitestFnCallChains = new Set([
212
213
  "it.sequential.each",
213
214
  "it.todo.each",
214
215
  "it.fails.each",
216
+ "it.skip.for",
217
+ "it.only.for",
218
+ "it.concurrent.for",
219
+ "it.sequential.for",
220
+ "it.todo.for",
221
+ "it.fails.for",
215
222
  "it.extend.skipIf",
216
223
  "it.extend.runIf",
217
224
  "it.extend.each",
225
+ "it.extend.for",
218
226
  "it.skipIf.each",
227
+ "it.skipIf.for",
219
228
  "it.runIf.each",
229
+ "it.runIf.for",
220
230
  "it.skip.only.concurrent",
221
231
  "it.skip.only.sequential",
222
232
  "it.skip.only.todo",
@@ -457,6 +467,36 @@ const ValidVitestFnCallChains = new Set([
457
467
  "it.fails.concurrent.each",
458
468
  "it.fails.sequential.each",
459
469
  "it.fails.todo.each",
470
+ "it.skip.only.for",
471
+ "it.skip.concurrent.for",
472
+ "it.skip.sequential.for",
473
+ "it.skip.todo.for",
474
+ "it.skip.fails.for",
475
+ "it.only.skip.for",
476
+ "it.only.concurrent.for",
477
+ "it.only.sequential.for",
478
+ "it.only.todo.for",
479
+ "it.only.fails.for",
480
+ "it.concurrent.skip.for",
481
+ "it.concurrent.only.for",
482
+ "it.concurrent.sequential.for",
483
+ "it.concurrent.todo.for",
484
+ "it.concurrent.fails.for",
485
+ "it.sequential.skip.for",
486
+ "it.sequential.only.for",
487
+ "it.sequential.concurrent.for",
488
+ "it.sequential.todo.for",
489
+ "it.sequential.fails.for",
490
+ "it.todo.skip.for",
491
+ "it.todo.only.for",
492
+ "it.todo.concurrent.for",
493
+ "it.todo.sequential.for",
494
+ "it.todo.fails.for",
495
+ "it.fails.skip.for",
496
+ "it.fails.only.for",
497
+ "it.fails.concurrent.for",
498
+ "it.fails.sequential.for",
499
+ "it.fails.todo.for",
460
500
  "it.extend.skipIf.skip",
461
501
  "it.extend.skipIf.only",
462
502
  "it.extend.skipIf.concurrent",
@@ -475,20 +515,40 @@ const ValidVitestFnCallChains = new Set([
475
515
  "it.extend.sequential.each",
476
516
  "it.extend.todo.each",
477
517
  "it.extend.fails.each",
518
+ "it.extend.skip.for",
519
+ "it.extend.only.for",
520
+ "it.extend.concurrent.for",
521
+ "it.extend.sequential.for",
522
+ "it.extend.todo.for",
523
+ "it.extend.fails.for",
478
524
  "it.skipIf.skip.each",
479
525
  "it.skipIf.only.each",
480
526
  "it.skipIf.concurrent.each",
481
527
  "it.skipIf.sequential.each",
482
528
  "it.skipIf.todo.each",
483
529
  "it.skipIf.fails.each",
530
+ "it.skipIf.skip.for",
531
+ "it.skipIf.only.for",
532
+ "it.skipIf.concurrent.for",
533
+ "it.skipIf.sequential.for",
534
+ "it.skipIf.todo.for",
535
+ "it.skipIf.fails.for",
484
536
  "it.runIf.skip.each",
485
537
  "it.runIf.only.each",
486
538
  "it.runIf.concurrent.each",
487
539
  "it.runIf.sequential.each",
488
540
  "it.runIf.todo.each",
489
541
  "it.runIf.fails.each",
542
+ "it.runIf.skip.for",
543
+ "it.runIf.only.for",
544
+ "it.runIf.concurrent.for",
545
+ "it.runIf.sequential.for",
546
+ "it.runIf.todo.for",
547
+ "it.runIf.fails.for",
490
548
  "it.extend.skipIf.each",
549
+ "it.extend.skipIf.for",
491
550
  "it.extend.runIf.each",
551
+ "it.extend.runIf.for",
492
552
  "test",
493
553
  "test.skip",
494
554
  "test.only",
@@ -500,6 +560,7 @@ const ValidVitestFnCallChains = new Set([
500
560
  "test.skipIf",
501
561
  "test.runIf",
502
562
  "test.each",
563
+ "test.for",
503
564
  "test.skip.only",
504
565
  "test.skip.concurrent",
505
566
  "test.skip.sequential",
@@ -554,11 +615,20 @@ const ValidVitestFnCallChains = new Set([
554
615
  "test.sequential.each",
555
616
  "test.todo.each",
556
617
  "test.fails.each",
618
+ "test.skip.for",
619
+ "test.only.for",
620
+ "test.concurrent.for",
621
+ "test.sequential.for",
622
+ "test.todo.for",
623
+ "test.fails.for",
557
624
  "test.extend.skipIf",
558
625
  "test.extend.runIf",
559
626
  "test.extend.each",
627
+ "test.extend.for",
560
628
  "test.skipIf.each",
629
+ "test.skipIf.for",
561
630
  "test.runIf.each",
631
+ "test.runIf.for",
562
632
  "test.skip.only.concurrent",
563
633
  "test.skip.only.sequential",
564
634
  "test.skip.only.todo",
@@ -799,6 +869,36 @@ const ValidVitestFnCallChains = new Set([
799
869
  "test.fails.concurrent.each",
800
870
  "test.fails.sequential.each",
801
871
  "test.fails.todo.each",
872
+ "test.skip.only.for",
873
+ "test.skip.concurrent.for",
874
+ "test.skip.sequential.for",
875
+ "test.skip.todo.for",
876
+ "test.skip.fails.for",
877
+ "test.only.skip.for",
878
+ "test.only.concurrent.for",
879
+ "test.only.sequential.for",
880
+ "test.only.todo.for",
881
+ "test.only.fails.for",
882
+ "test.concurrent.skip.for",
883
+ "test.concurrent.only.for",
884
+ "test.concurrent.sequential.for",
885
+ "test.concurrent.todo.for",
886
+ "test.concurrent.fails.for",
887
+ "test.sequential.skip.for",
888
+ "test.sequential.only.for",
889
+ "test.sequential.concurrent.for",
890
+ "test.sequential.todo.for",
891
+ "test.sequential.fails.for",
892
+ "test.todo.skip.for",
893
+ "test.todo.only.for",
894
+ "test.todo.concurrent.for",
895
+ "test.todo.sequential.for",
896
+ "test.todo.fails.for",
897
+ "test.fails.skip.for",
898
+ "test.fails.only.for",
899
+ "test.fails.concurrent.for",
900
+ "test.fails.sequential.for",
901
+ "test.fails.todo.for",
802
902
  "test.extend.skipIf.skip",
803
903
  "test.extend.skipIf.only",
804
904
  "test.extend.skipIf.concurrent",
@@ -817,20 +917,40 @@ const ValidVitestFnCallChains = new Set([
817
917
  "test.extend.sequential.each",
818
918
  "test.extend.todo.each",
819
919
  "test.extend.fails.each",
920
+ "test.extend.skip.for",
921
+ "test.extend.only.for",
922
+ "test.extend.concurrent.for",
923
+ "test.extend.sequential.for",
924
+ "test.extend.todo.for",
925
+ "test.extend.fails.for",
820
926
  "test.skipIf.skip.each",
821
927
  "test.skipIf.only.each",
822
928
  "test.skipIf.concurrent.each",
823
929
  "test.skipIf.sequential.each",
824
930
  "test.skipIf.todo.each",
825
931
  "test.skipIf.fails.each",
932
+ "test.skipIf.skip.for",
933
+ "test.skipIf.only.for",
934
+ "test.skipIf.concurrent.for",
935
+ "test.skipIf.sequential.for",
936
+ "test.skipIf.todo.for",
937
+ "test.skipIf.fails.for",
826
938
  "test.runIf.skip.each",
827
939
  "test.runIf.only.each",
828
940
  "test.runIf.concurrent.each",
829
941
  "test.runIf.sequential.each",
830
942
  "test.runIf.todo.each",
831
943
  "test.runIf.fails.each",
944
+ "test.runIf.skip.for",
945
+ "test.runIf.only.for",
946
+ "test.runIf.concurrent.for",
947
+ "test.runIf.sequential.for",
948
+ "test.runIf.todo.for",
949
+ "test.runIf.fails.for",
832
950
  "test.extend.skipIf.each",
951
+ "test.extend.skipIf.for",
833
952
  "test.extend.runIf.each",
953
+ "test.extend.runIf.for",
834
954
  "bench",
835
955
  "bench.skip",
836
956
  "bench.only",
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@vitest/eslint-plugin",
3
- "version": "1.3.23",
3
+ "version": "1.3.24",
4
4
  "license": "MIT",
5
- "description": "Eslint plugin for vitest",
5
+ "description": "ESLint plugin for Vitest",
6
6
  "repository": "vitest-dev/eslint-plugin-vitest",
7
7
  "keywords": [
8
8
  "eslint",
9
9
  "eslintplugin",
10
10
  "eslint-plugin",
11
- "vitest eslint plugin",
11
+ "eslint plugin",
12
12
  "vitest",
13
- "eslint plugin"
13
+ "vitest eslint plugin"
14
14
  ],
15
15
  "author": "Verite Mugabo <https://veritemugabo.com/>",
16
16
  "type": "module",
@@ -32,12 +32,15 @@
32
32
  "@typescript-eslint/utils": "^8.46.1"
33
33
  },
34
34
  "devDependencies": {
35
+ "@eslint/js": "^9.38.0",
35
36
  "@types/eslint": "^9.6.1",
36
37
  "@types/node": "^22.18.10",
38
+ "@typescript-eslint/parser": "^8.46.1",
37
39
  "@typescript-eslint/rule-tester": "^8.46.1",
38
40
  "bumpp": "^10.3.1",
39
41
  "concurrently": "^9.2.1",
40
42
  "eslint": "^9.37.0",
43
+ "eslint-config-flat-gitignore": "^2.1.0",
41
44
  "eslint-config-prettier": "^10.1.8",
42
45
  "eslint-doc-generator": "^2.3.0",
43
46
  "eslint-plugin-eslint-plugin": "^7.0.0",
@@ -52,8 +55,8 @@
52
55
  "vitest": "^3.2.4"
53
56
  },
54
57
  "peerDependencies": {
55
- "eslint": ">= 8.57.0",
56
- "typescript": ">= 5.0.0",
58
+ "eslint": ">=8.57.0",
59
+ "typescript": ">=5.0.0",
57
60
  "vitest": "*"
58
61
  },
59
62
  "peerDependenciesMeta": {
@@ -75,15 +78,13 @@
75
78
  "scripts": {
76
79
  "build": "tsdown --format esm --format cjs",
77
80
  "typecheck": "tsc --noEmit",
78
- "lint:eslint-docs": "pnpm build && eslint-doc-generator --check",
79
- "lint:js": "eslint .",
80
81
  "lint": "concurrently --prefixColors auto \"pnpm:lint:*\"",
81
- "release": "bumpp package.json --commit --push --tag && pnpm build && pnpm publish",
82
- "stub": "unbuild --stub",
83
- "test:ci": "npm run format:check && vitest run",
84
- "format:check": "npx prettier 'src/**/*.ts' --check",
85
- "format:fix": "npx prettier '**/*.{ts,js}' --write",
82
+ "lint:eslint-docs": "pnpm build && eslint-doc-generator --check",
83
+ "lint:js": "eslint",
84
+ "release": "bumpp && pnpm build && pnpm publish",
85
+ "format": "prettier 'src/**/*.{ts,js}' --check",
86
86
  "test": "vitest",
87
+ "update:chains": "node scripts/chain-permutations.ts",
87
88
  "update:eslint-docs": "pnpm build && eslint-doc-generator"
88
89
  }
89
90
  }