@vitest/eslint-plugin 1.4.4 β†’ 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -185,86 +185,86 @@ export default defineConfig({
185
185
  πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).\
186
186
  ❌ Deprecated.
187
187
 
188
- | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ |
189
- | :----------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | :-- | :-- |
190
- | [consistent-each-for](docs/rules/consistent-each-for.md) | enforce using `.each` or `.for` consistently | | 🌐 | | | | | |
191
- | [consistent-test-filename](docs/rules/consistent-test-filename.md) | require test file pattern | | 🌐 | | | | | |
192
- | [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌐 | | πŸ”§ | | | |
193
- | [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌐 | | πŸ”§ | | | |
194
- | [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | βœ… | 🌐 | | | | | |
195
- | [hoisted-apis-on-top](docs/rules/hoisted-apis-on-top.md) | enforce hoisted APIs to be on top of the file | | 🌐 | | | πŸ’‘ | | |
196
- | [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | 🌐 | | | | | |
197
- | [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | 🌐 | | | | | |
198
- | [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | 🌐 | | πŸ”§ | | | |
199
- | [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | βœ… | 🌐 | | | | | |
200
- | [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | 🌐 | | | | | |
201
- | [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | 🌐 | | | | | |
202
- | [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | 🌐 | | | | | |
203
- | [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | 🌐 | | | | | |
204
- | [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | | | | πŸ’‘ | | ❌ |
205
- | [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | 🌐 | | | | | |
206
- | [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | 🌐 | | πŸ”§ | | | |
207
- | [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | 🌐 | | | | | |
208
- | [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | βœ… | 🌐 | | πŸ”§ | | | |
209
- | [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | βœ… | 🌐 | | πŸ”§ | | | |
210
- | [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | 🌐 | πŸ”§ | | | |
211
- | [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | 🌐 | | πŸ”§ | | | |
212
- | [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | 🌐 | | | | | |
213
- | [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from **mocks** directory | | 🌐 | | | | | |
214
- | [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | 🌐 | | | | | |
215
- | [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | 🌐 | | | | | |
216
- | [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌐 | | | | | |
217
- | [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | 🌐 | | πŸ”§ | | | |
218
- | [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌐 | | | | | |
219
- | [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | 🌐 | | πŸ”§ | | | |
220
- | [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | 🌐 | | πŸ”§ | | | |
221
- | [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | 🌐 | | πŸ”§ | | | |
222
- | [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | 🌐 | | πŸ”§ | | | |
223
- | [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | 🌐 | | πŸ”§ | | | |
224
- | [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | 🌐 | | πŸ”§ | | | |
225
- | [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | 🌐 | | πŸ”§ | | | |
226
- | [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | 🌐 | | πŸ”§ | | | |
227
- | [prefer-called-exactly-once-with](docs/rules/prefer-called-exactly-once-with.md) | Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith` | βœ… | 🌐 | | πŸ”§ | | | |
228
- | [prefer-called-once](docs/rules/prefer-called-once.md) | enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()` | | | 🌐 | πŸ”§ | | | |
229
- | [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | 🌐 | | πŸ”§ | | | |
230
- | [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌐 | | πŸ”§ | | | |
231
- | [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌐 | | πŸ”§ | | | |
232
- | [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | 🌐 | | πŸ”§ | | | |
233
- | [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌐 | | | | | |
234
- | [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in equality matchers | | 🌐 | | | πŸ’‘ | | |
235
- | [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | 🌐 | | | πŸ’‘ | | |
236
- | [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | 🌐 | | πŸ”§ | | | |
237
- | [prefer-expect-type-of](docs/rules/prefer-expect-type-of.md) | enforce using `expectTypeOf` instead of `expect(typeof ...)` | | 🌐 | | πŸ”§ | | | |
238
- | [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌐 | | | | | |
239
- | [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌐 | | | | | |
240
- | [prefer-import-in-mock](docs/rules/prefer-import-in-mock.md) | prefer dynamic import in mock | | 🌐 | | πŸ”§ | | | |
241
- | [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌐 | | πŸ”§ | | | |
242
- | [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌐 | | πŸ”§ | | | |
243
- | [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌐 | | πŸ”§ | | | |
244
- | [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | 🌐 | | | | | |
245
- | [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | 🌐 | | πŸ”§ | | | |
246
- | [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 | | 🌐 | | πŸ”§ | | | |
247
- | [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | 🌐 | | | πŸ’‘ | | |
248
- | [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | 🌐 | | πŸ”§ | | | |
249
- | [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | 🌐 | πŸ”§ | | | |
250
- | [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | 🌐 | | πŸ”§ | | | |
251
- | [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | 🌐 | πŸ”§ | | | |
252
- | [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | 🌐 | | πŸ”§ | | | |
253
- | [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | 🌐 | | πŸ”§ | | | |
254
- | [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | 🌐 | | πŸ”§ | | | |
255
- | [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | 🌐 | | πŸ”§ | | πŸ’­ | |
256
- | [require-awaited-expect-poll](docs/rules/require-awaited-expect-poll.md) | ensure that every `expect.poll` call is awaited | | 🌐 | | | | | |
257
- | [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | 🌐 | | | | | |
258
- | [require-import-vi-mock](docs/rules/require-import-vi-mock.md) | require usage of import in vi.mock() | | 🌐 | | πŸ”§ | | | |
259
- | [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 | βœ… | 🌐 | | | | | |
260
- | [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | 🌐 | | πŸ”§ | | | |
261
- | [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | 🌐 | | | | | |
262
- | [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | 🌐 | | | | | |
263
- | [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | βœ… | 🌐 | | | | | |
264
- | [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | βœ… | 🌐 | | πŸ”§ | | | |
265
- | [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | 🌐 | | | | | |
266
- | [valid-title](docs/rules/valid-title.md) | enforce valid titles | βœ… | 🌐 | | πŸ”§ | | | |
267
- | [warn-todo](docs/rules/warn-todo.md) | disallow `.todo` usage | | | | | | | |
188
+ | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ |
189
+ | :----------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- | :-- | :---- | :-- | :-- | :-- | :-- | :-- |
190
+ | [consistent-each-for](docs/rules/consistent-each-for.md) | enforce using `.each` or `.for` consistently | | 🌐 | | | | | |
191
+ | [consistent-test-filename](docs/rules/consistent-test-filename.md) | require test file pattern | | 🌐 | | | | | |
192
+ | [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌐 | | πŸ”§ | | | |
193
+ | [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌐 | | πŸ”§ | | | |
194
+ | [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | βœ… | 🌐 | | | | | |
195
+ | [hoisted-apis-on-top](docs/rules/hoisted-apis-on-top.md) | enforce hoisted APIs to be on top of the file | | 🌐 | | | πŸ’‘ | | |
196
+ | [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | 🌐 | | | | | |
197
+ | [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | 🌐 | | | | | |
198
+ | [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | 🌐 | | πŸ”§ | | | |
199
+ | [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | βœ… | 🌐 | | | | | |
200
+ | [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | βœ… | 🌐 | | | | | |
201
+ | [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | 🌐 | | | | | |
202
+ | [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | 🌐 | | | | | |
203
+ | [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | 🌐 βœ… | | | | | |
204
+ | [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | | | | πŸ’‘ | | ❌ |
205
+ | [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | 🌐 | | | | | |
206
+ | [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | βœ… | 🌐 | | πŸ”§ | | | |
207
+ | [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | 🌐 | | | | | |
208
+ | [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | βœ… | 🌐 | | πŸ”§ | | | |
209
+ | [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | βœ… | 🌐 | | πŸ”§ | | | |
210
+ | [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | 🌐 | πŸ”§ | | | |
211
+ | [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | βœ… | 🌐 | | πŸ”§ | | | |
212
+ | [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | 🌐 | | | | | |
213
+ | [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from **mocks** directory | βœ… | 🌐 | | | | | |
214
+ | [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | 🌐 | | | | | |
215
+ | [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | 🌐 | | | | | |
216
+ | [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | βœ… | 🌐 | | | | | |
217
+ | [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | 🌐 | | πŸ”§ | | | |
218
+ | [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌐 | | | | | |
219
+ | [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | 🌐 | | πŸ”§ | | | |
220
+ | [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | 🌐 | | πŸ”§ | | | |
221
+ | [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | 🌐 | | πŸ”§ | | | |
222
+ | [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | 🌐 | | πŸ”§ | | | |
223
+ | [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | 🌐 | | πŸ”§ | | | |
224
+ | [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | 🌐 | | πŸ”§ | | | |
225
+ | [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | 🌐 | | πŸ”§ | | | |
226
+ | [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | 🌐 | | πŸ”§ | | | |
227
+ | [prefer-called-exactly-once-with](docs/rules/prefer-called-exactly-once-with.md) | Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith` | βœ… | 🌐 | | πŸ”§ | | | |
228
+ | [prefer-called-once](docs/rules/prefer-called-once.md) | enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()` | | | 🌐 | πŸ”§ | | | |
229
+ | [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | 🌐 | | πŸ”§ | | | |
230
+ | [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌐 | | πŸ”§ | | | |
231
+ | [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌐 | | πŸ”§ | | | |
232
+ | [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | 🌐 | | πŸ”§ | | | |
233
+ | [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌐 | | | | | |
234
+ | [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in equality matchers | | 🌐 | | | πŸ’‘ | | |
235
+ | [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | 🌐 | | | πŸ’‘ | | |
236
+ | [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | 🌐 | | πŸ”§ | | | |
237
+ | [prefer-expect-type-of](docs/rules/prefer-expect-type-of.md) | enforce using `expectTypeOf` instead of `expect(typeof ...)` | | 🌐 | | πŸ”§ | | | |
238
+ | [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌐 | | | | | |
239
+ | [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌐 | | | | | |
240
+ | [prefer-import-in-mock](docs/rules/prefer-import-in-mock.md) | prefer dynamic import in mock | | 🌐 | | πŸ”§ | | | |
241
+ | [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌐 | | πŸ”§ | | | |
242
+ | [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌐 | | πŸ”§ | | | |
243
+ | [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌐 | | πŸ”§ | | | |
244
+ | [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | 🌐 | | | | | |
245
+ | [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | 🌐 | | πŸ”§ | | | |
246
+ | [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 | | 🌐 | | πŸ”§ | | | |
247
+ | [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | 🌐 | | | πŸ’‘ | | |
248
+ | [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | 🌐 | | πŸ”§ | | | |
249
+ | [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | 🌐 | πŸ”§ | | | |
250
+ | [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | 🌐 | | πŸ”§ | | | |
251
+ | [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | 🌐 | πŸ”§ | | | |
252
+ | [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | 🌐 | | πŸ”§ | | | |
253
+ | [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | 🌐 | | πŸ”§ | | | |
254
+ | [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | 🌐 | | πŸ”§ | | | |
255
+ | [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | 🌐 | | πŸ”§ | | πŸ’­ | |
256
+ | [require-awaited-expect-poll](docs/rules/require-awaited-expect-poll.md) | ensure that every `expect.poll` call is awaited | | 🌐 | | | | | |
257
+ | [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | 🌐 | | | | | |
258
+ | [require-import-vi-mock](docs/rules/require-import-vi-mock.md) | require usage of import in vi.mock() | | 🌐 | | πŸ”§ | | | |
259
+ | [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 | βœ… | 🌐 | | | | | |
260
+ | [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | 🌐 | | πŸ”§ | | | |
261
+ | [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | 🌐 | | | | | |
262
+ | [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | 🌐 | | | | | |
263
+ | [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | βœ… | 🌐 | | | | | |
264
+ | [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | βœ… | 🌐 | | πŸ”§ | | | |
265
+ | [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | βœ… | 🌐 | | | | | |
266
+ | [valid-title](docs/rules/valid-title.md) | enforce valid titles | βœ… | 🌐 | | πŸ”§ | | | |
267
+ | [warn-todo](docs/rules/warn-todo.md) | disallow `.todo` usage | | | | | | | |
268
268
 
269
269
  <!-- end auto-generated rules list -->
270
270
 
@@ -275,4 +275,4 @@ export default defineConfig({
275
275
 
276
276
  ### Licence
277
277
 
278
- [MIT](https://github.com/veritem/eslint-plugin-vitest/blob/main/LICENSE) Licence &copy; 2022 - present [veritem](https://github.com/veritem) and contributors
278
+ [MIT](https://github.com/veritem/eslint-plugin-vitest/blob/main/LICENSE) Licence &copy; 2022 - present by [veritem](https://github.com/veritem) and contributors
package/dist/index.cjs CHANGED
@@ -31,7 +31,7 @@ let __typescript_eslint_scope_manager = require("@typescript-eslint/scope-manage
31
31
  __typescript_eslint_scope_manager = __toESM(__typescript_eslint_scope_manager);
32
32
 
33
33
  //#region package.json
34
- var version = "1.4.4";
34
+ var version = "1.5.0";
35
35
 
36
36
  //#endregion
37
37
  //#region src/utils/index.ts
@@ -1969,6 +1969,7 @@ var consistent_test_it_default = createEslintRule({
1969
1969
  const testFnKeyWork = fn || TestCaseName.test;
1970
1970
  const testKeywordWithinDescribe = withinDescribe || fn || TestCaseName.it;
1971
1971
  const testFnDisabled = testFnKeyWork === testKeywordWithinDescribe ? testFnKeyWork : void 0;
1972
+ const { sourceCode } = context;
1972
1973
  let describeNestingLevel = 0;
1973
1974
  return {
1974
1975
  ImportDeclaration(node) {
@@ -1978,8 +1979,8 @@ var consistent_test_it_default = createEslintRule({
1978
1979
  for (const specifier of node.specifiers) {
1979
1980
  if (specifier.type !== "ImportSpecifier") continue;
1980
1981
  if (specifier.imported.type !== "Identifier") continue;
1981
- if (specifier.local.name !== specifier.imported.name) continue;
1982
- if (specifier.local.name === oppositeTestKeyword) context.report({
1982
+ if (specifier.imported.name !== oppositeTestKeyword) continue;
1983
+ context.report({
1983
1984
  node: specifier,
1984
1985
  data: {
1985
1986
  testFnKeyWork,
@@ -1987,14 +1988,17 @@ var consistent_test_it_default = createEslintRule({
1987
1988
  },
1988
1989
  messageId: "consistentMethod",
1989
1990
  fix: (fixer) => {
1990
- const remainingSpecifiers = node.specifiers.filter((spec) => spec.local.name !== oppositeTestKeyword);
1991
+ const remainingSpecifiers = node.specifiers.filter((spec) => spec !== specifier);
1991
1992
  if (remainingSpecifiers.length > 0) {
1992
- const importText = remainingSpecifiers.map((spec) => spec.local.name).join(", ");
1993
+ const hasPreferredSpecifier = remainingSpecifiers.some((spec) => spec.type === __typescript_eslint_utils.AST_NODE_TYPES.ImportSpecifier && spec.imported.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && spec.imported.name === testFnDisabled);
1994
+ const importNames = remainingSpecifiers.map((spec) => sourceCode.getText(spec));
1995
+ if (!hasPreferredSpecifier) importNames.push(testFnDisabled);
1996
+ const importText = importNames.join(", ");
1993
1997
  const lastSpecifierRange = node.specifiers.at(-1)?.range;
1994
1998
  if (!lastSpecifierRange) return null;
1995
1999
  return fixer.replaceTextRange([node.specifiers[0].range[0], lastSpecifierRange[1]], importText);
1996
2000
  }
1997
- return fixer.replaceText(specifier.local, testFnDisabled);
2001
+ return fixer.replaceText(specifier, testFnDisabled);
1998
2002
  }
1999
2003
  });
2000
2004
  }
@@ -6780,13 +6784,20 @@ const allRules = {
6780
6784
  };
6781
6785
  const recommendedRules = {
6782
6786
  "expect-expect": "error",
6787
+ "no-conditional-expect": "error",
6788
+ "no-disabled-tests": "warn",
6789
+ "no-focused-tests": "error",
6783
6790
  "no-commented-out-tests": "error",
6784
6791
  "no-identical-title": "error",
6785
6792
  "no-import-node-test": "error",
6793
+ "no-interpolation-in-snapshots": "error",
6794
+ "no-mocks-import": "error",
6795
+ "no-standalone-expect": "error",
6786
6796
  "prefer-called-exactly-once-with": "error",
6787
6797
  "require-local-test-context-for-concurrent-snapshots": "error",
6788
6798
  "valid-describe-callback": "error",
6789
6799
  "valid-expect": "error",
6800
+ "valid-expect-in-promise": "error",
6790
6801
  "valid-title": "error"
6791
6802
  };
6792
6803
  const plugin = {
package/dist/index.d.cts CHANGED
@@ -46,13 +46,20 @@ declare const plugin: {
46
46
  };
47
47
  readonly rules: {
48
48
  readonly "vitest/expect-expect": "error";
49
+ readonly "vitest/no-conditional-expect": "error";
50
+ readonly "vitest/no-disabled-tests": "warn";
51
+ readonly "vitest/no-focused-tests": "error";
49
52
  readonly "vitest/no-commented-out-tests": "error";
50
53
  readonly "vitest/no-identical-title": "error";
51
54
  readonly "vitest/no-import-node-test": "error";
55
+ readonly "vitest/no-interpolation-in-snapshots": "error";
56
+ readonly "vitest/no-mocks-import": "error";
57
+ readonly "vitest/no-standalone-expect": "error";
52
58
  readonly "vitest/prefer-called-exactly-once-with": "error";
53
59
  readonly "vitest/require-local-test-context-for-concurrent-snapshots": "error";
54
60
  readonly "vitest/valid-describe-callback": "error";
55
61
  readonly "vitest/valid-expect": "error";
62
+ readonly "vitest/valid-expect-in-promise": "error";
56
63
  readonly "vitest/valid-title": "error";
57
64
  };
58
65
  };
package/dist/index.d.ts CHANGED
@@ -46,13 +46,20 @@ declare const plugin: {
46
46
  };
47
47
  readonly rules: {
48
48
  readonly "vitest/expect-expect": "error";
49
+ readonly "vitest/no-conditional-expect": "error";
50
+ readonly "vitest/no-disabled-tests": "warn";
51
+ readonly "vitest/no-focused-tests": "error";
49
52
  readonly "vitest/no-commented-out-tests": "error";
50
53
  readonly "vitest/no-identical-title": "error";
51
54
  readonly "vitest/no-import-node-test": "error";
55
+ readonly "vitest/no-interpolation-in-snapshots": "error";
56
+ readonly "vitest/no-mocks-import": "error";
57
+ readonly "vitest/no-standalone-expect": "error";
52
58
  readonly "vitest/prefer-called-exactly-once-with": "error";
53
59
  readonly "vitest/require-local-test-context-for-concurrent-snapshots": "error";
54
60
  readonly "vitest/valid-describe-callback": "error";
55
61
  readonly "vitest/valid-expect": "error";
62
+ readonly "vitest/valid-expect-in-promise": "error";
56
63
  readonly "vitest/valid-title": "error";
57
64
  };
58
65
  };
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { isAbsolute, posix } from "node:path";
4
4
  import { DefinitionType } from "@typescript-eslint/scope-manager";
5
5
 
6
6
  //#region package.json
7
- var version = "1.4.4";
7
+ var version = "1.5.0";
8
8
 
9
9
  //#endregion
10
10
  //#region src/utils/index.ts
@@ -1942,6 +1942,7 @@ var consistent_test_it_default = createEslintRule({
1942
1942
  const testFnKeyWork = fn || TestCaseName.test;
1943
1943
  const testKeywordWithinDescribe = withinDescribe || fn || TestCaseName.it;
1944
1944
  const testFnDisabled = testFnKeyWork === testKeywordWithinDescribe ? testFnKeyWork : void 0;
1945
+ const { sourceCode } = context;
1945
1946
  let describeNestingLevel = 0;
1946
1947
  return {
1947
1948
  ImportDeclaration(node) {
@@ -1951,8 +1952,8 @@ var consistent_test_it_default = createEslintRule({
1951
1952
  for (const specifier of node.specifiers) {
1952
1953
  if (specifier.type !== "ImportSpecifier") continue;
1953
1954
  if (specifier.imported.type !== "Identifier") continue;
1954
- if (specifier.local.name !== specifier.imported.name) continue;
1955
- if (specifier.local.name === oppositeTestKeyword) context.report({
1955
+ if (specifier.imported.name !== oppositeTestKeyword) continue;
1956
+ context.report({
1956
1957
  node: specifier,
1957
1958
  data: {
1958
1959
  testFnKeyWork,
@@ -1960,14 +1961,17 @@ var consistent_test_it_default = createEslintRule({
1960
1961
  },
1961
1962
  messageId: "consistentMethod",
1962
1963
  fix: (fixer) => {
1963
- const remainingSpecifiers = node.specifiers.filter((spec) => spec.local.name !== oppositeTestKeyword);
1964
+ const remainingSpecifiers = node.specifiers.filter((spec) => spec !== specifier);
1964
1965
  if (remainingSpecifiers.length > 0) {
1965
- const importText = remainingSpecifiers.map((spec) => spec.local.name).join(", ");
1966
+ const hasPreferredSpecifier = remainingSpecifiers.some((spec) => spec.type === AST_NODE_TYPES.ImportSpecifier && spec.imported.type === AST_NODE_TYPES.Identifier && spec.imported.name === testFnDisabled);
1967
+ const importNames = remainingSpecifiers.map((spec) => sourceCode.getText(spec));
1968
+ if (!hasPreferredSpecifier) importNames.push(testFnDisabled);
1969
+ const importText = importNames.join(", ");
1966
1970
  const lastSpecifierRange = node.specifiers.at(-1)?.range;
1967
1971
  if (!lastSpecifierRange) return null;
1968
1972
  return fixer.replaceTextRange([node.specifiers[0].range[0], lastSpecifierRange[1]], importText);
1969
1973
  }
1970
- return fixer.replaceText(specifier.local, testFnDisabled);
1974
+ return fixer.replaceText(specifier, testFnDisabled);
1971
1975
  }
1972
1976
  });
1973
1977
  }
@@ -6753,13 +6757,20 @@ const allRules = {
6753
6757
  };
6754
6758
  const recommendedRules = {
6755
6759
  "expect-expect": "error",
6760
+ "no-conditional-expect": "error",
6761
+ "no-disabled-tests": "warn",
6762
+ "no-focused-tests": "error",
6756
6763
  "no-commented-out-tests": "error",
6757
6764
  "no-identical-title": "error",
6758
6765
  "no-import-node-test": "error",
6766
+ "no-interpolation-in-snapshots": "error",
6767
+ "no-mocks-import": "error",
6768
+ "no-standalone-expect": "error",
6759
6769
  "prefer-called-exactly-once-with": "error",
6760
6770
  "require-local-test-context-for-concurrent-snapshots": "error",
6761
6771
  "valid-describe-callback": "error",
6762
6772
  "valid-expect": "error",
6773
+ "valid-expect-in-promise": "error",
6763
6774
  "valid-title": "error"
6764
6775
  };
6765
6776
  const plugin = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest/eslint-plugin",
3
- "version": "1.4.4",
3
+ "version": "1.5.0",
4
4
  "license": "MIT",
5
5
  "description": "ESLint plugin for Vitest",
6
6
  "repository": "vitest-dev/eslint-plugin-vitest",