From 99abc651c6a750073be57a6046e9dacfdc300fb6 Mon Sep 17 00:00:00 2001 From: Antonio Ventilii Date: Fri, 20 Jun 2025 16:47:08 +0200 Subject: [PATCH 01/11] feat: New rule prefer-called-times --- docs/rules/prefer-called-times.md | 27 +++++++++ src/rules/prefer-called-times.ts | 67 ++++++++++++++++++++++ tests/prefer-called-times.test.ts | 94 +++++++++++++++++++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 docs/rules/prefer-called-times.md create mode 100644 src/rules/prefer-called-times.ts create mode 100644 tests/prefer-called-times.test.ts diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md new file mode 100644 index 00000000..aeddbdee --- /dev/null +++ b/docs/rules/prefer-called-times.md @@ -0,0 +1,27 @@ +# Enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` (`vitest/prefer-called-times`) + +## Rule Details + +This rule aims to enforce the use of `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` over `toBeCalledOnce()` or `toHaveBeenCalledOnce()`. + +Examples of **incorrect** code for this rule: + +```ts +test('foo', () => { + const mock = vi.fn() + mock('foo') + expect(mock).toBeCalledOnce() + expect(mock).toHaveBeenCalledOnce() +}) +``` + +Examples of **correct** code for this rule: + +```ts +test('foo', () => { + const mock = vi.fn() + mock('foo') + expect(mock).toBeCalledTimes(1) + expect(mock).toHaveBeenCalledTimes(1) +}) +``` diff --git a/src/rules/prefer-called-times.ts b/src/rules/prefer-called-times.ts new file mode 100644 index 00000000..c2ef2e94 --- /dev/null +++ b/src/rules/prefer-called-times.ts @@ -0,0 +1,67 @@ +import { createEslintRule, getAccessorValue } from '../utils' +import { + getFirstMatcherArg, + parseVitestFnCall, +} from '../utils/parse-vitest-fn-call' +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils' + +export const RULE_NAME = 'prefer-called-times' +type MESSAGE_IDS = 'preferCalledTimes' +type Options = [] + +type OneLiteral = TSESTree.Literal & { + value: 1 +} + +const isOneLiteral = (node: TSESTree.Node): node is OneLiteral => + node.type === AST_NODE_TYPES.Literal && node.value === 1 + +export default createEslintRule({ + name: RULE_NAME, + meta: { + docs: { + description: + 'enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)`', + recommended: false, + }, + messages: { + preferCalledTimes: 'Prefer {{ replacedMatcherName }}(1)', + }, + type: 'suggestion', + fixable: 'code', + schema: [], + }, + defaultOptions: [], + create(context) { + return { + CallExpression(node) { + const vitestFnCall = parseVitestFnCall(node, context) + + if (vitestFnCall?.type !== 'expect') return + + const { matcher } = vitestFnCall + const matcherName = getAccessorValue(matcher) + + if (['toBeCalledOnce', 'toHaveBeenCalledOnce'].includes(matcherName)) { + const replacedMatcherName = matcherName.replace('Once', 'Times') + + context.report({ + data: { replacedMatcherName }, + messageId: 'preferCalledTimes', + node: matcher, + fix: (fixer) => [ + fixer.replaceText(matcher, replacedMatcherName), + fixer.insertTextAfterRange( + [ + vitestFnCall.matcher.range[0], + vitestFnCall.matcher.range[1] + 1, + ], + '1', + ), + ], + }) + } + }, + } + }, +}) diff --git a/tests/prefer-called-times.test.ts b/tests/prefer-called-times.test.ts new file mode 100644 index 00000000..0822ac8d --- /dev/null +++ b/tests/prefer-called-times.test.ts @@ -0,0 +1,94 @@ +import rule, { RULE_NAME } from '../src/rules/prefer-called-times' +import { ruleTester } from './ruleTester' + +ruleTester.run(RULE_NAME, rule, { + valid: [ + 'expect(fn).toBeCalledTimes(1);', + 'expect(fn).toHaveBeenCalledTimes(1);', + 'expect(fn).toBeCalledTimes(2);', + 'expect(fn).toHaveBeenCalledTimes(2);', + 'expect(fn).toBeCalledTimes(expect.anything());', + 'expect(fn).toHaveBeenCalledTimes(expect.anything());', + 'expect(fn).not.toBeCalledTimes(2);', + 'expect(fn).rejects.not.toBeCalledTimes(1);', + 'expect(fn).not.toHaveBeenCalledTimes(1);', + 'expect(fn).resolves.not.toHaveBeenCalledTimes(1);', + 'expect(fn).toBeCalledTimes(0);', + 'expect(fn).toHaveBeenCalledTimes(0);', + 'expect(fn);', + ], + invalid: [ + { + code: 'expect(fn).toBeCalledOnce();', + errors: [ + { + messageId: 'preferCalledTimes', + data: { replacedMatcherName: 'toBeCalledTimes' }, + column: 12, + line: 1, + }, + ], + output: 'expect(fn).toBeCalledTimes(1);', + }, + { + code: 'expect(fn).toHaveBeenCalledOnce();', + errors: [ + { + messageId: 'preferCalledTimes', + data: { replacedMatcherName: 'toHaveBeenCalledTimes' }, + column: 12, + line: 1, + }, + ], + output: 'expect(fn).toHaveBeenCalledTimes(1);', + }, + { + code: 'expect(fn).not.toBeCalledOnce();', + errors: [ + { + messageId: 'preferCalledTimes', + data: { replacedMatcherName: 'toBeCalledTimes' }, + column: 16, + line: 1, + }, + ], + output: 'expect(fn).not.toBeCalledTimes(1);', + }, + { + code: 'expect(fn).not.toHaveBeenCalledOnce();', + errors: [ + { + messageId: 'preferCalledTimes', + data: { replacedMatcherName: 'toHaveBeenCalledTimes' }, + column: 16, + line: 1, + }, + ], + output: 'expect(fn).not.toHaveBeenCalledTimes(1);', + }, + { + code: 'expect(fn).resolves.toBeCalledOnce();', + errors: [ + { + messageId: 'preferCalledTimes', + data: { replacedMatcherName: 'toBeCalledTimes' }, + column: 21, + line: 1, + }, + ], + output: 'expect(fn).resolves.toBeCalledTimes(1);', + }, + { + code: 'expect(fn).resolves.toHaveBeenCalledOnce();', + errors: [ + { + messageId: 'preferCalledTimes', + data: { replacedMatcherName: 'toHaveBeenCalledTimes' }, + column: 21, + line: 1, + }, + ], + output: 'expect(fn).resolves.toHaveBeenCalledTimes(1);', + }, + ], +}) From a2467486a2861186d965cc9b9802a1e673ec6ca5 Mon Sep 17 00:00:00 2001 From: Antonio Ventilii Date: Fri, 20 Jun 2025 16:53:43 +0200 Subject: [PATCH 02/11] format --- src/rules/prefer-called-times.ts | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/rules/prefer-called-times.ts b/src/rules/prefer-called-times.ts index c2ef2e94..57ecae6f 100644 --- a/src/rules/prefer-called-times.ts +++ b/src/rules/prefer-called-times.ts @@ -1,21 +1,10 @@ import { createEslintRule, getAccessorValue } from '../utils' -import { - getFirstMatcherArg, - parseVitestFnCall, -} from '../utils/parse-vitest-fn-call' -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils' +import { parseVitestFnCall } from '../utils/parse-vitest-fn-call' export const RULE_NAME = 'prefer-called-times' type MESSAGE_IDS = 'preferCalledTimes' type Options = [] -type OneLiteral = TSESTree.Literal & { - value: 1 -} - -const isOneLiteral = (node: TSESTree.Node): node is OneLiteral => - node.type === AST_NODE_TYPES.Literal && node.value === 1 - export default createEslintRule({ name: RULE_NAME, meta: { @@ -52,11 +41,11 @@ export default createEslintRule({ fix: (fixer) => [ fixer.replaceText(matcher, replacedMatcherName), fixer.insertTextAfterRange( - [ - vitestFnCall.matcher.range[0], - vitestFnCall.matcher.range[1] + 1, - ], - '1', + [ + vitestFnCall.matcher.range[0], + vitestFnCall.matcher.range[1] + 1, + ], + '1', ), ], }) From 00a1d27fb1d82ecc7378287d4165ed9398b12469 Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Sun, 22 Jun 2025 23:56:09 -0400 Subject: [PATCH 03/11] chore: import prefer-times rule --- src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.ts b/src/index.ts index db3fca25..30098459 100644 --- a/src/index.ts +++ b/src/index.ts @@ -68,6 +68,7 @@ import paddingAroundTestBlocks, { RULE_NAME as paddingAroundTestBlocksName } fro import validExpectInPromise, { RULE_NAME as validExpectInPromiseName } from './rules/valid-expect-in-promise' import preferStrictBooleanMatchers, { RULE_NAME as preferStrictBooleanMatchersName } from './rules/prefer-strict-boolean-matchers' import requireMockTypeParameters, { RULE_NAME as requireMockTypeParametersName } from './rules/require-mock-type-parameters' +import preferCalledTimes, { RULE_NAME as preferCalledTimesName } from './rules/prefer-called-times' const createConfig = (rules: R) => Object.keys(rules).reduce((acc, ruleName) => { @@ -158,6 +159,7 @@ const allRules = { [requireMockTypeParametersName]: 'warn', [noImportingVitestGlobalsName]: 'off', [preferImportingVitestGlobalsName]: 'warn', + [preferCalledTimesName]: 'warn' } as const const recommended = { @@ -246,6 +248,7 @@ const plugin = { [requireMockTypeParametersName]: requireMockTypeParameters, [noImportingVitestGlobalsName]: noImportingVitestGlobals, [preferImportingVitestGlobalsName]: preferImportingVitestGlobals, + [preferCalledTimesName]: preferCalledTimes }, environments: { env: { From 70781067e53c2a843442b1e252819421fc5e0e53 Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Sun, 22 Jun 2025 23:59:16 -0400 Subject: [PATCH 04/11] chore: update eslint rule generator --- README.md | 144 +++++++++--------- docs/rules/consistent-test-filename.md | 4 +- docs/rules/consistent-test-it.md | 4 +- docs/rules/consistent-vitest-vi.md | 4 +- docs/rules/expect-expect.md | 6 +- docs/rules/max-expects.md | 4 +- docs/rules/max-nested-describe.md | 4 +- docs/rules/no-alias-methods.md | 4 +- docs/rules/no-commented-out-tests.md | 6 +- docs/rules/no-conditional-expect.md | 4 +- docs/rules/no-conditional-in-test.md | 4 +- docs/rules/no-conditional-tests.md | 4 +- docs/rules/no-disabled-tests.md | 4 +- docs/rules/no-done-callback.md | 4 +- docs/rules/no-duplicate-hooks.md | 4 +- docs/rules/no-focused-tests.md | 4 +- docs/rules/no-hooks.md | 4 +- docs/rules/no-identical-title.md | 6 +- docs/rules/no-import-node-test.md | 6 +- docs/rules/no-importing-vitest-globals.md | 8 +- docs/rules/no-interpolation-in-snapshots.md | 4 +- docs/rules/no-large-snapshots.md | 4 +- docs/rules/no-mocks-import.md | 4 +- docs/rules/no-restricted-matchers.md | 4 +- docs/rules/no-restricted-vi-methods.md | 4 +- docs/rules/no-standalone-expect.md | 4 +- docs/rules/no-test-prefixes.md | 4 +- docs/rules/no-test-return-statement.md | 4 +- docs/rules/padding-around-after-all-blocks.md | 4 +- .../rules/padding-around-after-each-blocks.md | 4 +- docs/rules/padding-around-all.md | 4 +- .../rules/padding-around-before-all-blocks.md | 4 +- .../padding-around-before-each-blocks.md | 4 +- docs/rules/padding-around-describe-blocks.md | 4 +- docs/rules/padding-around-expect-groups.md | 4 +- docs/rules/padding-around-test-blocks.md | 4 +- docs/rules/prefer-called-times.md | 8 +- docs/rules/prefer-called-with.md | 4 +- docs/rules/prefer-comparison-matcher.md | 4 +- docs/rules/prefer-describe-function-title.md | 4 +- docs/rules/prefer-each.md | 4 +- docs/rules/prefer-equality-matcher.md | 4 +- docs/rules/prefer-expect-assertions.md | 4 +- docs/rules/prefer-expect-resolves.md | 4 +- docs/rules/prefer-hooks-in-order.md | 4 +- docs/rules/prefer-hooks-on-top.md | 4 +- docs/rules/prefer-importing-vitest-globals.md | 8 +- docs/rules/prefer-lowercase-title.md | 4 +- docs/rules/prefer-mock-promise-shorthand.md | 4 +- docs/rules/prefer-snapshot-hint.md | 4 +- docs/rules/prefer-spy-on.md | 4 +- docs/rules/prefer-strict-boolean-matchers.md | 4 +- docs/rules/prefer-strict-equal.md | 4 +- docs/rules/prefer-to-be-falsy.md | 4 +- docs/rules/prefer-to-be-object.md | 4 +- docs/rules/prefer-to-be-truthy.md | 4 +- docs/rules/prefer-to-be.md | 4 +- docs/rules/prefer-to-contain.md | 4 +- docs/rules/prefer-to-have-length.md | 4 +- docs/rules/prefer-todo.md | 4 +- docs/rules/prefer-vi-mocked.md | 6 +- docs/rules/require-hook.md | 4 +- ...l-test-context-for-concurrent-snapshots.md | 6 +- docs/rules/require-mock-type-parameters.md | 6 +- docs/rules/require-to-throw-message.md | 4 +- docs/rules/require-top-level-describe.md | 4 +- docs/rules/valid-describe-callback.md | 6 +- docs/rules/valid-expect-in-promise.md | 4 +- docs/rules/valid-expect.md | 6 +- docs/rules/valid-title.md | 6 +- 70 files changed, 231 insertions(+), 221 deletions(-) diff --git a/README.md b/README.md index 8ec1af5b..ca423331 100644 --- a/README.md +++ b/README.md @@ -145,81 +145,83 @@ export default [ πŸ’Ό Configurations enabled in.\ ⚠️ Configurations set to warn in.\ -🌐 Set in the `all` configuration.\ -βœ… Set in the `recommended` configuration.\ +🚫 Configurations disabled in.\ πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\ +πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).\ ❌ Deprecated. -| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | πŸ”§ | πŸ’‘ | ❌ | -| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------- | :- | :- | :- | :- | :- | -| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | 🌐 | | | | -| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌐 | πŸ”§ | | | -| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌐 | πŸ”§ | | | -| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | βœ… | 🌐 | | | | -| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | 🌐 | | | | -| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | 🌐 | | | | -| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | 🌐 | πŸ”§ | | | -| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | βœ… | 🌐 | | | | -| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | 🌐 | | | | -| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | 🌐 | | | | -| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | 🌐 | | | | -| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | 🌐 | | | | -| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | 🌐 | | πŸ’‘ | ❌ | -| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | 🌐 | | | | -| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | 🌐 | πŸ”§ | | | -| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | 🌐 | | | | -| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | βœ… | 🌐 | πŸ”§ | | | -| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | βœ… | 🌐 | πŸ”§ | | | -| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | 🌐 | πŸ”§ | | | -| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | 🌐 | πŸ”§ | | | -| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | 🌐 | | | | -| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from __mocks__ directory | | 🌐 | | | | -| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | 🌐 | | | | -| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | 🌐 | | | | -| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌐 | | | | -| [no-test-prefixes](docs/rules/no-test-prefixes.md) | Disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | 🌐 | πŸ”§ | | | -| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌐 | | | | -| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | enforce padding around `afterAll` blocks | | 🌐 | πŸ”§ | | | -| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | enforce padding around `afterEach` blocks | | 🌐 | πŸ”§ | | | -| [padding-around-all](docs/rules/padding-around-all.md) | enforce padding around vitest functions | | 🌐 | πŸ”§ | | | -| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | enforce padding around `beforeAll` blocks | | 🌐 | πŸ”§ | | | -| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | enforce padding around `beforeEach` blocks | | 🌐 | πŸ”§ | | | -| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | enforce padding around `describe` blocks | | 🌐 | πŸ”§ | | | -| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | enforce padding around `expect` groups | | 🌐 | πŸ”§ | | | -| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌐 | πŸ”§ | | | -| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌐 | πŸ”§ | | | -| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | prefer using a function as a describe name over an equivalent string | | 🌐 | πŸ”§ | | | -| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌐 | | | | -| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | 🌐 | | πŸ’‘ | | -| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | 🌐 | | πŸ’‘ | | -| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | 🌐 | πŸ”§ | | | -| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌐 | | | | -| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌐 | | | | -| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌐 | πŸ”§ | | | -| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌐 | πŸ”§ | | | -| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌐 | πŸ”§ | | | -| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | 🌐 | | | | -| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | 🌐 | πŸ”§ | | | -| [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 | | 🌐 | πŸ”§ | | | -| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | 🌐 | | πŸ’‘ | | -| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | 🌐 | πŸ”§ | | | -| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | 🌐 | πŸ”§ | | | -| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | 🌐 | πŸ”§ | | | -| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | 🌐 | πŸ”§ | | | -| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | 🌐 | πŸ”§ | | | -| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | 🌐 | πŸ”§ | | | -| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | 🌐 | πŸ”§ | | | -| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | Prefer `vi.mocked()` over `fn as Mock` | | 🌐 | πŸ”§ | | | -| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | 🌐 | | | | -| [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 | βœ… | 🌐 | | | | -| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | 🌐 | | | | -| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | 🌐 | | | | -| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | 🌐 | | | | -| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | βœ… | 🌐 | | | | -| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | βœ… | 🌐 | πŸ”§ | | | -| [valid-title](docs/rules/valid-title.md) | enforce valid titles | βœ… | 🌐 | πŸ”§ | | | -| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | 🌐 | | | | +| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | +| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :---------------------------- | :-------------------- | :-------------------- | :- | :- | :- | :- | +| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | ![badge-legacy-all][] | | | | | | +| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | | | | | +| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | ![badge-legacy-all][] | | | | | | +| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | ![badge-legacy-all][] | | | | | | +| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | | | | | +| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | ![badge-legacy-all][] | | | | | | +| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | ![badge-legacy-all][] | | | | | | +| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | ![badge-legacy-all][] | | | | | | +| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | ![badge-legacy-all][] | | | | | | +| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | ![badge-legacy-all][] | | | πŸ’‘ | | ❌ | +| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | ![badge-legacy-all][] | | | | | | +| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | ![badge-legacy-all][] | | | | | | +| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | πŸ”§ | | | | +| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | πŸ”§ | | | | +| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | ![badge-legacy-all][] | πŸ”§ | | | | +| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | ![badge-legacy-all][] | | | | | | +| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from __mocks__ directory | | ![badge-legacy-all][] | | | | | | +| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | ![badge-legacy-all][] | | | | | | +| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | ![badge-legacy-all][] | | | | | | +| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | ![badge-legacy-all][] | | | | | | +| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | ![badge-legacy-all][] | | | | | | +| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | ![badge-legacy-all][] | | | | | | +| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | ![badge-legacy-all][] | | | πŸ’‘ | | | +| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | ![badge-legacy-all][] | | | πŸ’‘ | | | +| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | ![badge-legacy-all][] | | | | | | +| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | ![badge-legacy-all][] | | | | | | +| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | ![badge-legacy-all][] | | | | | | +| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [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 | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | ![badge-legacy-all][] | | | πŸ’‘ | | | +| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | ![badge-legacy-all][] | πŸ”§ | | | | +| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | ![badge-legacy-all][] | πŸ”§ | | | | +| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | ![badge-legacy-all][] | | πŸ”§ | | πŸ’­ | | +| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | ![badge-legacy-all][] | | | | | | +| [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 | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | | | | | +| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | ![badge-legacy-all][] | | πŸ”§ | | | | +| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | ![badge-legacy-all][] | | | | | | +| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | ![badge-legacy-all][] | | | | | | +| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | | | | | +| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | πŸ”§ | | | | +| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | ![badge-legacy-all][] | | | | | | +| [valid-title](docs/rules/valid-title.md) | enforce valid titles | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | πŸ”§ | | | | diff --git a/docs/rules/consistent-test-filename.md b/docs/rules/consistent-test-filename.md index 477b96e6..2cc82765 100644 --- a/docs/rules/consistent-test-filename.md +++ b/docs/rules/consistent-test-filename.md @@ -1,6 +1,6 @@ -# Require .spec test file pattern (`vitest/consistent-test-filename`) +# Require .spec test file pattern (`@vitest/consistent-test-filename`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index 1036aa28..4f284812 100644 --- a/docs/rules/consistent-test-it.md +++ b/docs/rules/consistent-test-it.md @@ -1,6 +1,6 @@ -# Enforce using test or it but not both (`vitest/consistent-test-it`) +# Enforce using test or it but not both (`@vitest/consistent-test-it`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/consistent-vitest-vi.md b/docs/rules/consistent-vitest-vi.md index cb7b06ec..f4878d37 100644 --- a/docs/rules/consistent-vitest-vi.md +++ b/docs/rules/consistent-vitest-vi.md @@ -1,6 +1,6 @@ -# Enforce using vitest or vi but not both (`vitest/consistent-vitest-vi`) +# Enforce using vitest or vi but not both (`@vitest/consistent-vitest-vi`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index 0062825c..0fdb4e30 100644 --- a/docs/rules/expect-expect.md +++ b/docs/rules/expect-expect.md @@ -1,8 +1,6 @@ -# Enforce having expectation in test body (`vitest/expect-expect`) +# Enforce having expectation in test body (`@vitest/expect-expect`) -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - -⚠️ This rule _warns_ in the 🌐 `all` config. +πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/max-expects.md b/docs/rules/max-expects.md index 8c4f97e0..6676ee51 100644 --- a/docs/rules/max-expects.md +++ b/docs/rules/max-expects.md @@ -1,6 +1,6 @@ -# Enforce a maximum number of expect per test (`vitest/max-expects`) +# Enforce a maximum number of expect per test (`@vitest/max-expects`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/max-nested-describe.md b/docs/rules/max-nested-describe.md index 1a436b08..e290d21a 100644 --- a/docs/rules/max-nested-describe.md +++ b/docs/rules/max-nested-describe.md @@ -1,6 +1,6 @@ -# Require describe block to be less than set max value or default value (`vitest/max-nested-describe`) +# Require describe block to be less than set max value or default value (`@vitest/max-nested-describe`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index 65768ad7..2c7bd563 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -1,6 +1,6 @@ -# Disallow alias methods (`vitest/no-alias-methods`) +# Disallow alias methods (`@vitest/no-alias-methods`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-commented-out-tests.md b/docs/rules/no-commented-out-tests.md index 7e189ada..74d4ddc9 100644 --- a/docs/rules/no-commented-out-tests.md +++ b/docs/rules/no-commented-out-tests.md @@ -1,8 +1,6 @@ -# Disallow commented out tests (`vitest/no-commented-out-tests`) +# Disallow commented out tests (`@vitest/no-commented-out-tests`) -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - -⚠️ This rule _warns_ in the 🌐 `all` config. +πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-conditional-expect.md b/docs/rules/no-conditional-expect.md index c2697036..dd6134e3 100644 --- a/docs/rules/no-conditional-expect.md +++ b/docs/rules/no-conditional-expect.md @@ -1,6 +1,6 @@ -# Disallow conditional expects (`vitest/no-conditional-expect`) +# Disallow conditional expects (`@vitest/no-conditional-expect`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-conditional-in-test.md b/docs/rules/no-conditional-in-test.md index bf3e15da..42023544 100644 --- a/docs/rules/no-conditional-in-test.md +++ b/docs/rules/no-conditional-in-test.md @@ -1,6 +1,6 @@ -# Disallow conditional tests (`vitest/no-conditional-in-test`) +# Disallow conditional tests (`@vitest/no-conditional-in-test`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. ### Rule Details diff --git a/docs/rules/no-conditional-tests.md b/docs/rules/no-conditional-tests.md index 4337a2b3..587f1f6a 100644 --- a/docs/rules/no-conditional-tests.md +++ b/docs/rules/no-conditional-tests.md @@ -1,6 +1,6 @@ -# Disallow conditional tests (`vitest/no-conditional-tests`) +# Disallow conditional tests (`@vitest/no-conditional-tests`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-disabled-tests.md b/docs/rules/no-disabled-tests.md index 6d6a09bb..4044a6b7 100644 --- a/docs/rules/no-disabled-tests.md +++ b/docs/rules/no-disabled-tests.md @@ -1,6 +1,6 @@ -# Disallow disabled tests (`vitest/no-disabled-tests`) +# Disallow disabled tests (`@vitest/no-disabled-tests`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-done-callback.md b/docs/rules/no-done-callback.md index 02272bfc..cd924255 100644 --- a/docs/rules/no-done-callback.md +++ b/docs/rules/no-done-callback.md @@ -1,8 +1,8 @@ -# Disallow using a callback in asynchronous tests and hooks (`vitest/no-done-callback`) +# Disallow using a callback in asynchronous tests and hooks (`@vitest/no-done-callback`) ❌ This rule is deprecated. -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index aa5e0163..0de13ac8 100644 --- a/docs/rules/no-duplicate-hooks.md +++ b/docs/rules/no-duplicate-hooks.md @@ -1,6 +1,6 @@ -# Disallow duplicate hooks and teardown hooks (`vitest/no-duplicate-hooks`) +# Disallow duplicate hooks and teardown hooks (`@vitest/no-duplicate-hooks`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index 34b84843..4d144ad2 100644 --- a/docs/rules/no-focused-tests.md +++ b/docs/rules/no-focused-tests.md @@ -1,6 +1,6 @@ -# Disallow focused tests (`vitest/no-focused-tests`) +# Disallow focused tests (`@vitest/no-focused-tests`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index e4f9a1d7..92fb2732 100644 --- a/docs/rules/no-hooks.md +++ b/docs/rules/no-hooks.md @@ -1,6 +1,6 @@ -# Disallow setup and teardown hooks (`vitest/no-hooks`) +# Disallow setup and teardown hooks (`@vitest/no-hooks`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index a9705cf8..23a09a49 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -1,8 +1,6 @@ -# Disallow identical titles (`vitest/no-identical-title`) +# Disallow identical titles (`@vitest/no-identical-title`) -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - -⚠️ This rule _warns_ in the 🌐 `all` config. +πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-import-node-test.md b/docs/rules/no-import-node-test.md index 79f27587..565ba0e4 100644 --- a/docs/rules/no-import-node-test.md +++ b/docs/rules/no-import-node-test.md @@ -1,8 +1,6 @@ -# Disallow importing `node:test` (`vitest/no-import-node-test`) +# Disallow importing `node:test` (`@vitest/no-import-node-test`) -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - -⚠️ This rule _warns_ in the 🌐 `all` config. +πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-importing-vitest-globals.md b/docs/rules/no-importing-vitest-globals.md index 80725690..16c0f9bd 100644 --- a/docs/rules/no-importing-vitest-globals.md +++ b/docs/rules/no-importing-vitest-globals.md @@ -1,4 +1,10 @@ -# Disallow importing Vitest globals (`vitest/no-importing-vitest-globals`) +# Disallow importing Vitest globals (`@vitest/no-importing-vitest-globals`) + +🚫 This rule is _disabled_ in the `legacy-all` config. + +πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-interpolation-in-snapshots.md b/docs/rules/no-interpolation-in-snapshots.md index d92cb269..668ae8fc 100644 --- a/docs/rules/no-interpolation-in-snapshots.md +++ b/docs/rules/no-interpolation-in-snapshots.md @@ -1,6 +1,6 @@ -# Disallow string interpolation in snapshots (`vitest/no-interpolation-in-snapshots`) +# Disallow string interpolation in snapshots (`@vitest/no-interpolation-in-snapshots`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index aaad8016..3a546d3b 100644 --- a/docs/rules/no-large-snapshots.md +++ b/docs/rules/no-large-snapshots.md @@ -1,6 +1,6 @@ -# Disallow large snapshots (`vitest/no-large-snapshots`) +# Disallow large snapshots (`@vitest/no-large-snapshots`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-mocks-import.md b/docs/rules/no-mocks-import.md index 82676302..1a5dfa7f 100644 --- a/docs/rules/no-mocks-import.md +++ b/docs/rules/no-mocks-import.md @@ -1,6 +1,6 @@ -# Disallow importing from __mocks__ directory (`vitest/no-mocks-import`) +# Disallow importing from __mocks__ directory (`@vitest/no-mocks-import`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-restricted-matchers.md b/docs/rules/no-restricted-matchers.md index ebd5de37..fa4ced3f 100644 --- a/docs/rules/no-restricted-matchers.md +++ b/docs/rules/no-restricted-matchers.md @@ -1,6 +1,6 @@ -# Disallow the use of certain matchers (`vitest/no-restricted-matchers`) +# Disallow the use of certain matchers (`@vitest/no-restricted-matchers`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-restricted-vi-methods.md b/docs/rules/no-restricted-vi-methods.md index 9eea038a..403be750 100644 --- a/docs/rules/no-restricted-vi-methods.md +++ b/docs/rules/no-restricted-vi-methods.md @@ -1,6 +1,6 @@ -# Disallow specific `vi.` methods (`vitest/no-restricted-vi-methods`) +# Disallow specific `vi.` methods (`@vitest/no-restricted-vi-methods`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-standalone-expect.md b/docs/rules/no-standalone-expect.md index b6c3d17e..4981e693 100644 --- a/docs/rules/no-standalone-expect.md +++ b/docs/rules/no-standalone-expect.md @@ -1,6 +1,6 @@ -# Disallow using `expect` outside of `it` or `test` blocks (`vitest/no-standalone-expect`) +# Disallow using `expect` outside of `it` or `test` blocks (`@vitest/no-standalone-expect`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index 7fd22470..914e7ed1 100644 --- a/docs/rules/no-test-prefixes.md +++ b/docs/rules/no-test-prefixes.md @@ -1,6 +1,6 @@ -# Disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` (`vitest/no-test-prefixes`) +# Disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` (`@vitest/no-test-prefixes`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-test-return-statement.md b/docs/rules/no-test-return-statement.md index db137ab8..774632cf 100644 --- a/docs/rules/no-test-return-statement.md +++ b/docs/rules/no-test-return-statement.md @@ -1,6 +1,6 @@ -# Disallow return statements in tests (`vitest/no-test-return-statement`) +# Disallow return statements in tests (`@vitest/no-test-return-statement`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/padding-around-after-all-blocks.md b/docs/rules/padding-around-after-all-blocks.md index 117d4e27..6510a7cf 100644 --- a/docs/rules/padding-around-after-all-blocks.md +++ b/docs/rules/padding-around-after-all-blocks.md @@ -1,6 +1,6 @@ -# Enforce padding around `afterAll` blocks (`vitest/padding-around-after-all-blocks`) +# Enforce padding around `afterAll` blocks (`@vitest/padding-around-after-all-blocks`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-after-each-blocks.md b/docs/rules/padding-around-after-each-blocks.md index 822a0c7b..718fe60a 100644 --- a/docs/rules/padding-around-after-each-blocks.md +++ b/docs/rules/padding-around-after-each-blocks.md @@ -1,6 +1,6 @@ -# Enforce padding around `afterEach` blocks (`vitest/padding-around-after-each-blocks`) +# Enforce padding around `afterEach` blocks (`@vitest/padding-around-after-each-blocks`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-all.md b/docs/rules/padding-around-all.md index db3bb254..d7737128 100644 --- a/docs/rules/padding-around-all.md +++ b/docs/rules/padding-around-all.md @@ -1,6 +1,6 @@ -# Enforce padding around vitest functions (`vitest/padding-around-all`) +# Enforce padding around vitest functions (`@vitest/padding-around-all`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-all-blocks.md b/docs/rules/padding-around-before-all-blocks.md index 716d8ed4..a386822c 100644 --- a/docs/rules/padding-around-before-all-blocks.md +++ b/docs/rules/padding-around-before-all-blocks.md @@ -1,6 +1,6 @@ -# Enforce padding around `beforeAll` blocks (`vitest/padding-around-before-all-blocks`) +# Enforce padding around `beforeAll` blocks (`@vitest/padding-around-before-all-blocks`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-each-blocks.md b/docs/rules/padding-around-before-each-blocks.md index dc5b194e..a9658a57 100644 --- a/docs/rules/padding-around-before-each-blocks.md +++ b/docs/rules/padding-around-before-each-blocks.md @@ -1,6 +1,6 @@ -# Enforce padding around `beforeEach` blocks (`vitest/padding-around-before-each-blocks`) +# Enforce padding around `beforeEach` blocks (`@vitest/padding-around-before-each-blocks`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-describe-blocks.md b/docs/rules/padding-around-describe-blocks.md index bf1fe20b..b6a0af21 100644 --- a/docs/rules/padding-around-describe-blocks.md +++ b/docs/rules/padding-around-describe-blocks.md @@ -1,6 +1,6 @@ -# Enforce padding around `describe` blocks (`vitest/padding-around-describe-blocks`) +# Enforce padding around `describe` blocks (`@vitest/padding-around-describe-blocks`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-expect-groups.md b/docs/rules/padding-around-expect-groups.md index 62858ca5..ad202c29 100644 --- a/docs/rules/padding-around-expect-groups.md +++ b/docs/rules/padding-around-expect-groups.md @@ -1,6 +1,6 @@ -# Enforce padding around `expect` groups (`vitest/padding-around-expect-groups`) +# Enforce padding around `expect` groups (`@vitest/padding-around-expect-groups`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-test-blocks.md b/docs/rules/padding-around-test-blocks.md index 20a67ed4..f9057d72 100644 --- a/docs/rules/padding-around-test-blocks.md +++ b/docs/rules/padding-around-test-blocks.md @@ -1,6 +1,6 @@ -# Enforce padding around `test` blocks (`vitest/padding-around-test-blocks`) +# Enforce padding around `test` blocks (`@vitest/padding-around-test-blocks`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index aeddbdee..818f5ae7 100644 --- a/docs/rules/prefer-called-times.md +++ b/docs/rules/prefer-called-times.md @@ -1,4 +1,10 @@ -# Enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` (`vitest/prefer-called-times`) +# Enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` (`@vitest/prefer-called-times`) + +⚠️ This rule _warns_ in the `legacy-all` config. + +πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + ## Rule Details diff --git a/docs/rules/prefer-called-with.md b/docs/rules/prefer-called-with.md index cc26bf5c..7eb652b5 100644 --- a/docs/rules/prefer-called-with.md +++ b/docs/rules/prefer-called-with.md @@ -1,6 +1,6 @@ -# Enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` (`vitest/prefer-called-with`) +# Enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` (`@vitest/prefer-called-with`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-comparison-matcher.md b/docs/rules/prefer-comparison-matcher.md index 95f8333e..c5c4ce44 100644 --- a/docs/rules/prefer-comparison-matcher.md +++ b/docs/rules/prefer-comparison-matcher.md @@ -1,6 +1,6 @@ -# Enforce using the built-in comparison matchers (`vitest/prefer-comparison-matcher`) +# Enforce using the built-in comparison matchers (`@vitest/prefer-comparison-matcher`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-describe-function-title.md b/docs/rules/prefer-describe-function-title.md index 69df6648..8a2f79a9 100644 --- a/docs/rules/prefer-describe-function-title.md +++ b/docs/rules/prefer-describe-function-title.md @@ -1,4 +1,6 @@ -# Enforce using a function as a describe title over an equivalent string (`vitest/prefer-describe-function-title`) +# Enforce using a function as a describe title over an equivalent string (`@vitest/prefer-describe-function-title`) + +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-each.md b/docs/rules/prefer-each.md index 8f75266a..d9a2c4a6 100644 --- a/docs/rules/prefer-each.md +++ b/docs/rules/prefer-each.md @@ -1,6 +1,6 @@ -# Enforce using `each` rather than manual loops (`vitest/prefer-each`) +# Enforce using `each` rather than manual loops (`@vitest/prefer-each`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/prefer-equality-matcher.md b/docs/rules/prefer-equality-matcher.md index 1da7bc7a..f34c8d72 100644 --- a/docs/rules/prefer-equality-matcher.md +++ b/docs/rules/prefer-equality-matcher.md @@ -1,6 +1,6 @@ -# Enforce using the built-in quality matchers (`vitest/prefer-equality-matcher`) +# Enforce using the built-in quality matchers (`@vitest/prefer-equality-matcher`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index 511b78ec..480403cf 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -1,6 +1,6 @@ -# Enforce using expect assertions instead of callbacks (`vitest/prefer-expect-assertions`) +# Enforce using expect assertions instead of callbacks (`@vitest/prefer-expect-assertions`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-resolves.md b/docs/rules/prefer-expect-resolves.md index 1c8eefd5..60e799c2 100644 --- a/docs/rules/prefer-expect-resolves.md +++ b/docs/rules/prefer-expect-resolves.md @@ -1,6 +1,6 @@ -# Enforce using `expect().resolves` over `expect(await ...)` syntax (`vitest/prefer-expect-resolves`) +# Enforce using `expect().resolves` over `expect(await ...)` syntax (`@vitest/prefer-expect-resolves`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-hooks-in-order.md b/docs/rules/prefer-hooks-in-order.md index 1dce314c..bfbb23c9 100644 --- a/docs/rules/prefer-hooks-in-order.md +++ b/docs/rules/prefer-hooks-in-order.md @@ -1,6 +1,6 @@ -# Enforce having hooks in consistent order (`vitest/prefer-hooks-in-order`) +# Enforce having hooks in consistent order (`@vitest/prefer-hooks-in-order`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index 1337f0c7..884445ae 100644 --- a/docs/rules/prefer-hooks-on-top.md +++ b/docs/rules/prefer-hooks-on-top.md @@ -1,6 +1,6 @@ -# Enforce having hooks before any test cases (`vitest/prefer-hooks-on-top`) +# Enforce having hooks before any test cases (`@vitest/prefer-hooks-on-top`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. ```ts diff --git a/docs/rules/prefer-importing-vitest-globals.md b/docs/rules/prefer-importing-vitest-globals.md index 418ac526..f0098c30 100644 --- a/docs/rules/prefer-importing-vitest-globals.md +++ b/docs/rules/prefer-importing-vitest-globals.md @@ -1,4 +1,10 @@ -# Prefer importing Vitest globals (`vitest/prefer-importing-vitest-globals`) +# Enforce importing Vitest globals (`@vitest/prefer-importing-vitest-globals`) + +⚠️ This rule _warns_ in the `legacy-all` config. + +πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + + ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-lowercase-title.md b/docs/rules/prefer-lowercase-title.md index 582bf094..8399d279 100644 --- a/docs/rules/prefer-lowercase-title.md +++ b/docs/rules/prefer-lowercase-title.md @@ -1,6 +1,6 @@ -# Enforce lowercase titles (`vitest/prefer-lowercase-title`) +# Enforce lowercase titles (`@vitest/prefer-lowercase-title`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-mock-promise-shorthand.md b/docs/rules/prefer-mock-promise-shorthand.md index a94bc064..5a3aad80 100644 --- a/docs/rules/prefer-mock-promise-shorthand.md +++ b/docs/rules/prefer-mock-promise-shorthand.md @@ -1,6 +1,6 @@ -# Enforce mock resolved/rejected shorthands for promises (`vitest/prefer-mock-promise-shorthand`) +# Enforce mock resolved/rejected shorthands for promises (`@vitest/prefer-mock-promise-shorthand`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-snapshot-hint.md b/docs/rules/prefer-snapshot-hint.md index c8350dc8..586513d7 100644 --- a/docs/rules/prefer-snapshot-hint.md +++ b/docs/rules/prefer-snapshot-hint.md @@ -1,6 +1,6 @@ -# Enforce including a hint with external snapshots (`vitest/prefer-snapshot-hint`) +# Enforce including a hint with external snapshots (`@vitest/prefer-snapshot-hint`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index ce85e338..06cd08a7 100644 --- a/docs/rules/prefer-spy-on.md +++ b/docs/rules/prefer-spy-on.md @@ -1,6 +1,6 @@ -# Enforce using `vi.spyOn` (`vitest/prefer-spy-on`) +# Enforce using `vi.spyOn` (`@vitest/prefer-spy-on`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-boolean-matchers.md b/docs/rules/prefer-strict-boolean-matchers.md index f4aad8c7..1cde0c1b 100644 --- a/docs/rules/prefer-strict-boolean-matchers.md +++ b/docs/rules/prefer-strict-boolean-matchers.md @@ -1,6 +1,6 @@ -# Enforce using `toBe(true)` and `toBe(false)` over matchers that coerce types to boolean (`vitest/prefer-strict-boolean-matchers`) +# Enforce using `toBe(true)` and `toBe(false)` over matchers that coerce types to boolean (`@vitest/prefer-strict-boolean-matchers`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index 4fbb06fb..897c344d 100644 --- a/docs/rules/prefer-strict-equal.md +++ b/docs/rules/prefer-strict-equal.md @@ -1,6 +1,6 @@ -# Enforce strict equal over equal (`vitest/prefer-strict-equal`) +# Enforce strict equal over equal (`@vitest/prefer-strict-equal`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-to-be-falsy.md b/docs/rules/prefer-to-be-falsy.md index 57479201..cad88526 100644 --- a/docs/rules/prefer-to-be-falsy.md +++ b/docs/rules/prefer-to-be-falsy.md @@ -1,6 +1,6 @@ -# Enforce using toBeFalsy() (`vitest/prefer-to-be-falsy`) +# Enforce using toBeFalsy() (`@vitest/prefer-to-be-falsy`) -⚠️ This rule _warns_ in the 🌐 `all` config. +🚫 This rule is _disabled_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-object.md b/docs/rules/prefer-to-be-object.md index 8412f27a..69560d10 100644 --- a/docs/rules/prefer-to-be-object.md +++ b/docs/rules/prefer-to-be-object.md @@ -1,6 +1,6 @@ -# Enforce using toBeObject() (`vitest/prefer-to-be-object`) +# Enforce using toBeObject() (`@vitest/prefer-to-be-object`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-truthy.md b/docs/rules/prefer-to-be-truthy.md index 6bc4cffc..0f42f0b6 100644 --- a/docs/rules/prefer-to-be-truthy.md +++ b/docs/rules/prefer-to-be-truthy.md @@ -1,6 +1,6 @@ -# Enforce using `toBeTruthy` (`vitest/prefer-to-be-truthy`) +# Enforce using `toBeTruthy` (`@vitest/prefer-to-be-truthy`) -⚠️ This rule _warns_ in the 🌐 `all` config. +🚫 This rule is _disabled_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be.md b/docs/rules/prefer-to-be.md index ae697f28..6a0e76c6 100644 --- a/docs/rules/prefer-to-be.md +++ b/docs/rules/prefer-to-be.md @@ -1,6 +1,6 @@ -# Enforce using toBe() (`vitest/prefer-to-be`) +# Enforce using toBe() (`@vitest/prefer-to-be`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index 3583aedc..5bde7b62 100644 --- a/docs/rules/prefer-to-contain.md +++ b/docs/rules/prefer-to-contain.md @@ -1,6 +1,6 @@ -# Enforce using toContain() (`vitest/prefer-to-contain`) +# Enforce using toContain() (`@vitest/prefer-to-contain`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index 21fc71a1..acfcdbd3 100644 --- a/docs/rules/prefer-to-have-length.md +++ b/docs/rules/prefer-to-have-length.md @@ -1,6 +1,6 @@ -# Enforce using toHaveLength() (`vitest/prefer-to-have-length`) +# Enforce using toHaveLength() (`@vitest/prefer-to-have-length`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index 322d73bf..3e51188a 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -1,6 +1,6 @@ -# Enforce using `test.todo` (`vitest/prefer-todo`) +# Enforce using `test.todo` (`@vitest/prefer-todo`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-vi-mocked.md b/docs/rules/prefer-vi-mocked.md index c9f5d5bd..b0d5a6da 100644 --- a/docs/rules/prefer-vi-mocked.md +++ b/docs/rules/prefer-vi-mocked.md @@ -1,9 +1,11 @@ -# Prefer `vi.mocked()` over `fn as Mock` (`vitest/prefer-vi-mocked`) +# Require `vi.mocked()` over `fn as Mock` (`@vitest/prefer-vi-mocked`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). +πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting). + When working with mocks of functions using Vitest, it's recommended to use the diff --git a/docs/rules/require-hook.md b/docs/rules/require-hook.md index 0f5e0452..ff1f77df 100644 --- a/docs/rules/require-hook.md +++ b/docs/rules/require-hook.md @@ -1,6 +1,6 @@ -# Require setup and teardown to be within a hook (`vitest/require-hook`) +# Require setup and teardown to be within a hook (`@vitest/require-hook`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/require-local-test-context-for-concurrent-snapshots.md b/docs/rules/require-local-test-context-for-concurrent-snapshots.md index 291e6326..25b14ed7 100644 --- a/docs/rules/require-local-test-context-for-concurrent-snapshots.md +++ b/docs/rules/require-local-test-context-for-concurrent-snapshots.md @@ -1,8 +1,6 @@ -# Require local Test Context for concurrent snapshot tests (`vitest/require-local-test-context-for-concurrent-snapshots`) +# Require local Test Context for concurrent snapshot tests (`@vitest/require-local-test-context-for-concurrent-snapshots`) -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - -⚠️ This rule _warns_ in the 🌐 `all` config. +πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/require-mock-type-parameters.md b/docs/rules/require-mock-type-parameters.md index da4687d5..56ddfe2d 100644 --- a/docs/rules/require-mock-type-parameters.md +++ b/docs/rules/require-mock-type-parameters.md @@ -1,6 +1,8 @@ -# Enforce using type parameters with vitest mock functions (`vitest/require-mock-type-parameters`) +# Enforce using type parameters with vitest mock functions (`@vitest/require-mock-type-parameters`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. + +πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index 590eb146..e164a3d4 100644 --- a/docs/rules/require-to-throw-message.md +++ b/docs/rules/require-to-throw-message.md @@ -1,6 +1,6 @@ -# Require toThrow() to be called with an error message (`vitest/require-to-throw-message`) +# Require toThrow() to be called with an error message (`@vitest/require-to-throw-message`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index be318827..f6e07a50 100644 --- a/docs/rules/require-top-level-describe.md +++ b/docs/rules/require-top-level-describe.md @@ -1,6 +1,6 @@ -# Enforce that all tests are in a top-level describe (`vitest/require-top-level-describe`) +# Enforce that all tests are in a top-level describe (`@vitest/require-top-level-describe`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/valid-describe-callback.md b/docs/rules/valid-describe-callback.md index eb28f33e..eb2b222b 100644 --- a/docs/rules/valid-describe-callback.md +++ b/docs/rules/valid-describe-callback.md @@ -1,8 +1,6 @@ -# Enforce valid describe callback (`vitest/valid-describe-callback`) +# Enforce valid describe callback (`@vitest/valid-describe-callback`) -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - -⚠️ This rule _warns_ in the 🌐 `all` config. +πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index 2b08aeff..4c7c3c32 100644 --- a/docs/rules/valid-expect-in-promise.md +++ b/docs/rules/valid-expect-in-promise.md @@ -1,6 +1,6 @@ -# Require promises that have expectations in their chain to be valid (`vitest/valid-expect-in-promise`) +# Require promises that have expectations in their chain to be valid (`@vitest/valid-expect-in-promise`) -⚠️ This rule _warns_ in the 🌐 `all` config. +⚠️ This rule _warns_ in the `legacy-all` config. diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index 6e98836f..d74d9c93 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -1,8 +1,6 @@ -# Enforce valid `expect()` usage (`vitest/valid-expect`) +# Enforce valid `expect()` usage (`@vitest/valid-expect`) -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - -⚠️ This rule _warns_ in the 🌐 `all` config. +πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index 049e0c5d..b6fddbd4 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -1,8 +1,6 @@ -# Enforce valid titles (`vitest/valid-title`) +# Enforce valid titles (`@vitest/valid-title`) -πŸ’Ό This rule is enabled in the βœ… `recommended` config. - -⚠️ This rule _warns_ in the 🌐 `all` config. +πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). From 7250dc53b920f73dee42d871b84cdc3708a3e5bd Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Mon, 23 Jun 2025 00:02:22 -0400 Subject: [PATCH 05/11] chore: update eslint rule generator --- README.md | 145 +++++++++--------- docs/rules/consistent-test-filename.md | 2 - docs/rules/consistent-test-it.md | 2 - docs/rules/consistent-vitest-vi.md | 2 - docs/rules/expect-expect.md | 2 - docs/rules/max-expects.md | 2 - docs/rules/max-nested-describe.md | 2 - docs/rules/no-alias-methods.md | 2 - docs/rules/no-commented-out-tests.md | 2 - docs/rules/no-conditional-expect.md | 2 - docs/rules/no-conditional-in-test.md | 2 - docs/rules/no-conditional-tests.md | 2 - docs/rules/no-disabled-tests.md | 2 - docs/rules/no-done-callback.md | 2 - docs/rules/no-duplicate-hooks.md | 2 - docs/rules/no-focused-tests.md | 2 - docs/rules/no-hooks.md | 2 - docs/rules/no-identical-title.md | 2 - docs/rules/no-import-node-test.md | 2 - docs/rules/no-importing-vitest-globals.md | 2 - docs/rules/no-interpolation-in-snapshots.md | 2 - docs/rules/no-large-snapshots.md | 2 - docs/rules/no-mocks-import.md | 2 - docs/rules/no-restricted-matchers.md | 2 - docs/rules/no-restricted-vi-methods.md | 2 - docs/rules/no-standalone-expect.md | 2 - docs/rules/no-test-prefixes.md | 2 - docs/rules/no-test-return-statement.md | 2 - docs/rules/padding-around-after-all-blocks.md | 2 - .../rules/padding-around-after-each-blocks.md | 2 - docs/rules/padding-around-all.md | 2 - .../rules/padding-around-before-all-blocks.md | 2 - .../padding-around-before-each-blocks.md | 2 - docs/rules/padding-around-describe-blocks.md | 2 - docs/rules/padding-around-expect-groups.md | 2 - docs/rules/padding-around-test-blocks.md | 2 - docs/rules/prefer-called-times.md | 2 - docs/rules/prefer-called-with.md | 2 - docs/rules/prefer-comparison-matcher.md | 2 - docs/rules/prefer-describe-function-title.md | 2 - docs/rules/prefer-each.md | 2 - docs/rules/prefer-equality-matcher.md | 2 - docs/rules/prefer-expect-assertions.md | 2 - docs/rules/prefer-expect-resolves.md | 2 - docs/rules/prefer-hooks-in-order.md | 2 - docs/rules/prefer-hooks-on-top.md | 2 - docs/rules/prefer-importing-vitest-globals.md | 2 - docs/rules/prefer-lowercase-title.md | 2 - docs/rules/prefer-mock-promise-shorthand.md | 2 - docs/rules/prefer-snapshot-hint.md | 2 - docs/rules/prefer-spy-on.md | 2 - docs/rules/prefer-strict-boolean-matchers.md | 2 - docs/rules/prefer-strict-equal.md | 2 - docs/rules/prefer-to-be-falsy.md | 2 - docs/rules/prefer-to-be-object.md | 2 - docs/rules/prefer-to-be-truthy.md | 2 - docs/rules/prefer-to-be.md | 2 - docs/rules/prefer-to-contain.md | 2 - docs/rules/prefer-to-have-length.md | 2 - docs/rules/prefer-todo.md | 2 - docs/rules/prefer-vi-mocked.md | 2 - docs/rules/require-hook.md | 2 - ...l-test-context-for-concurrent-snapshots.md | 2 - docs/rules/require-mock-type-parameters.md | 2 - docs/rules/require-to-throw-message.md | 2 - docs/rules/require-top-level-describe.md | 2 - docs/rules/valid-describe-callback.md | 2 - docs/rules/valid-expect-in-promise.md | 2 - docs/rules/valid-expect.md | 2 - docs/rules/valid-title.md | 2 - src/index.ts | 4 +- 71 files changed, 73 insertions(+), 214 deletions(-) diff --git a/README.md b/README.md index ca423331..54e315ab 100644 --- a/README.md +++ b/README.md @@ -143,85 +143,82 @@ export default [ -πŸ’Ό Configurations enabled in.\ -⚠️ Configurations set to warn in.\ -🚫 Configurations disabled in.\ πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\ πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).\ ❌ Deprecated. -| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | -| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :---------------------------- | :-------------------- | :-------------------- | :- | :- | :- | :- | -| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | ![badge-legacy-all][] | | | | | | -| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | | | | | -| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | ![badge-legacy-all][] | | | | | | -| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | ![badge-legacy-all][] | | | | | | -| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | | | | | -| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | ![badge-legacy-all][] | | | | | | -| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | ![badge-legacy-all][] | | | | | | -| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | ![badge-legacy-all][] | | | | | | -| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | ![badge-legacy-all][] | | | | | | -| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | ![badge-legacy-all][] | | | πŸ’‘ | | ❌ | -| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | ![badge-legacy-all][] | | | | | | -| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | ![badge-legacy-all][] | | | | | | -| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | πŸ”§ | | | | -| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | πŸ”§ | | | | -| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | ![badge-legacy-all][] | πŸ”§ | | | | -| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | ![badge-legacy-all][] | | | | | | -| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from __mocks__ directory | | ![badge-legacy-all][] | | | | | | -| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | ![badge-legacy-all][] | | | | | | -| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | ![badge-legacy-all][] | | | | | | -| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | ![badge-legacy-all][] | | | | | | -| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | ![badge-legacy-all][] | | | | | | -| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | ![badge-legacy-all][] | | | | | | -| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | ![badge-legacy-all][] | | | πŸ’‘ | | | -| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | ![badge-legacy-all][] | | | πŸ’‘ | | | -| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | ![badge-legacy-all][] | | | | | | -| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | ![badge-legacy-all][] | | | | | | -| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | ![badge-legacy-all][] | | | | | | -| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [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 | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | ![badge-legacy-all][] | | | πŸ’‘ | | | -| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | ![badge-legacy-all][] | πŸ”§ | | | | -| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | ![badge-legacy-all][] | πŸ”§ | | | | -| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | ![badge-legacy-all][] | | πŸ”§ | | πŸ’­ | | -| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | ![badge-legacy-all][] | | | | | | -| [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 | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | | | | | -| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | ![badge-legacy-all][] | | πŸ”§ | | | | -| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | ![badge-legacy-all][] | | | | | | -| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | ![badge-legacy-all][] | | | | | | -| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | | | | | -| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | πŸ”§ | | | | -| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | ![badge-legacy-all][] | | | | | | -| [valid-title](docs/rules/valid-title.md) | enforce valid titles | ![badge-legacy-recommended][] | ![badge-legacy-all][] | | πŸ”§ | | | | +| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | +| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :- | :- | :- | :- | +| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | | | | +| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | πŸ”§ | | | | +| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | πŸ”§ | | | | +| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | | | | | +| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | | | | +| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | | | | +| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | πŸ”§ | | | | +| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | | | | | +| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | | | | +| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | | | | +| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | | | | +| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | | | | +| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | πŸ’‘ | | ❌ | +| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | | | | +| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | πŸ”§ | | | | +| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | | | | +| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | πŸ”§ | | | | +| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | πŸ”§ | | | | +| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | πŸ”§ | | | | +| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | πŸ”§ | | | | +| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | | | | +| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from __mocks__ directory | | | | | +| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | | | | +| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | | | | +| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | | | | +| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | πŸ”§ | | | | +| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | | | | +| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | πŸ”§ | | | | +| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | πŸ”§ | | | | +| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | πŸ”§ | | | | +| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | πŸ”§ | | | | +| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | πŸ”§ | | | | +| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | πŸ”§ | | | | +| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | πŸ”§ | | | | +| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | πŸ”§ | | | | +| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | πŸ”§ | | | | +| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | πŸ”§ | | | | +| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | πŸ”§ | | | | +| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | πŸ”§ | | | | +| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | | | | +| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | πŸ’‘ | | | +| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | πŸ’‘ | | | +| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | πŸ”§ | | | | +| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | | | | +| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | | | | +| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | πŸ”§ | | | | +| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | πŸ”§ | | | | +| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | πŸ”§ | | | | +| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | | | | +| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | πŸ”§ | | | | +| [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 | πŸ”§ | | | | +| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | πŸ’‘ | | | +| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | πŸ”§ | | | | +| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | πŸ”§ | | | | +| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | πŸ”§ | | | | +| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | πŸ”§ | | | | +| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | πŸ”§ | | | | +| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | πŸ”§ | | | | +| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | πŸ”§ | | | | +| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | πŸ”§ | | πŸ’­ | | +| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | | | | +| [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 | | | | | +| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | πŸ”§ | | | | +| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | | | | +| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | | | | +| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | | | | | +| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | πŸ”§ | | | | +| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | | | | +| [valid-title](docs/rules/valid-title.md) | enforce valid titles | πŸ”§ | | | | diff --git a/docs/rules/consistent-test-filename.md b/docs/rules/consistent-test-filename.md index 2cc82765..5d2d0944 100644 --- a/docs/rules/consistent-test-filename.md +++ b/docs/rules/consistent-test-filename.md @@ -1,7 +1,5 @@ # Require .spec test file pattern (`@vitest/consistent-test-filename`) -⚠️ This rule _warns_ in the `legacy-all` config. - ### Rule Details diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index 4f284812..bb734948 100644 --- a/docs/rules/consistent-test-it.md +++ b/docs/rules/consistent-test-it.md @@ -1,7 +1,5 @@ # Enforce using test or it but not both (`@vitest/consistent-test-it`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/consistent-vitest-vi.md b/docs/rules/consistent-vitest-vi.md index f4878d37..687f1dc1 100644 --- a/docs/rules/consistent-vitest-vi.md +++ b/docs/rules/consistent-vitest-vi.md @@ -1,7 +1,5 @@ # Enforce using vitest or vi but not both (`@vitest/consistent-vitest-vi`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index 0fdb4e30..c31cc599 100644 --- a/docs/rules/expect-expect.md +++ b/docs/rules/expect-expect.md @@ -1,7 +1,5 @@ # Enforce having expectation in test body (`@vitest/expect-expect`) -πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. - diff --git a/docs/rules/max-expects.md b/docs/rules/max-expects.md index 6676ee51..de52fe38 100644 --- a/docs/rules/max-expects.md +++ b/docs/rules/max-expects.md @@ -1,7 +1,5 @@ # Enforce a maximum number of expect per test (`@vitest/max-expects`) -⚠️ This rule _warns_ in the `legacy-all` config. - ### Rule Details diff --git a/docs/rules/max-nested-describe.md b/docs/rules/max-nested-describe.md index e290d21a..c7dc8e81 100644 --- a/docs/rules/max-nested-describe.md +++ b/docs/rules/max-nested-describe.md @@ -1,7 +1,5 @@ # Require describe block to be less than set max value or default value (`@vitest/max-nested-describe`) -⚠️ This rule _warns_ in the `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index 2c7bd563..055a07a0 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -1,7 +1,5 @@ # Disallow alias methods (`@vitest/no-alias-methods`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-commented-out-tests.md b/docs/rules/no-commented-out-tests.md index 74d4ddc9..c3f3a4ec 100644 --- a/docs/rules/no-commented-out-tests.md +++ b/docs/rules/no-commented-out-tests.md @@ -1,7 +1,5 @@ # Disallow commented out tests (`@vitest/no-commented-out-tests`) -πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-conditional-expect.md b/docs/rules/no-conditional-expect.md index dd6134e3..33bc99dc 100644 --- a/docs/rules/no-conditional-expect.md +++ b/docs/rules/no-conditional-expect.md @@ -1,7 +1,5 @@ # Disallow conditional expects (`@vitest/no-conditional-expect`) -⚠️ This rule _warns_ in the `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-conditional-in-test.md b/docs/rules/no-conditional-in-test.md index 42023544..fc175beb 100644 --- a/docs/rules/no-conditional-in-test.md +++ b/docs/rules/no-conditional-in-test.md @@ -1,7 +1,5 @@ # Disallow conditional tests (`@vitest/no-conditional-in-test`) -⚠️ This rule _warns_ in the `legacy-all` config. - ### Rule Details diff --git a/docs/rules/no-conditional-tests.md b/docs/rules/no-conditional-tests.md index 587f1f6a..37fbd101 100644 --- a/docs/rules/no-conditional-tests.md +++ b/docs/rules/no-conditional-tests.md @@ -1,7 +1,5 @@ # Disallow conditional tests (`@vitest/no-conditional-tests`) -⚠️ This rule _warns_ in the `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-disabled-tests.md b/docs/rules/no-disabled-tests.md index 4044a6b7..6e075946 100644 --- a/docs/rules/no-disabled-tests.md +++ b/docs/rules/no-disabled-tests.md @@ -1,7 +1,5 @@ # Disallow disabled tests (`@vitest/no-disabled-tests`) -⚠️ This rule _warns_ in the `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-done-callback.md b/docs/rules/no-done-callback.md index cd924255..c9c45751 100644 --- a/docs/rules/no-done-callback.md +++ b/docs/rules/no-done-callback.md @@ -2,8 +2,6 @@ ❌ This rule is deprecated. -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index 0de13ac8..1edd8b41 100644 --- a/docs/rules/no-duplicate-hooks.md +++ b/docs/rules/no-duplicate-hooks.md @@ -1,7 +1,5 @@ # Disallow duplicate hooks and teardown hooks (`@vitest/no-duplicate-hooks`) -⚠️ This rule _warns_ in the `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index 4d144ad2..47f844ab 100644 --- a/docs/rules/no-focused-tests.md +++ b/docs/rules/no-focused-tests.md @@ -1,7 +1,5 @@ # Disallow focused tests (`@vitest/no-focused-tests`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index 92fb2732..e34e8daf 100644 --- a/docs/rules/no-hooks.md +++ b/docs/rules/no-hooks.md @@ -1,7 +1,5 @@ # Disallow setup and teardown hooks (`@vitest/no-hooks`) -⚠️ This rule _warns_ in the `legacy-all` config. - ## Rule details diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index 23a09a49..6a854c6a 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -1,7 +1,5 @@ # Disallow identical titles (`@vitest/no-identical-title`) -πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-import-node-test.md b/docs/rules/no-import-node-test.md index 565ba0e4..31a914b7 100644 --- a/docs/rules/no-import-node-test.md +++ b/docs/rules/no-import-node-test.md @@ -1,7 +1,5 @@ # Disallow importing `node:test` (`@vitest/no-import-node-test`) -πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-importing-vitest-globals.md b/docs/rules/no-importing-vitest-globals.md index 16c0f9bd..6765ebd2 100644 --- a/docs/rules/no-importing-vitest-globals.md +++ b/docs/rules/no-importing-vitest-globals.md @@ -1,7 +1,5 @@ # Disallow importing Vitest globals (`@vitest/no-importing-vitest-globals`) -🚫 This rule is _disabled_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-interpolation-in-snapshots.md b/docs/rules/no-interpolation-in-snapshots.md index 668ae8fc..1c1cc4db 100644 --- a/docs/rules/no-interpolation-in-snapshots.md +++ b/docs/rules/no-interpolation-in-snapshots.md @@ -1,7 +1,5 @@ # Disallow string interpolation in snapshots (`@vitest/no-interpolation-in-snapshots`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index 3a546d3b..2f1a2d55 100644 --- a/docs/rules/no-large-snapshots.md +++ b/docs/rules/no-large-snapshots.md @@ -1,7 +1,5 @@ # Disallow large snapshots (`@vitest/no-large-snapshots`) -⚠️ This rule _warns_ in the `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-mocks-import.md b/docs/rules/no-mocks-import.md index 1a5dfa7f..bedce17f 100644 --- a/docs/rules/no-mocks-import.md +++ b/docs/rules/no-mocks-import.md @@ -1,7 +1,5 @@ # Disallow importing from __mocks__ directory (`@vitest/no-mocks-import`) -⚠️ This rule _warns_ in the `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-restricted-matchers.md b/docs/rules/no-restricted-matchers.md index fa4ced3f..a8dca933 100644 --- a/docs/rules/no-restricted-matchers.md +++ b/docs/rules/no-restricted-matchers.md @@ -1,7 +1,5 @@ # Disallow the use of certain matchers (`@vitest/no-restricted-matchers`) -⚠️ This rule _warns_ in the `legacy-all` config. - ### Rule Details diff --git a/docs/rules/no-restricted-vi-methods.md b/docs/rules/no-restricted-vi-methods.md index 403be750..6c1e769c 100644 --- a/docs/rules/no-restricted-vi-methods.md +++ b/docs/rules/no-restricted-vi-methods.md @@ -1,7 +1,5 @@ # Disallow specific `vi.` methods (`@vitest/no-restricted-vi-methods`) -⚠️ This rule _warns_ in the `legacy-all` config. - You may wish to restrict the use of specific `vi` methods. diff --git a/docs/rules/no-standalone-expect.md b/docs/rules/no-standalone-expect.md index 4981e693..332159a3 100644 --- a/docs/rules/no-standalone-expect.md +++ b/docs/rules/no-standalone-expect.md @@ -1,7 +1,5 @@ # Disallow using `expect` outside of `it` or `test` blocks (`@vitest/no-standalone-expect`) -⚠️ This rule _warns_ in the `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index 914e7ed1..a2555b63 100644 --- a/docs/rules/no-test-prefixes.md +++ b/docs/rules/no-test-prefixes.md @@ -1,7 +1,5 @@ # Disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` (`@vitest/no-test-prefixes`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-test-return-statement.md b/docs/rules/no-test-return-statement.md index 774632cf..9c037485 100644 --- a/docs/rules/no-test-return-statement.md +++ b/docs/rules/no-test-return-statement.md @@ -1,7 +1,5 @@ # Disallow return statements in tests (`@vitest/no-test-return-statement`) -⚠️ This rule _warns_ in the `legacy-all` config. - ### Rule Details diff --git a/docs/rules/padding-around-after-all-blocks.md b/docs/rules/padding-around-after-all-blocks.md index 6510a7cf..7f024774 100644 --- a/docs/rules/padding-around-after-all-blocks.md +++ b/docs/rules/padding-around-after-all-blocks.md @@ -1,7 +1,5 @@ # Enforce padding around `afterAll` blocks (`@vitest/padding-around-after-all-blocks`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-after-each-blocks.md b/docs/rules/padding-around-after-each-blocks.md index 718fe60a..cae1c868 100644 --- a/docs/rules/padding-around-after-each-blocks.md +++ b/docs/rules/padding-around-after-each-blocks.md @@ -1,7 +1,5 @@ # Enforce padding around `afterEach` blocks (`@vitest/padding-around-after-each-blocks`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-all.md b/docs/rules/padding-around-all.md index d7737128..e8684900 100644 --- a/docs/rules/padding-around-all.md +++ b/docs/rules/padding-around-all.md @@ -1,7 +1,5 @@ # Enforce padding around vitest functions (`@vitest/padding-around-all`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-all-blocks.md b/docs/rules/padding-around-before-all-blocks.md index a386822c..6c908f8d 100644 --- a/docs/rules/padding-around-before-all-blocks.md +++ b/docs/rules/padding-around-before-all-blocks.md @@ -1,7 +1,5 @@ # Enforce padding around `beforeAll` blocks (`@vitest/padding-around-before-all-blocks`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-each-blocks.md b/docs/rules/padding-around-before-each-blocks.md index a9658a57..8790f3d3 100644 --- a/docs/rules/padding-around-before-each-blocks.md +++ b/docs/rules/padding-around-before-each-blocks.md @@ -1,7 +1,5 @@ # Enforce padding around `beforeEach` blocks (`@vitest/padding-around-before-each-blocks`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-describe-blocks.md b/docs/rules/padding-around-describe-blocks.md index b6a0af21..6488981b 100644 --- a/docs/rules/padding-around-describe-blocks.md +++ b/docs/rules/padding-around-describe-blocks.md @@ -1,7 +1,5 @@ # Enforce padding around `describe` blocks (`@vitest/padding-around-describe-blocks`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-expect-groups.md b/docs/rules/padding-around-expect-groups.md index ad202c29..eb0288ed 100644 --- a/docs/rules/padding-around-expect-groups.md +++ b/docs/rules/padding-around-expect-groups.md @@ -1,7 +1,5 @@ # Enforce padding around `expect` groups (`@vitest/padding-around-expect-groups`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-test-blocks.md b/docs/rules/padding-around-test-blocks.md index f9057d72..7d94f5fd 100644 --- a/docs/rules/padding-around-test-blocks.md +++ b/docs/rules/padding-around-test-blocks.md @@ -1,7 +1,5 @@ # Enforce padding around `test` blocks (`@vitest/padding-around-test-blocks`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index 818f5ae7..6ac0d54d 100644 --- a/docs/rules/prefer-called-times.md +++ b/docs/rules/prefer-called-times.md @@ -1,7 +1,5 @@ # Enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` (`@vitest/prefer-called-times`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-with.md b/docs/rules/prefer-called-with.md index 7eb652b5..2fd56659 100644 --- a/docs/rules/prefer-called-with.md +++ b/docs/rules/prefer-called-with.md @@ -1,7 +1,5 @@ # Enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` (`@vitest/prefer-called-with`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-comparison-matcher.md b/docs/rules/prefer-comparison-matcher.md index c5c4ce44..d4b73214 100644 --- a/docs/rules/prefer-comparison-matcher.md +++ b/docs/rules/prefer-comparison-matcher.md @@ -1,7 +1,5 @@ # Enforce using the built-in comparison matchers (`@vitest/prefer-comparison-matcher`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-describe-function-title.md b/docs/rules/prefer-describe-function-title.md index 8a2f79a9..cf251d66 100644 --- a/docs/rules/prefer-describe-function-title.md +++ b/docs/rules/prefer-describe-function-title.md @@ -1,7 +1,5 @@ # Enforce using a function as a describe title over an equivalent string (`@vitest/prefer-describe-function-title`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-each.md b/docs/rules/prefer-each.md index d9a2c4a6..fce4161f 100644 --- a/docs/rules/prefer-each.md +++ b/docs/rules/prefer-each.md @@ -1,7 +1,5 @@ # Enforce using `each` rather than manual loops (`@vitest/prefer-each`) -⚠️ This rule _warns_ in the `legacy-all` config. - ```js diff --git a/docs/rules/prefer-equality-matcher.md b/docs/rules/prefer-equality-matcher.md index f34c8d72..4f8f3703 100644 --- a/docs/rules/prefer-equality-matcher.md +++ b/docs/rules/prefer-equality-matcher.md @@ -1,7 +1,5 @@ # Enforce using the built-in quality matchers (`@vitest/prefer-equality-matcher`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index 480403cf..a36ace2b 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -1,7 +1,5 @@ # Enforce using expect assertions instead of callbacks (`@vitest/prefer-expect-assertions`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-resolves.md b/docs/rules/prefer-expect-resolves.md index 60e799c2..af577861 100644 --- a/docs/rules/prefer-expect-resolves.md +++ b/docs/rules/prefer-expect-resolves.md @@ -1,7 +1,5 @@ # Enforce using `expect().resolves` over `expect(await ...)` syntax (`@vitest/prefer-expect-resolves`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-hooks-in-order.md b/docs/rules/prefer-hooks-in-order.md index bfbb23c9..daa3c960 100644 --- a/docs/rules/prefer-hooks-in-order.md +++ b/docs/rules/prefer-hooks-in-order.md @@ -1,7 +1,5 @@ # Enforce having hooks in consistent order (`@vitest/prefer-hooks-in-order`) -⚠️ This rule _warns_ in the `legacy-all` config. - ```js diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index 884445ae..11cfb228 100644 --- a/docs/rules/prefer-hooks-on-top.md +++ b/docs/rules/prefer-hooks-on-top.md @@ -1,7 +1,5 @@ # Enforce having hooks before any test cases (`@vitest/prefer-hooks-on-top`) -⚠️ This rule _warns_ in the `legacy-all` config. - ```ts // bad diff --git a/docs/rules/prefer-importing-vitest-globals.md b/docs/rules/prefer-importing-vitest-globals.md index f0098c30..a8398c2d 100644 --- a/docs/rules/prefer-importing-vitest-globals.md +++ b/docs/rules/prefer-importing-vitest-globals.md @@ -1,7 +1,5 @@ # Enforce importing Vitest globals (`@vitest/prefer-importing-vitest-globals`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-lowercase-title.md b/docs/rules/prefer-lowercase-title.md index 8399d279..a2e3f79f 100644 --- a/docs/rules/prefer-lowercase-title.md +++ b/docs/rules/prefer-lowercase-title.md @@ -1,7 +1,5 @@ # Enforce lowercase titles (`@vitest/prefer-lowercase-title`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-mock-promise-shorthand.md b/docs/rules/prefer-mock-promise-shorthand.md index 5a3aad80..aba9aea0 100644 --- a/docs/rules/prefer-mock-promise-shorthand.md +++ b/docs/rules/prefer-mock-promise-shorthand.md @@ -1,7 +1,5 @@ # Enforce mock resolved/rejected shorthands for promises (`@vitest/prefer-mock-promise-shorthand`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-snapshot-hint.md b/docs/rules/prefer-snapshot-hint.md index 586513d7..61a7ce6c 100644 --- a/docs/rules/prefer-snapshot-hint.md +++ b/docs/rules/prefer-snapshot-hint.md @@ -1,7 +1,5 @@ # Enforce including a hint with external snapshots (`@vitest/prefer-snapshot-hint`) -⚠️ This rule _warns_ in the `legacy-all` config. - When working with external snapshot matchers it's considered best practice to diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index 06cd08a7..ed3099af 100644 --- a/docs/rules/prefer-spy-on.md +++ b/docs/rules/prefer-spy-on.md @@ -1,7 +1,5 @@ # Enforce using `vi.spyOn` (`@vitest/prefer-spy-on`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-boolean-matchers.md b/docs/rules/prefer-strict-boolean-matchers.md index 1cde0c1b..47e3bfde 100644 --- a/docs/rules/prefer-strict-boolean-matchers.md +++ b/docs/rules/prefer-strict-boolean-matchers.md @@ -1,7 +1,5 @@ # Enforce using `toBe(true)` and `toBe(false)` over matchers that coerce types to boolean (`@vitest/prefer-strict-boolean-matchers`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index 897c344d..5f204a27 100644 --- a/docs/rules/prefer-strict-equal.md +++ b/docs/rules/prefer-strict-equal.md @@ -1,7 +1,5 @@ # Enforce strict equal over equal (`@vitest/prefer-strict-equal`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-to-be-falsy.md b/docs/rules/prefer-to-be-falsy.md index cad88526..9c72dbb9 100644 --- a/docs/rules/prefer-to-be-falsy.md +++ b/docs/rules/prefer-to-be-falsy.md @@ -1,7 +1,5 @@ # Enforce using toBeFalsy() (`@vitest/prefer-to-be-falsy`) -🚫 This rule is _disabled_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-object.md b/docs/rules/prefer-to-be-object.md index 69560d10..3d8dc484 100644 --- a/docs/rules/prefer-to-be-object.md +++ b/docs/rules/prefer-to-be-object.md @@ -1,7 +1,5 @@ # Enforce using toBeObject() (`@vitest/prefer-to-be-object`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-truthy.md b/docs/rules/prefer-to-be-truthy.md index 0f42f0b6..de2e39a2 100644 --- a/docs/rules/prefer-to-be-truthy.md +++ b/docs/rules/prefer-to-be-truthy.md @@ -1,7 +1,5 @@ # Enforce using `toBeTruthy` (`@vitest/prefer-to-be-truthy`) -🚫 This rule is _disabled_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be.md b/docs/rules/prefer-to-be.md index 6a0e76c6..2a07a0f4 100644 --- a/docs/rules/prefer-to-be.md +++ b/docs/rules/prefer-to-be.md @@ -1,7 +1,5 @@ # Enforce using toBe() (`@vitest/prefer-to-be`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index 5bde7b62..6d482243 100644 --- a/docs/rules/prefer-to-contain.md +++ b/docs/rules/prefer-to-contain.md @@ -1,7 +1,5 @@ # Enforce using toContain() (`@vitest/prefer-to-contain`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index acfcdbd3..cc371c1b 100644 --- a/docs/rules/prefer-to-have-length.md +++ b/docs/rules/prefer-to-have-length.md @@ -1,7 +1,5 @@ # Enforce using toHaveLength() (`@vitest/prefer-to-have-length`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index 3e51188a..b338de3b 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -1,7 +1,5 @@ # Enforce using `test.todo` (`@vitest/prefer-todo`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-vi-mocked.md b/docs/rules/prefer-vi-mocked.md index b0d5a6da..fedf8dd1 100644 --- a/docs/rules/prefer-vi-mocked.md +++ b/docs/rules/prefer-vi-mocked.md @@ -1,7 +1,5 @@ # Require `vi.mocked()` over `fn as Mock` (`@vitest/prefer-vi-mocked`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting). diff --git a/docs/rules/require-hook.md b/docs/rules/require-hook.md index ff1f77df..88fd1f7f 100644 --- a/docs/rules/require-hook.md +++ b/docs/rules/require-hook.md @@ -1,7 +1,5 @@ # Require setup and teardown to be within a hook (`@vitest/require-hook`) -⚠️ This rule _warns_ in the `legacy-all` config. - It's common when writing tests to need to perform a particular setup work before and after a test suite run. Because Vitest executes all `describe` handlers in a test file _before_ it executes any of the actual tests, it's important to ensure setup and teardown work is done inside `before*` and `after*` handlers respectively, rather than inside the `describe` blocks. diff --git a/docs/rules/require-local-test-context-for-concurrent-snapshots.md b/docs/rules/require-local-test-context-for-concurrent-snapshots.md index 25b14ed7..cd645195 100644 --- a/docs/rules/require-local-test-context-for-concurrent-snapshots.md +++ b/docs/rules/require-local-test-context-for-concurrent-snapshots.md @@ -1,7 +1,5 @@ # Require local Test Context for concurrent snapshot tests (`@vitest/require-local-test-context-for-concurrent-snapshots`) -πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. - ## Rule details diff --git a/docs/rules/require-mock-type-parameters.md b/docs/rules/require-mock-type-parameters.md index 56ddfe2d..01e6605b 100644 --- a/docs/rules/require-mock-type-parameters.md +++ b/docs/rules/require-mock-type-parameters.md @@ -1,7 +1,5 @@ # Enforce using type parameters with vitest mock functions (`@vitest/require-mock-type-parameters`) -⚠️ This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index e164a3d4..ec90c94d 100644 --- a/docs/rules/require-to-throw-message.md +++ b/docs/rules/require-to-throw-message.md @@ -1,7 +1,5 @@ # Require toThrow() to be called with an error message (`@vitest/require-to-throw-message`) -⚠️ This rule _warns_ in the `legacy-all` config. - This rule triggers a warning if `toThrow()` or `toThrowError()` is used without diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index f6e07a50..8a324c58 100644 --- a/docs/rules/require-top-level-describe.md +++ b/docs/rules/require-top-level-describe.md @@ -1,7 +1,5 @@ # Enforce that all tests are in a top-level describe (`@vitest/require-top-level-describe`) -⚠️ This rule _warns_ in the `legacy-all` config. - This rule triggers warning if a test case (`test` and `it`) or a hook (`beforeAll`, `beforeEach`, `afterEach`, `afterAll`) is not located in a top-level `describe` block. diff --git a/docs/rules/valid-describe-callback.md b/docs/rules/valid-describe-callback.md index eb2b222b..db5ecea4 100644 --- a/docs/rules/valid-describe-callback.md +++ b/docs/rules/valid-describe-callback.md @@ -1,7 +1,5 @@ # Enforce valid describe callback (`@vitest/valid-describe-callback`) -πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. - diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index 4c7c3c32..addaf946 100644 --- a/docs/rules/valid-expect-in-promise.md +++ b/docs/rules/valid-expect-in-promise.md @@ -1,7 +1,5 @@ # Require promises that have expectations in their chain to be valid (`@vitest/valid-expect-in-promise`) -⚠️ This rule _warns_ in the `legacy-all` config. - This rule flags any promises within the body of a test that include expectations that have either not been returned or awaited. diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index d74d9c93..36a5ab1c 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -1,7 +1,5 @@ # Enforce valid `expect()` usage (`@vitest/valid-expect`) -πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index b6fddbd4..c70a7eca 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -1,7 +1,5 @@ # Enforce valid titles (`@vitest/valid-title`) -πŸ’Όβš οΈ This rule is enabled in the `legacy-recommended` config. This rule _warns_ in the `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/src/index.ts b/src/index.ts index 30098459..7487f92c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -274,8 +274,8 @@ const plugin = { }, }, configs: { - 'legacy-recommended': createConfigLegacy(recommended), - 'legacy-all': createConfigLegacy(allRules), + //'legacy-recommended': createConfigLegacy(recommended), + //'legacy-all': createConfigLegacy(allRules), recommended: { name: '@vitest/recommended', plugins: { From 8c8a99c1a2001bb3cfc15270a6869655396d27d1 Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Mon, 23 Jun 2025 00:12:28 -0400 Subject: [PATCH 06/11] chore: update eslint rule docs configs --- .eslint-doc-generatorrc.js | 11 ++ README.md | 147 +++++++++--------- docs/rules/consistent-test-filename.md | 4 +- docs/rules/consistent-test-it.md | 4 +- docs/rules/consistent-vitest-vi.md | 4 +- docs/rules/expect-expect.md | 4 +- docs/rules/max-expects.md | 4 +- docs/rules/max-nested-describe.md | 4 +- docs/rules/no-alias-methods.md | 4 +- docs/rules/no-commented-out-tests.md | 4 +- docs/rules/no-conditional-expect.md | 4 +- docs/rules/no-conditional-in-test.md | 4 +- docs/rules/no-conditional-tests.md | 4 +- docs/rules/no-disabled-tests.md | 4 +- docs/rules/no-done-callback.md | 4 +- docs/rules/no-duplicate-hooks.md | 4 +- docs/rules/no-focused-tests.md | 4 +- docs/rules/no-hooks.md | 4 +- docs/rules/no-identical-title.md | 4 +- docs/rules/no-import-node-test.md | 4 +- docs/rules/no-importing-vitest-globals.md | 4 +- docs/rules/no-interpolation-in-snapshots.md | 4 +- docs/rules/no-large-snapshots.md | 4 +- docs/rules/no-mocks-import.md | 4 +- docs/rules/no-restricted-matchers.md | 4 +- docs/rules/no-restricted-vi-methods.md | 4 +- docs/rules/no-standalone-expect.md | 4 +- docs/rules/no-test-prefixes.md | 4 +- docs/rules/no-test-return-statement.md | 4 +- docs/rules/padding-around-after-all-blocks.md | 4 +- .../rules/padding-around-after-each-blocks.md | 4 +- docs/rules/padding-around-all.md | 4 +- .../rules/padding-around-before-all-blocks.md | 4 +- .../padding-around-before-each-blocks.md | 4 +- docs/rules/padding-around-describe-blocks.md | 4 +- docs/rules/padding-around-expect-groups.md | 4 +- docs/rules/padding-around-test-blocks.md | 4 +- docs/rules/prefer-called-times.md | 4 +- docs/rules/prefer-called-with.md | 4 +- docs/rules/prefer-comparison-matcher.md | 4 +- docs/rules/prefer-describe-function-title.md | 4 +- docs/rules/prefer-each.md | 4 +- docs/rules/prefer-equality-matcher.md | 4 +- docs/rules/prefer-expect-assertions.md | 4 +- docs/rules/prefer-expect-resolves.md | 4 +- docs/rules/prefer-hooks-in-order.md | 4 +- docs/rules/prefer-hooks-on-top.md | 4 +- docs/rules/prefer-importing-vitest-globals.md | 4 +- docs/rules/prefer-lowercase-title.md | 4 +- docs/rules/prefer-mock-promise-shorthand.md | 4 +- docs/rules/prefer-snapshot-hint.md | 4 +- docs/rules/prefer-spy-on.md | 4 +- docs/rules/prefer-strict-boolean-matchers.md | 4 +- docs/rules/prefer-strict-equal.md | 4 +- docs/rules/prefer-to-be-falsy.md | 4 +- docs/rules/prefer-to-be-object.md | 4 +- docs/rules/prefer-to-be-truthy.md | 4 +- docs/rules/prefer-to-be.md | 4 +- docs/rules/prefer-to-contain.md | 4 +- docs/rules/prefer-to-have-length.md | 4 +- docs/rules/prefer-todo.md | 4 +- docs/rules/prefer-vi-mocked.md | 4 +- docs/rules/require-hook.md | 4 +- ...l-test-context-for-concurrent-snapshots.md | 4 +- docs/rules/require-mock-type-parameters.md | 4 +- docs/rules/require-to-throw-message.md | 4 +- docs/rules/require-top-level-describe.md | 4 +- docs/rules/valid-describe-callback.md | 4 +- docs/rules/valid-expect-in-promise.md | 4 +- docs/rules/valid-expect.md | 4 +- docs/rules/valid-title.md | 4 +- package.json | 2 +- pnpm-lock.yaml | 20 +-- src/index.ts | 4 +- 74 files changed, 307 insertions(+), 153 deletions(-) create mode 100644 .eslint-doc-generatorrc.js diff --git a/.eslint-doc-generatorrc.js b/.eslint-doc-generatorrc.js new file mode 100644 index 00000000..3fce2c51 --- /dev/null +++ b/.eslint-doc-generatorrc.js @@ -0,0 +1,11 @@ +/** @type {import('eslint-doc-generator').GenerateOptions} */ +const config = { + configEmoji: [ + ['recommended', 'βœ…'], + ['legacy-recommended', 'β˜‘οΈ'], + ['legacy-all', 'πŸ’Ύ'], + ], + ruleDocTitleFormat: 'name', +} + +export default config diff --git a/README.md b/README.md index 54e315ab..b6eaa78d 100644 --- a/README.md +++ b/README.md @@ -143,82 +143,87 @@ export default [ +πŸ’Ό Configurations enabled in.\ +⚠️ Configurations set to warn in.\ +🚫 Configurations disabled in.\ +πŸ’Ύ Set in the `legacy-all` configuration.\ +β˜‘οΈ Set in the `legacy-recommended` configuration.\ πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\ πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).\ ❌ Deprecated. -| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | -| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :- | :- | :- | :- | -| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | | | | -| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | πŸ”§ | | | | -| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | πŸ”§ | | | | -| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | | | | | -| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | | | | -| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | | | | -| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | πŸ”§ | | | | -| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | | | | | -| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | | | | -| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | | | | -| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | | | | -| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | | | | -| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | πŸ’‘ | | ❌ | -| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | | | | -| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | πŸ”§ | | | | -| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | | | | -| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | πŸ”§ | | | | -| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | πŸ”§ | | | | -| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | πŸ”§ | | | | -| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | πŸ”§ | | | | -| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | | | | -| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from __mocks__ directory | | | | | -| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | | | | -| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | | | | -| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | | | | -| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | πŸ”§ | | | | -| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | | | | -| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | πŸ”§ | | | | -| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | πŸ”§ | | | | -| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | πŸ”§ | | | | -| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | πŸ”§ | | | | -| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | πŸ”§ | | | | -| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | πŸ”§ | | | | -| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | πŸ”§ | | | | -| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | πŸ”§ | | | | -| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | πŸ”§ | | | | -| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | πŸ”§ | | | | -| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | πŸ”§ | | | | -| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | πŸ”§ | | | | -| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | | | | -| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | πŸ’‘ | | | -| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | πŸ’‘ | | | -| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | πŸ”§ | | | | -| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | | | | -| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | | | | -| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | πŸ”§ | | | | -| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | πŸ”§ | | | | -| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | πŸ”§ | | | | -| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | | | | -| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | πŸ”§ | | | | -| [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 | πŸ”§ | | | | -| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | πŸ’‘ | | | -| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | πŸ”§ | | | | -| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | πŸ”§ | | | | -| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | πŸ”§ | | | | -| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | πŸ”§ | | | | -| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | πŸ”§ | | | | -| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | πŸ”§ | | | | -| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | πŸ”§ | | | | -| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | πŸ”§ | | πŸ’­ | | -| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | | | | -| [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 | | | | | -| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | πŸ”§ | | | | -| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | | | | -| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | | | | -| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | | | | | -| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | πŸ”§ | | | | -| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | | | | -| [valid-title](docs/rules/valid-title.md) | enforce valid titles | πŸ”§ | | | | +| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | +| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :- | :- | :- | :- | :- | :- | :- | +| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | πŸ’Ύ | | | | | | +| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | πŸ’Ύ | | πŸ”§ | | | | +| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | πŸ’Ύ | | πŸ”§ | | | | +| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | β˜‘οΈ | πŸ’Ύ | | | | | | +| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | πŸ’Ύ | | | | | | +| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | πŸ’Ύ | | | | | | +| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | πŸ’Ύ | | πŸ”§ | | | | +| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | β˜‘οΈ | πŸ’Ύ | | | | | | +| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | πŸ’Ύ | | | | | | +| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | πŸ’Ύ | | | | | | +| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | πŸ’Ύ | | | | | | +| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | πŸ’Ύ | | | | | | +| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | πŸ’Ύ | | | πŸ’‘ | | ❌ | +| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | πŸ’Ύ | | | | | | +| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | πŸ’Ύ | | πŸ”§ | | | | +| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | πŸ’Ύ | | | | | | +| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | β˜‘οΈ | πŸ’Ύ | | πŸ”§ | | | | +| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | β˜‘οΈ | πŸ’Ύ | | πŸ”§ | | | | +| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | πŸ’Ύ | πŸ”§ | | | | +| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | πŸ’Ύ | | πŸ”§ | | | | +| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | πŸ’Ύ | | | | | | +| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from __mocks__ directory | | πŸ’Ύ | | | | | | +| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | πŸ’Ύ | | | | | | +| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | πŸ’Ύ | | | | | | +| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | πŸ’Ύ | | | | | | +| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | πŸ’Ύ | | πŸ”§ | | | | +| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | πŸ’Ύ | | | | | | +| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | πŸ’Ύ | | πŸ”§ | | | | +| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | πŸ’Ύ | | πŸ”§ | | | | +| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | πŸ’Ύ | | πŸ”§ | | | | +| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | πŸ’Ύ | | πŸ”§ | | | | +| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | πŸ’Ύ | | πŸ”§ | | | | +| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | πŸ’Ύ | | πŸ”§ | | | | +| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | πŸ’Ύ | | πŸ”§ | | | | +| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | πŸ’Ύ | | | | | | +| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | πŸ’Ύ | | | πŸ’‘ | | | +| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | πŸ’Ύ | | | πŸ’‘ | | | +| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | πŸ’Ύ | | | | | | +| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | πŸ’Ύ | | | | | | +| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | πŸ’Ύ | | | | | | +| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | πŸ’Ύ | | πŸ”§ | | | | +| [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 | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | πŸ’Ύ | | | πŸ’‘ | | | +| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | πŸ’Ύ | πŸ”§ | | | | +| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | πŸ’Ύ | πŸ”§ | | | | +| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | πŸ’Ύ | | πŸ”§ | | | | +| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | πŸ’Ύ | | πŸ”§ | | πŸ’­ | | +| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | πŸ’Ύ | | | | | | +| [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 | β˜‘οΈ | πŸ’Ύ | | | | | | +| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | πŸ’Ύ | | πŸ”§ | | | | +| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | πŸ’Ύ | | | | | | +| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | πŸ’Ύ | | | | | | +| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | β˜‘οΈ | πŸ’Ύ | | | | | | +| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | β˜‘οΈ | πŸ’Ύ | | πŸ”§ | | | | +| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | πŸ’Ύ | | | | | | +| [valid-title](docs/rules/valid-title.md) | enforce valid titles | β˜‘οΈ | πŸ’Ύ | | πŸ”§ | | | | diff --git a/docs/rules/consistent-test-filename.md b/docs/rules/consistent-test-filename.md index 5d2d0944..900e0bcd 100644 --- a/docs/rules/consistent-test-filename.md +++ b/docs/rules/consistent-test-filename.md @@ -1,4 +1,6 @@ -# Require .spec test file pattern (`@vitest/consistent-test-filename`) +# consistent-test-filename + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index bb734948..189ea5e8 100644 --- a/docs/rules/consistent-test-it.md +++ b/docs/rules/consistent-test-it.md @@ -1,4 +1,6 @@ -# Enforce using test or it but not both (`@vitest/consistent-test-it`) +# consistent-test-it + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/consistent-vitest-vi.md b/docs/rules/consistent-vitest-vi.md index 687f1dc1..a5bc7dc7 100644 --- a/docs/rules/consistent-vitest-vi.md +++ b/docs/rules/consistent-vitest-vi.md @@ -1,4 +1,6 @@ -# Enforce using vitest or vi but not both (`@vitest/consistent-vitest-vi`) +# consistent-vitest-vi + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index c31cc599..6cacf38c 100644 --- a/docs/rules/expect-expect.md +++ b/docs/rules/expect-expect.md @@ -1,4 +1,6 @@ -# Enforce having expectation in test body (`@vitest/expect-expect`) +# expect-expect + +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/max-expects.md b/docs/rules/max-expects.md index de52fe38..b2cc857c 100644 --- a/docs/rules/max-expects.md +++ b/docs/rules/max-expects.md @@ -1,4 +1,6 @@ -# Enforce a maximum number of expect per test (`@vitest/max-expects`) +# max-expects + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/max-nested-describe.md b/docs/rules/max-nested-describe.md index c7dc8e81..65e67101 100644 --- a/docs/rules/max-nested-describe.md +++ b/docs/rules/max-nested-describe.md @@ -1,4 +1,6 @@ -# Require describe block to be less than set max value or default value (`@vitest/max-nested-describe`) +# max-nested-describe + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index 055a07a0..c55e8971 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -1,4 +1,6 @@ -# Disallow alias methods (`@vitest/no-alias-methods`) +# no-alias-methods + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-commented-out-tests.md b/docs/rules/no-commented-out-tests.md index c3f3a4ec..a3505190 100644 --- a/docs/rules/no-commented-out-tests.md +++ b/docs/rules/no-commented-out-tests.md @@ -1,4 +1,6 @@ -# Disallow commented out tests (`@vitest/no-commented-out-tests`) +# no-commented-out-tests + +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-conditional-expect.md b/docs/rules/no-conditional-expect.md index 33bc99dc..c6575a0d 100644 --- a/docs/rules/no-conditional-expect.md +++ b/docs/rules/no-conditional-expect.md @@ -1,4 +1,6 @@ -# Disallow conditional expects (`@vitest/no-conditional-expect`) +# no-conditional-expect + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-conditional-in-test.md b/docs/rules/no-conditional-in-test.md index fc175beb..aa4272e6 100644 --- a/docs/rules/no-conditional-in-test.md +++ b/docs/rules/no-conditional-in-test.md @@ -1,4 +1,6 @@ -# Disallow conditional tests (`@vitest/no-conditional-in-test`) +# no-conditional-in-test + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. ### Rule Details diff --git a/docs/rules/no-conditional-tests.md b/docs/rules/no-conditional-tests.md index 37fbd101..d2ab9f28 100644 --- a/docs/rules/no-conditional-tests.md +++ b/docs/rules/no-conditional-tests.md @@ -1,4 +1,6 @@ -# Disallow conditional tests (`@vitest/no-conditional-tests`) +# no-conditional-tests + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-disabled-tests.md b/docs/rules/no-disabled-tests.md index 6e075946..2ca263fa 100644 --- a/docs/rules/no-disabled-tests.md +++ b/docs/rules/no-disabled-tests.md @@ -1,4 +1,6 @@ -# Disallow disabled tests (`@vitest/no-disabled-tests`) +# no-disabled-tests + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-done-callback.md b/docs/rules/no-done-callback.md index c9c45751..94ec2528 100644 --- a/docs/rules/no-done-callback.md +++ b/docs/rules/no-done-callback.md @@ -1,7 +1,9 @@ -# Disallow using a callback in asynchronous tests and hooks (`@vitest/no-done-callback`) +# no-done-callback ❌ This rule is deprecated. +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. + πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index 1edd8b41..648a9fc4 100644 --- a/docs/rules/no-duplicate-hooks.md +++ b/docs/rules/no-duplicate-hooks.md @@ -1,4 +1,6 @@ -# Disallow duplicate hooks and teardown hooks (`@vitest/no-duplicate-hooks`) +# no-duplicate-hooks + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index 47f844ab..fa3dfafc 100644 --- a/docs/rules/no-focused-tests.md +++ b/docs/rules/no-focused-tests.md @@ -1,4 +1,6 @@ -# Disallow focused tests (`@vitest/no-focused-tests`) +# no-focused-tests + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index e34e8daf..fd276bcf 100644 --- a/docs/rules/no-hooks.md +++ b/docs/rules/no-hooks.md @@ -1,4 +1,6 @@ -# Disallow setup and teardown hooks (`@vitest/no-hooks`) +# no-hooks + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index 6a854c6a..22b532a3 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -1,4 +1,6 @@ -# Disallow identical titles (`@vitest/no-identical-title`) +# no-identical-title + +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-import-node-test.md b/docs/rules/no-import-node-test.md index 31a914b7..4f3dfcda 100644 --- a/docs/rules/no-import-node-test.md +++ b/docs/rules/no-import-node-test.md @@ -1,4 +1,6 @@ -# Disallow importing `node:test` (`@vitest/no-import-node-test`) +# no-import-node-test + +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-importing-vitest-globals.md b/docs/rules/no-importing-vitest-globals.md index 6765ebd2..848179fa 100644 --- a/docs/rules/no-importing-vitest-globals.md +++ b/docs/rules/no-importing-vitest-globals.md @@ -1,4 +1,6 @@ -# Disallow importing Vitest globals (`@vitest/no-importing-vitest-globals`) +# no-importing-vitest-globals + +🚫 This rule is _disabled_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-interpolation-in-snapshots.md b/docs/rules/no-interpolation-in-snapshots.md index 1c1cc4db..4ea3c1af 100644 --- a/docs/rules/no-interpolation-in-snapshots.md +++ b/docs/rules/no-interpolation-in-snapshots.md @@ -1,4 +1,6 @@ -# Disallow string interpolation in snapshots (`@vitest/no-interpolation-in-snapshots`) +# no-interpolation-in-snapshots + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index 2f1a2d55..93dcd87e 100644 --- a/docs/rules/no-large-snapshots.md +++ b/docs/rules/no-large-snapshots.md @@ -1,4 +1,6 @@ -# Disallow large snapshots (`@vitest/no-large-snapshots`) +# no-large-snapshots + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-mocks-import.md b/docs/rules/no-mocks-import.md index bedce17f..e20364cb 100644 --- a/docs/rules/no-mocks-import.md +++ b/docs/rules/no-mocks-import.md @@ -1,4 +1,6 @@ -# Disallow importing from __mocks__ directory (`@vitest/no-mocks-import`) +# no-mocks-import + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-restricted-matchers.md b/docs/rules/no-restricted-matchers.md index a8dca933..ad21858f 100644 --- a/docs/rules/no-restricted-matchers.md +++ b/docs/rules/no-restricted-matchers.md @@ -1,4 +1,6 @@ -# Disallow the use of certain matchers (`@vitest/no-restricted-matchers`) +# no-restricted-matchers + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-restricted-vi-methods.md b/docs/rules/no-restricted-vi-methods.md index 6c1e769c..b853b70e 100644 --- a/docs/rules/no-restricted-vi-methods.md +++ b/docs/rules/no-restricted-vi-methods.md @@ -1,4 +1,6 @@ -# Disallow specific `vi.` methods (`@vitest/no-restricted-vi-methods`) +# no-restricted-vi-methods + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-standalone-expect.md b/docs/rules/no-standalone-expect.md index 332159a3..d26ae2b4 100644 --- a/docs/rules/no-standalone-expect.md +++ b/docs/rules/no-standalone-expect.md @@ -1,4 +1,6 @@ -# Disallow using `expect` outside of `it` or `test` blocks (`@vitest/no-standalone-expect`) +# no-standalone-expect + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index a2555b63..405b1fa0 100644 --- a/docs/rules/no-test-prefixes.md +++ b/docs/rules/no-test-prefixes.md @@ -1,4 +1,6 @@ -# Disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` (`@vitest/no-test-prefixes`) +# no-test-prefixes + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-test-return-statement.md b/docs/rules/no-test-return-statement.md index 9c037485..fed725d1 100644 --- a/docs/rules/no-test-return-statement.md +++ b/docs/rules/no-test-return-statement.md @@ -1,4 +1,6 @@ -# Disallow return statements in tests (`@vitest/no-test-return-statement`) +# no-test-return-statement + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/padding-around-after-all-blocks.md b/docs/rules/padding-around-after-all-blocks.md index 7f024774..eeeddaec 100644 --- a/docs/rules/padding-around-after-all-blocks.md +++ b/docs/rules/padding-around-after-all-blocks.md @@ -1,4 +1,6 @@ -# Enforce padding around `afterAll` blocks (`@vitest/padding-around-after-all-blocks`) +# padding-around-after-all-blocks + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-after-each-blocks.md b/docs/rules/padding-around-after-each-blocks.md index cae1c868..b0b4de3c 100644 --- a/docs/rules/padding-around-after-each-blocks.md +++ b/docs/rules/padding-around-after-each-blocks.md @@ -1,4 +1,6 @@ -# Enforce padding around `afterEach` blocks (`@vitest/padding-around-after-each-blocks`) +# padding-around-after-each-blocks + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-all.md b/docs/rules/padding-around-all.md index e8684900..c7375195 100644 --- a/docs/rules/padding-around-all.md +++ b/docs/rules/padding-around-all.md @@ -1,4 +1,6 @@ -# Enforce padding around vitest functions (`@vitest/padding-around-all`) +# padding-around-all + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-all-blocks.md b/docs/rules/padding-around-before-all-blocks.md index 6c908f8d..dcf47878 100644 --- a/docs/rules/padding-around-before-all-blocks.md +++ b/docs/rules/padding-around-before-all-blocks.md @@ -1,4 +1,6 @@ -# Enforce padding around `beforeAll` blocks (`@vitest/padding-around-before-all-blocks`) +# padding-around-before-all-blocks + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-each-blocks.md b/docs/rules/padding-around-before-each-blocks.md index 8790f3d3..9b7d2d7d 100644 --- a/docs/rules/padding-around-before-each-blocks.md +++ b/docs/rules/padding-around-before-each-blocks.md @@ -1,4 +1,6 @@ -# Enforce padding around `beforeEach` blocks (`@vitest/padding-around-before-each-blocks`) +# padding-around-before-each-blocks + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-describe-blocks.md b/docs/rules/padding-around-describe-blocks.md index 6488981b..8232cd82 100644 --- a/docs/rules/padding-around-describe-blocks.md +++ b/docs/rules/padding-around-describe-blocks.md @@ -1,4 +1,6 @@ -# Enforce padding around `describe` blocks (`@vitest/padding-around-describe-blocks`) +# padding-around-describe-blocks + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-expect-groups.md b/docs/rules/padding-around-expect-groups.md index eb0288ed..ae37f544 100644 --- a/docs/rules/padding-around-expect-groups.md +++ b/docs/rules/padding-around-expect-groups.md @@ -1,4 +1,6 @@ -# Enforce padding around `expect` groups (`@vitest/padding-around-expect-groups`) +# padding-around-expect-groups + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-test-blocks.md b/docs/rules/padding-around-test-blocks.md index 7d94f5fd..6280f3ae 100644 --- a/docs/rules/padding-around-test-blocks.md +++ b/docs/rules/padding-around-test-blocks.md @@ -1,4 +1,6 @@ -# Enforce padding around `test` blocks (`@vitest/padding-around-test-blocks`) +# padding-around-test-blocks + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index 6ac0d54d..c33097e2 100644 --- a/docs/rules/prefer-called-times.md +++ b/docs/rules/prefer-called-times.md @@ -1,4 +1,6 @@ -# Enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` (`@vitest/prefer-called-times`) +# prefer-called-times + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-with.md b/docs/rules/prefer-called-with.md index 2fd56659..6f4e6a91 100644 --- a/docs/rules/prefer-called-with.md +++ b/docs/rules/prefer-called-with.md @@ -1,4 +1,6 @@ -# Enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` (`@vitest/prefer-called-with`) +# prefer-called-with + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-comparison-matcher.md b/docs/rules/prefer-comparison-matcher.md index d4b73214..5c93814b 100644 --- a/docs/rules/prefer-comparison-matcher.md +++ b/docs/rules/prefer-comparison-matcher.md @@ -1,4 +1,6 @@ -# Enforce using the built-in comparison matchers (`@vitest/prefer-comparison-matcher`) +# prefer-comparison-matcher + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-describe-function-title.md b/docs/rules/prefer-describe-function-title.md index cf251d66..e1a9f498 100644 --- a/docs/rules/prefer-describe-function-title.md +++ b/docs/rules/prefer-describe-function-title.md @@ -1,4 +1,6 @@ -# Enforce using a function as a describe title over an equivalent string (`@vitest/prefer-describe-function-title`) +# prefer-describe-function-title + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-each.md b/docs/rules/prefer-each.md index fce4161f..d2eff037 100644 --- a/docs/rules/prefer-each.md +++ b/docs/rules/prefer-each.md @@ -1,4 +1,6 @@ -# Enforce using `each` rather than manual loops (`@vitest/prefer-each`) +# prefer-each + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/prefer-equality-matcher.md b/docs/rules/prefer-equality-matcher.md index 4f8f3703..76f20f6a 100644 --- a/docs/rules/prefer-equality-matcher.md +++ b/docs/rules/prefer-equality-matcher.md @@ -1,4 +1,6 @@ -# Enforce using the built-in quality matchers (`@vitest/prefer-equality-matcher`) +# prefer-equality-matcher + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index a36ace2b..b7d321ed 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -1,4 +1,6 @@ -# Enforce using expect assertions instead of callbacks (`@vitest/prefer-expect-assertions`) +# prefer-expect-assertions + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-resolves.md b/docs/rules/prefer-expect-resolves.md index af577861..ec30bdfb 100644 --- a/docs/rules/prefer-expect-resolves.md +++ b/docs/rules/prefer-expect-resolves.md @@ -1,4 +1,6 @@ -# Enforce using `expect().resolves` over `expect(await ...)` syntax (`@vitest/prefer-expect-resolves`) +# prefer-expect-resolves + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-hooks-in-order.md b/docs/rules/prefer-hooks-in-order.md index daa3c960..f772207e 100644 --- a/docs/rules/prefer-hooks-in-order.md +++ b/docs/rules/prefer-hooks-in-order.md @@ -1,4 +1,6 @@ -# Enforce having hooks in consistent order (`@vitest/prefer-hooks-in-order`) +# prefer-hooks-in-order + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index 11cfb228..84ac455d 100644 --- a/docs/rules/prefer-hooks-on-top.md +++ b/docs/rules/prefer-hooks-on-top.md @@ -1,4 +1,6 @@ -# Enforce having hooks before any test cases (`@vitest/prefer-hooks-on-top`) +# prefer-hooks-on-top + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. ```ts diff --git a/docs/rules/prefer-importing-vitest-globals.md b/docs/rules/prefer-importing-vitest-globals.md index a8398c2d..5f63f678 100644 --- a/docs/rules/prefer-importing-vitest-globals.md +++ b/docs/rules/prefer-importing-vitest-globals.md @@ -1,4 +1,6 @@ -# Enforce importing Vitest globals (`@vitest/prefer-importing-vitest-globals`) +# prefer-importing-vitest-globals + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-lowercase-title.md b/docs/rules/prefer-lowercase-title.md index a2e3f79f..2c88f862 100644 --- a/docs/rules/prefer-lowercase-title.md +++ b/docs/rules/prefer-lowercase-title.md @@ -1,4 +1,6 @@ -# Enforce lowercase titles (`@vitest/prefer-lowercase-title`) +# prefer-lowercase-title + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-mock-promise-shorthand.md b/docs/rules/prefer-mock-promise-shorthand.md index aba9aea0..4ce00659 100644 --- a/docs/rules/prefer-mock-promise-shorthand.md +++ b/docs/rules/prefer-mock-promise-shorthand.md @@ -1,4 +1,6 @@ -# Enforce mock resolved/rejected shorthands for promises (`@vitest/prefer-mock-promise-shorthand`) +# prefer-mock-promise-shorthand + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-snapshot-hint.md b/docs/rules/prefer-snapshot-hint.md index 61a7ce6c..c1fbd594 100644 --- a/docs/rules/prefer-snapshot-hint.md +++ b/docs/rules/prefer-snapshot-hint.md @@ -1,4 +1,6 @@ -# Enforce including a hint with external snapshots (`@vitest/prefer-snapshot-hint`) +# prefer-snapshot-hint + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index ed3099af..b372a189 100644 --- a/docs/rules/prefer-spy-on.md +++ b/docs/rules/prefer-spy-on.md @@ -1,4 +1,6 @@ -# Enforce using `vi.spyOn` (`@vitest/prefer-spy-on`) +# prefer-spy-on + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-boolean-matchers.md b/docs/rules/prefer-strict-boolean-matchers.md index 47e3bfde..99e0d5f1 100644 --- a/docs/rules/prefer-strict-boolean-matchers.md +++ b/docs/rules/prefer-strict-boolean-matchers.md @@ -1,4 +1,6 @@ -# Enforce using `toBe(true)` and `toBe(false)` over matchers that coerce types to boolean (`@vitest/prefer-strict-boolean-matchers`) +# prefer-strict-boolean-matchers + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index 5f204a27..9fa1ade5 100644 --- a/docs/rules/prefer-strict-equal.md +++ b/docs/rules/prefer-strict-equal.md @@ -1,4 +1,6 @@ -# Enforce strict equal over equal (`@vitest/prefer-strict-equal`) +# prefer-strict-equal + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-to-be-falsy.md b/docs/rules/prefer-to-be-falsy.md index 9c72dbb9..2b8c47bd 100644 --- a/docs/rules/prefer-to-be-falsy.md +++ b/docs/rules/prefer-to-be-falsy.md @@ -1,4 +1,6 @@ -# Enforce using toBeFalsy() (`@vitest/prefer-to-be-falsy`) +# prefer-to-be-falsy + +🚫 This rule is _disabled_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-object.md b/docs/rules/prefer-to-be-object.md index 3d8dc484..1480bb80 100644 --- a/docs/rules/prefer-to-be-object.md +++ b/docs/rules/prefer-to-be-object.md @@ -1,4 +1,6 @@ -# Enforce using toBeObject() (`@vitest/prefer-to-be-object`) +# prefer-to-be-object + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-truthy.md b/docs/rules/prefer-to-be-truthy.md index de2e39a2..5830e50c 100644 --- a/docs/rules/prefer-to-be-truthy.md +++ b/docs/rules/prefer-to-be-truthy.md @@ -1,4 +1,6 @@ -# Enforce using `toBeTruthy` (`@vitest/prefer-to-be-truthy`) +# prefer-to-be-truthy + +🚫 This rule is _disabled_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be.md b/docs/rules/prefer-to-be.md index 2a07a0f4..d7d45d87 100644 --- a/docs/rules/prefer-to-be.md +++ b/docs/rules/prefer-to-be.md @@ -1,4 +1,6 @@ -# Enforce using toBe() (`@vitest/prefer-to-be`) +# prefer-to-be + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index 6d482243..2a31259d 100644 --- a/docs/rules/prefer-to-contain.md +++ b/docs/rules/prefer-to-contain.md @@ -1,4 +1,6 @@ -# Enforce using toContain() (`@vitest/prefer-to-contain`) +# prefer-to-contain + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index cc371c1b..38432a46 100644 --- a/docs/rules/prefer-to-have-length.md +++ b/docs/rules/prefer-to-have-length.md @@ -1,4 +1,6 @@ -# Enforce using toHaveLength() (`@vitest/prefer-to-have-length`) +# prefer-to-have-length + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index b338de3b..f74ea6b0 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -1,4 +1,6 @@ -# Enforce using `test.todo` (`@vitest/prefer-todo`) +# prefer-todo + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-vi-mocked.md b/docs/rules/prefer-vi-mocked.md index fedf8dd1..31e0c72c 100644 --- a/docs/rules/prefer-vi-mocked.md +++ b/docs/rules/prefer-vi-mocked.md @@ -1,4 +1,6 @@ -# Require `vi.mocked()` over `fn as Mock` (`@vitest/prefer-vi-mocked`) +# prefer-vi-mocked + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-hook.md b/docs/rules/require-hook.md index 88fd1f7f..1e28fc6a 100644 --- a/docs/rules/require-hook.md +++ b/docs/rules/require-hook.md @@ -1,4 +1,6 @@ -# Require setup and teardown to be within a hook (`@vitest/require-hook`) +# require-hook + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/require-local-test-context-for-concurrent-snapshots.md b/docs/rules/require-local-test-context-for-concurrent-snapshots.md index cd645195..e6c26ac9 100644 --- a/docs/rules/require-local-test-context-for-concurrent-snapshots.md +++ b/docs/rules/require-local-test-context-for-concurrent-snapshots.md @@ -1,4 +1,6 @@ -# Require local Test Context for concurrent snapshot tests (`@vitest/require-local-test-context-for-concurrent-snapshots`) +# require-local-test-context-for-concurrent-snapshots + +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/require-mock-type-parameters.md b/docs/rules/require-mock-type-parameters.md index 01e6605b..598a3c2a 100644 --- a/docs/rules/require-mock-type-parameters.md +++ b/docs/rules/require-mock-type-parameters.md @@ -1,4 +1,6 @@ -# Enforce using type parameters with vitest mock functions (`@vitest/require-mock-type-parameters`) +# require-mock-type-parameters + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index ec90c94d..68bca3b1 100644 --- a/docs/rules/require-to-throw-message.md +++ b/docs/rules/require-to-throw-message.md @@ -1,4 +1,6 @@ -# Require toThrow() to be called with an error message (`@vitest/require-to-throw-message`) +# require-to-throw-message + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index 8a324c58..84632692 100644 --- a/docs/rules/require-top-level-describe.md +++ b/docs/rules/require-top-level-describe.md @@ -1,4 +1,6 @@ -# Enforce that all tests are in a top-level describe (`@vitest/require-top-level-describe`) +# require-top-level-describe + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/valid-describe-callback.md b/docs/rules/valid-describe-callback.md index db5ecea4..08382893 100644 --- a/docs/rules/valid-describe-callback.md +++ b/docs/rules/valid-describe-callback.md @@ -1,4 +1,6 @@ -# Enforce valid describe callback (`@vitest/valid-describe-callback`) +# valid-describe-callback + +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index addaf946..b5e959df 100644 --- a/docs/rules/valid-expect-in-promise.md +++ b/docs/rules/valid-expect-in-promise.md @@ -1,4 +1,6 @@ -# Require promises that have expectations in their chain to be valid (`@vitest/valid-expect-in-promise`) +# valid-expect-in-promise + +⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index 36a5ab1c..ac634999 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -1,4 +1,6 @@ -# Enforce valid `expect()` usage (`@vitest/valid-expect`) +# valid-expect + +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index c70a7eca..49affb2d 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -1,4 +1,6 @@ -# Enforce valid titles (`@vitest/valid-title`) +# valid-title + +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/package.json b/package.json index 3bc071e3..0610e41b 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "concurrently": "^9.1.2", "eslint": "^9.20.0", "eslint-config-prettier": "^10.1.5", - "eslint-doc-generator": "^2.0.2", + "eslint-doc-generator": "^2.2.2", "eslint-plugin-eslint-plugin": "^6.4.0", "eslint-remote-tester": "^4.0.1", "eslint-remote-tester-repositories": "^2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08851983..d0b7fbb4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,8 +49,8 @@ importers: specifier: ^10.1.5 version: 10.1.5(eslint@9.20.0(jiti@2.4.2)) eslint-doc-generator: - specifier: ^2.0.2 - version: 2.0.2(eslint@9.20.0(jiti@2.4.2))(typescript@5.7.3) + specifier: ^2.2.2 + version: 2.2.2(eslint@9.20.0(jiti@2.4.2))(typescript@5.7.3) eslint-plugin-eslint-plugin: specifier: ^6.4.0 version: 6.4.0(eslint@9.20.0(jiti@2.4.2)) @@ -1301,9 +1301,9 @@ packages: resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} engines: {node: '>=16'} - commander@12.1.0: - resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} - engines: {node: '>=18'} + commander@14.0.0: + resolution: {integrity: sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==} + engines: {node: '>=20'} commander@7.2.0: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} @@ -1522,8 +1522,8 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-doc-generator@2.0.2: - resolution: {integrity: sha512-zdPXjnOKuxDf2Wn66aV86IvltboiNDBTgzYZKUmpGEx83anJG2ubptgvajfKhTidfL8QEfDcy9ha4M1uC0HwoQ==} + eslint-doc-generator@2.2.2: + resolution: {integrity: sha512-LBr0Nz1AZnkifkOMyE0sfx+IvS/V+TK1Sp8fCYDdk4Eb5gZCpEcK4t/ImT23oJAwso26rkHzBCRMrd/bc7bddQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=22.0.0} hasBin: true peerDependencies: @@ -3725,7 +3725,7 @@ snapshots: commander@11.1.0: {} - commander@12.1.0: {} + commander@14.0.0: {} commander@7.2.0: {} @@ -4028,12 +4028,12 @@ snapshots: dependencies: eslint: 9.20.0(jiti@2.4.2) - eslint-doc-generator@2.0.2(eslint@9.20.0(jiti@2.4.2))(typescript@5.7.3): + eslint-doc-generator@2.2.2(eslint@9.20.0(jiti@2.4.2))(typescript@5.7.3): dependencies: '@typescript-eslint/utils': 8.24.1(eslint@9.20.0(jiti@2.4.2))(typescript@5.7.3) ajv: 8.13.0 change-case: 5.4.4 - commander: 12.1.0 + commander: 14.0.0 cosmiconfig: 9.0.0(typescript@5.7.3) deepmerge: 4.3.1 dot-prop: 9.0.0 diff --git a/src/index.ts b/src/index.ts index 7487f92c..30098459 100644 --- a/src/index.ts +++ b/src/index.ts @@ -274,8 +274,8 @@ const plugin = { }, }, configs: { - //'legacy-recommended': createConfigLegacy(recommended), - //'legacy-all': createConfigLegacy(allRules), + 'legacy-recommended': createConfigLegacy(recommended), + 'legacy-all': createConfigLegacy(allRules), recommended: { name: '@vitest/recommended', plugins: { From 2918d7a38029a21dae5606868679fb98f1b836b6 Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Mon, 23 Jun 2025 00:18:28 -0400 Subject: [PATCH 07/11] chore: update eslint rule docs configs --- .eslint-doc-generatorrc.js | 2 +- README.md | 140 +++++++++--------- docs/rules/consistent-test-filename.md | 2 +- docs/rules/consistent-test-it.md | 2 +- docs/rules/consistent-vitest-vi.md | 2 +- docs/rules/expect-expect.md | 2 +- docs/rules/max-expects.md | 2 +- docs/rules/max-nested-describe.md | 2 +- docs/rules/no-alias-methods.md | 2 +- docs/rules/no-commented-out-tests.md | 2 +- docs/rules/no-conditional-expect.md | 2 +- docs/rules/no-conditional-in-test.md | 2 +- docs/rules/no-conditional-tests.md | 2 +- docs/rules/no-disabled-tests.md | 2 +- docs/rules/no-done-callback.md | 2 +- docs/rules/no-duplicate-hooks.md | 2 +- docs/rules/no-focused-tests.md | 2 +- docs/rules/no-hooks.md | 2 +- docs/rules/no-identical-title.md | 2 +- docs/rules/no-import-node-test.md | 2 +- docs/rules/no-importing-vitest-globals.md | 2 +- docs/rules/no-interpolation-in-snapshots.md | 2 +- docs/rules/no-large-snapshots.md | 2 +- docs/rules/no-mocks-import.md | 2 +- docs/rules/no-restricted-matchers.md | 2 +- docs/rules/no-restricted-vi-methods.md | 2 +- docs/rules/no-standalone-expect.md | 2 +- docs/rules/no-test-prefixes.md | 2 +- docs/rules/no-test-return-statement.md | 2 +- docs/rules/padding-around-after-all-blocks.md | 2 +- .../rules/padding-around-after-each-blocks.md | 2 +- docs/rules/padding-around-all.md | 2 +- .../rules/padding-around-before-all-blocks.md | 2 +- .../padding-around-before-each-blocks.md | 2 +- docs/rules/padding-around-describe-blocks.md | 2 +- docs/rules/padding-around-expect-groups.md | 2 +- docs/rules/padding-around-test-blocks.md | 2 +- docs/rules/prefer-called-times.md | 2 +- docs/rules/prefer-called-with.md | 2 +- docs/rules/prefer-comparison-matcher.md | 2 +- docs/rules/prefer-describe-function-title.md | 2 +- docs/rules/prefer-each.md | 2 +- docs/rules/prefer-equality-matcher.md | 2 +- docs/rules/prefer-expect-assertions.md | 2 +- docs/rules/prefer-expect-resolves.md | 2 +- docs/rules/prefer-hooks-in-order.md | 2 +- docs/rules/prefer-hooks-on-top.md | 2 +- docs/rules/prefer-importing-vitest-globals.md | 2 +- docs/rules/prefer-lowercase-title.md | 2 +- docs/rules/prefer-mock-promise-shorthand.md | 2 +- docs/rules/prefer-snapshot-hint.md | 2 +- docs/rules/prefer-spy-on.md | 2 +- docs/rules/prefer-strict-boolean-matchers.md | 2 +- docs/rules/prefer-strict-equal.md | 2 +- docs/rules/prefer-to-be-falsy.md | 2 +- docs/rules/prefer-to-be-object.md | 2 +- docs/rules/prefer-to-be-truthy.md | 2 +- docs/rules/prefer-to-be.md | 2 +- docs/rules/prefer-to-contain.md | 2 +- docs/rules/prefer-to-have-length.md | 2 +- docs/rules/prefer-todo.md | 2 +- docs/rules/prefer-vi-mocked.md | 2 +- docs/rules/require-hook.md | 2 +- ...l-test-context-for-concurrent-snapshots.md | 2 +- docs/rules/require-mock-type-parameters.md | 2 +- docs/rules/require-to-throw-message.md | 2 +- docs/rules/require-top-level-describe.md | 2 +- docs/rules/valid-describe-callback.md | 2 +- docs/rules/valid-expect-in-promise.md | 2 +- docs/rules/valid-expect.md | 2 +- docs/rules/valid-title.md | 2 +- src/index.ts | 6 +- 72 files changed, 143 insertions(+), 143 deletions(-) diff --git a/.eslint-doc-generatorrc.js b/.eslint-doc-generatorrc.js index 3fce2c51..3a44d1ed 100644 --- a/.eslint-doc-generatorrc.js +++ b/.eslint-doc-generatorrc.js @@ -3,7 +3,7 @@ const config = { configEmoji: [ ['recommended', 'βœ…'], ['legacy-recommended', 'β˜‘οΈ'], - ['legacy-all', 'πŸ’Ύ'], + ['legacy-all', '🌍'], ], ruleDocTitleFormat: 'name', } diff --git a/README.md b/README.md index b6eaa78d..79ac4c85 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ export default [ πŸ’Ό Configurations enabled in.\ ⚠️ Configurations set to warn in.\ 🚫 Configurations disabled in.\ -πŸ’Ύ Set in the `legacy-all` configuration.\ +🌍 Set in the `legacy-all` configuration.\ β˜‘οΈ Set in the `legacy-recommended` configuration.\ πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\ @@ -155,75 +155,75 @@ export default [ | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | | :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :- | :- | :- | :- | :- | :- | :- | -| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | πŸ’Ύ | | | | | | -| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | πŸ’Ύ | | πŸ”§ | | | | -| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | πŸ’Ύ | | πŸ”§ | | | | -| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | β˜‘οΈ | πŸ’Ύ | | | | | | -| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | πŸ’Ύ | | | | | | -| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | πŸ’Ύ | | | | | | -| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | πŸ’Ύ | | πŸ”§ | | | | -| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | β˜‘οΈ | πŸ’Ύ | | | | | | -| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | πŸ’Ύ | | | | | | -| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | πŸ’Ύ | | | | | | -| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | πŸ’Ύ | | | | | | -| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | πŸ’Ύ | | | | | | -| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | πŸ’Ύ | | | πŸ’‘ | | ❌ | -| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | πŸ’Ύ | | | | | | -| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | πŸ’Ύ | | πŸ”§ | | | | -| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | πŸ’Ύ | | | | | | -| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | β˜‘οΈ | πŸ’Ύ | | πŸ”§ | | | | -| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | β˜‘οΈ | πŸ’Ύ | | πŸ”§ | | | | -| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | πŸ’Ύ | πŸ”§ | | | | -| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | πŸ’Ύ | | πŸ”§ | | | | -| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | πŸ’Ύ | | | | | | -| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from __mocks__ directory | | πŸ’Ύ | | | | | | -| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | πŸ’Ύ | | | | | | -| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | πŸ’Ύ | | | | | | -| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | πŸ’Ύ | | | | | | -| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | πŸ’Ύ | | πŸ”§ | | | | -| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | πŸ’Ύ | | | | | | -| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | πŸ’Ύ | | πŸ”§ | | | | -| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | πŸ’Ύ | | πŸ”§ | | | | -| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | πŸ’Ύ | | πŸ”§ | | | | -| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | πŸ’Ύ | | πŸ”§ | | | | -| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | πŸ’Ύ | | πŸ”§ | | | | -| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | πŸ’Ύ | | πŸ”§ | | | | -| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | πŸ’Ύ | | πŸ”§ | | | | -| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | πŸ’Ύ | | | | | | -| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | πŸ’Ύ | | | πŸ’‘ | | | -| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | πŸ’Ύ | | | πŸ’‘ | | | -| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | πŸ’Ύ | | | | | | -| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | πŸ’Ύ | | | | | | -| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | πŸ’Ύ | | | | | | -| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | πŸ’Ύ | | πŸ”§ | | | | -| [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 | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | πŸ’Ύ | | | πŸ’‘ | | | -| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | πŸ’Ύ | πŸ”§ | | | | -| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | πŸ’Ύ | πŸ”§ | | | | -| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | πŸ’Ύ | | πŸ”§ | | | | -| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | πŸ’Ύ | | πŸ”§ | | πŸ’­ | | -| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | πŸ’Ύ | | | | | | -| [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 | β˜‘οΈ | πŸ’Ύ | | | | | | -| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | πŸ’Ύ | | πŸ”§ | | | | -| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | πŸ’Ύ | | | | | | -| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | πŸ’Ύ | | | | | | -| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | β˜‘οΈ | πŸ’Ύ | | | | | | -| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | β˜‘οΈ | πŸ’Ύ | | πŸ”§ | | | | -| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | πŸ’Ύ | | | | | | -| [valid-title](docs/rules/valid-title.md) | enforce valid titles | β˜‘οΈ | πŸ’Ύ | | πŸ”§ | | | | +| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | 🌍 | | | | | | +| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌍 | | πŸ”§ | | | | +| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌍 | | πŸ”§ | | | | +| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | β˜‘οΈ | 🌍 | | | | | | +| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | 🌍 | | | | | | +| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | 🌍 | | | | | | +| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | 🌍 | | πŸ”§ | | | | +| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | β˜‘οΈ | 🌍 | | | | | | +| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | 🌍 | | | | | | +| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | 🌍 | | | | | | +| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | 🌍 | | | | | | +| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | 🌍 | | | | | | +| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | 🌍 | | | πŸ’‘ | | ❌ | +| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | 🌍 | | | | | | +| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | 🌍 | | πŸ”§ | | | | +| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | 🌍 | | | | | | +| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | β˜‘οΈ | 🌍 | | πŸ”§ | | | | +| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | β˜‘οΈ | 🌍 | | πŸ”§ | | | | +| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | 🌍 | πŸ”§ | | | | +| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | 🌍 | | πŸ”§ | | | | +| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | 🌍 | | | | | | +| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from __mocks__ directory | | 🌍 | | | | | | +| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | 🌍 | | | | | | +| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | 🌍 | | | | | | +| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌍 | | | | | | +| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | 🌍 | | πŸ”§ | | | | +| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌍 | | | | | | +| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | 🌍 | | πŸ”§ | | | | +| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | 🌍 | | πŸ”§ | | | | +| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | 🌍 | | πŸ”§ | | | | +| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | 🌍 | | πŸ”§ | | | | +| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌍 | | πŸ”§ | | | | +| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌍 | | πŸ”§ | | | | +| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | 🌍 | | πŸ”§ | | | | +| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌍 | | | | | | +| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | 🌍 | | | πŸ’‘ | | | +| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | 🌍 | | | πŸ’‘ | | | +| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | 🌍 | | πŸ”§ | | | | +| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌍 | | | | | | +| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌍 | | | | | | +| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌍 | | πŸ”§ | | | | +| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌍 | | πŸ”§ | | | | +| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌍 | | πŸ”§ | | | | +| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | 🌍 | | | | | | +| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | 🌍 | | πŸ”§ | | | | +| [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 | | 🌍 | | πŸ”§ | | | | +| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | 🌍 | | | πŸ’‘ | | | +| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | 🌍 | | πŸ”§ | | | | +| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | 🌍 | πŸ”§ | | | | +| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | 🌍 | | πŸ”§ | | | | +| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | 🌍 | πŸ”§ | | | | +| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | 🌍 | | πŸ”§ | | | | +| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | 🌍 | | πŸ”§ | | | | +| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | 🌍 | | πŸ”§ | | | | +| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | 🌍 | | πŸ”§ | | πŸ’­ | | +| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | 🌍 | | | | | | +| [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 | β˜‘οΈ | 🌍 | | | | | | +| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | 🌍 | | πŸ”§ | | | | +| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | 🌍 | | | | | | +| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | 🌍 | | | | | | +| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | β˜‘οΈ | 🌍 | | | | | | +| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | β˜‘οΈ | 🌍 | | πŸ”§ | | | | +| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | 🌍 | | | | | | +| [valid-title](docs/rules/valid-title.md) | enforce valid titles | β˜‘οΈ | 🌍 | | πŸ”§ | | | | diff --git a/docs/rules/consistent-test-filename.md b/docs/rules/consistent-test-filename.md index 900e0bcd..e8fc10b0 100644 --- a/docs/rules/consistent-test-filename.md +++ b/docs/rules/consistent-test-filename.md @@ -1,6 +1,6 @@ # consistent-test-filename -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index 189ea5e8..70233e78 100644 --- a/docs/rules/consistent-test-it.md +++ b/docs/rules/consistent-test-it.md @@ -1,6 +1,6 @@ # consistent-test-it -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/consistent-vitest-vi.md b/docs/rules/consistent-vitest-vi.md index a5bc7dc7..15d4c3b1 100644 --- a/docs/rules/consistent-vitest-vi.md +++ b/docs/rules/consistent-vitest-vi.md @@ -1,6 +1,6 @@ # consistent-vitest-vi -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index 6cacf38c..2fb4bfe6 100644 --- a/docs/rules/expect-expect.md +++ b/docs/rules/expect-expect.md @@ -1,6 +1,6 @@ # expect-expect -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/max-expects.md b/docs/rules/max-expects.md index b2cc857c..f921469b 100644 --- a/docs/rules/max-expects.md +++ b/docs/rules/max-expects.md @@ -1,6 +1,6 @@ # max-expects -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/max-nested-describe.md b/docs/rules/max-nested-describe.md index 65e67101..2cc29613 100644 --- a/docs/rules/max-nested-describe.md +++ b/docs/rules/max-nested-describe.md @@ -1,6 +1,6 @@ # max-nested-describe -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index c55e8971..c608d784 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -1,6 +1,6 @@ # no-alias-methods -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-commented-out-tests.md b/docs/rules/no-commented-out-tests.md index a3505190..0d3e3042 100644 --- a/docs/rules/no-commented-out-tests.md +++ b/docs/rules/no-commented-out-tests.md @@ -1,6 +1,6 @@ # no-commented-out-tests -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-conditional-expect.md b/docs/rules/no-conditional-expect.md index c6575a0d..c97342af 100644 --- a/docs/rules/no-conditional-expect.md +++ b/docs/rules/no-conditional-expect.md @@ -1,6 +1,6 @@ # no-conditional-expect -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-conditional-in-test.md b/docs/rules/no-conditional-in-test.md index aa4272e6..54762858 100644 --- a/docs/rules/no-conditional-in-test.md +++ b/docs/rules/no-conditional-in-test.md @@ -1,6 +1,6 @@ # no-conditional-in-test -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. ### Rule Details diff --git a/docs/rules/no-conditional-tests.md b/docs/rules/no-conditional-tests.md index d2ab9f28..28508821 100644 --- a/docs/rules/no-conditional-tests.md +++ b/docs/rules/no-conditional-tests.md @@ -1,6 +1,6 @@ # no-conditional-tests -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-disabled-tests.md b/docs/rules/no-disabled-tests.md index 2ca263fa..7a86ed5b 100644 --- a/docs/rules/no-disabled-tests.md +++ b/docs/rules/no-disabled-tests.md @@ -1,6 +1,6 @@ # no-disabled-tests -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-done-callback.md b/docs/rules/no-done-callback.md index 94ec2528..12752e2c 100644 --- a/docs/rules/no-done-callback.md +++ b/docs/rules/no-done-callback.md @@ -2,7 +2,7 @@ ❌ This rule is deprecated. -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index 648a9fc4..03163ef0 100644 --- a/docs/rules/no-duplicate-hooks.md +++ b/docs/rules/no-duplicate-hooks.md @@ -1,6 +1,6 @@ # no-duplicate-hooks -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index fa3dfafc..48fc88ff 100644 --- a/docs/rules/no-focused-tests.md +++ b/docs/rules/no-focused-tests.md @@ -1,6 +1,6 @@ # no-focused-tests -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index fd276bcf..c86e62d2 100644 --- a/docs/rules/no-hooks.md +++ b/docs/rules/no-hooks.md @@ -1,6 +1,6 @@ # no-hooks -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index 22b532a3..25e99b9f 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -1,6 +1,6 @@ # no-identical-title -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-import-node-test.md b/docs/rules/no-import-node-test.md index 4f3dfcda..480baab7 100644 --- a/docs/rules/no-import-node-test.md +++ b/docs/rules/no-import-node-test.md @@ -1,6 +1,6 @@ # no-import-node-test -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-importing-vitest-globals.md b/docs/rules/no-importing-vitest-globals.md index 848179fa..7c86ac8b 100644 --- a/docs/rules/no-importing-vitest-globals.md +++ b/docs/rules/no-importing-vitest-globals.md @@ -1,6 +1,6 @@ # no-importing-vitest-globals -🚫 This rule is _disabled_ in the πŸ’Ύ `legacy-all` config. +🚫 This rule is _disabled_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-interpolation-in-snapshots.md b/docs/rules/no-interpolation-in-snapshots.md index 4ea3c1af..db99bef0 100644 --- a/docs/rules/no-interpolation-in-snapshots.md +++ b/docs/rules/no-interpolation-in-snapshots.md @@ -1,6 +1,6 @@ # no-interpolation-in-snapshots -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index 93dcd87e..e156f1bf 100644 --- a/docs/rules/no-large-snapshots.md +++ b/docs/rules/no-large-snapshots.md @@ -1,6 +1,6 @@ # no-large-snapshots -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-mocks-import.md b/docs/rules/no-mocks-import.md index e20364cb..e9aa1f58 100644 --- a/docs/rules/no-mocks-import.md +++ b/docs/rules/no-mocks-import.md @@ -1,6 +1,6 @@ # no-mocks-import -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-restricted-matchers.md b/docs/rules/no-restricted-matchers.md index ad21858f..439380b4 100644 --- a/docs/rules/no-restricted-matchers.md +++ b/docs/rules/no-restricted-matchers.md @@ -1,6 +1,6 @@ # no-restricted-matchers -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-restricted-vi-methods.md b/docs/rules/no-restricted-vi-methods.md index b853b70e..cb365139 100644 --- a/docs/rules/no-restricted-vi-methods.md +++ b/docs/rules/no-restricted-vi-methods.md @@ -1,6 +1,6 @@ # no-restricted-vi-methods -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-standalone-expect.md b/docs/rules/no-standalone-expect.md index d26ae2b4..e1d4b828 100644 --- a/docs/rules/no-standalone-expect.md +++ b/docs/rules/no-standalone-expect.md @@ -1,6 +1,6 @@ # no-standalone-expect -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index 405b1fa0..309b7ab3 100644 --- a/docs/rules/no-test-prefixes.md +++ b/docs/rules/no-test-prefixes.md @@ -1,6 +1,6 @@ # no-test-prefixes -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-test-return-statement.md b/docs/rules/no-test-return-statement.md index fed725d1..706701b7 100644 --- a/docs/rules/no-test-return-statement.md +++ b/docs/rules/no-test-return-statement.md @@ -1,6 +1,6 @@ # no-test-return-statement -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/padding-around-after-all-blocks.md b/docs/rules/padding-around-after-all-blocks.md index eeeddaec..87d30633 100644 --- a/docs/rules/padding-around-after-all-blocks.md +++ b/docs/rules/padding-around-after-all-blocks.md @@ -1,6 +1,6 @@ # padding-around-after-all-blocks -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-after-each-blocks.md b/docs/rules/padding-around-after-each-blocks.md index b0b4de3c..cca69236 100644 --- a/docs/rules/padding-around-after-each-blocks.md +++ b/docs/rules/padding-around-after-each-blocks.md @@ -1,6 +1,6 @@ # padding-around-after-each-blocks -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-all.md b/docs/rules/padding-around-all.md index c7375195..6e19182a 100644 --- a/docs/rules/padding-around-all.md +++ b/docs/rules/padding-around-all.md @@ -1,6 +1,6 @@ # padding-around-all -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-all-blocks.md b/docs/rules/padding-around-before-all-blocks.md index dcf47878..02639944 100644 --- a/docs/rules/padding-around-before-all-blocks.md +++ b/docs/rules/padding-around-before-all-blocks.md @@ -1,6 +1,6 @@ # padding-around-before-all-blocks -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-each-blocks.md b/docs/rules/padding-around-before-each-blocks.md index 9b7d2d7d..51062bf6 100644 --- a/docs/rules/padding-around-before-each-blocks.md +++ b/docs/rules/padding-around-before-each-blocks.md @@ -1,6 +1,6 @@ # padding-around-before-each-blocks -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-describe-blocks.md b/docs/rules/padding-around-describe-blocks.md index 8232cd82..5a20f8c0 100644 --- a/docs/rules/padding-around-describe-blocks.md +++ b/docs/rules/padding-around-describe-blocks.md @@ -1,6 +1,6 @@ # padding-around-describe-blocks -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-expect-groups.md b/docs/rules/padding-around-expect-groups.md index ae37f544..85c4c404 100644 --- a/docs/rules/padding-around-expect-groups.md +++ b/docs/rules/padding-around-expect-groups.md @@ -1,6 +1,6 @@ # padding-around-expect-groups -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-test-blocks.md b/docs/rules/padding-around-test-blocks.md index 6280f3ae..e9bf26de 100644 --- a/docs/rules/padding-around-test-blocks.md +++ b/docs/rules/padding-around-test-blocks.md @@ -1,6 +1,6 @@ # padding-around-test-blocks -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index c33097e2..67fcd19c 100644 --- a/docs/rules/prefer-called-times.md +++ b/docs/rules/prefer-called-times.md @@ -1,6 +1,6 @@ # prefer-called-times -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-with.md b/docs/rules/prefer-called-with.md index 6f4e6a91..334d746a 100644 --- a/docs/rules/prefer-called-with.md +++ b/docs/rules/prefer-called-with.md @@ -1,6 +1,6 @@ # prefer-called-with -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-comparison-matcher.md b/docs/rules/prefer-comparison-matcher.md index 5c93814b..3832468d 100644 --- a/docs/rules/prefer-comparison-matcher.md +++ b/docs/rules/prefer-comparison-matcher.md @@ -1,6 +1,6 @@ # prefer-comparison-matcher -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-describe-function-title.md b/docs/rules/prefer-describe-function-title.md index e1a9f498..bb68c986 100644 --- a/docs/rules/prefer-describe-function-title.md +++ b/docs/rules/prefer-describe-function-title.md @@ -1,6 +1,6 @@ # prefer-describe-function-title -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-each.md b/docs/rules/prefer-each.md index d2eff037..483b2773 100644 --- a/docs/rules/prefer-each.md +++ b/docs/rules/prefer-each.md @@ -1,6 +1,6 @@ # prefer-each -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/prefer-equality-matcher.md b/docs/rules/prefer-equality-matcher.md index 76f20f6a..25c09664 100644 --- a/docs/rules/prefer-equality-matcher.md +++ b/docs/rules/prefer-equality-matcher.md @@ -1,6 +1,6 @@ # prefer-equality-matcher -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index b7d321ed..41168266 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -1,6 +1,6 @@ # prefer-expect-assertions -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-resolves.md b/docs/rules/prefer-expect-resolves.md index ec30bdfb..bfcf2132 100644 --- a/docs/rules/prefer-expect-resolves.md +++ b/docs/rules/prefer-expect-resolves.md @@ -1,6 +1,6 @@ # prefer-expect-resolves -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-hooks-in-order.md b/docs/rules/prefer-hooks-in-order.md index f772207e..242a80bb 100644 --- a/docs/rules/prefer-hooks-in-order.md +++ b/docs/rules/prefer-hooks-in-order.md @@ -1,6 +1,6 @@ # prefer-hooks-in-order -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index 84ac455d..3215ee3d 100644 --- a/docs/rules/prefer-hooks-on-top.md +++ b/docs/rules/prefer-hooks-on-top.md @@ -1,6 +1,6 @@ # prefer-hooks-on-top -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. ```ts diff --git a/docs/rules/prefer-importing-vitest-globals.md b/docs/rules/prefer-importing-vitest-globals.md index 5f63f678..69823c99 100644 --- a/docs/rules/prefer-importing-vitest-globals.md +++ b/docs/rules/prefer-importing-vitest-globals.md @@ -1,6 +1,6 @@ # prefer-importing-vitest-globals -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-lowercase-title.md b/docs/rules/prefer-lowercase-title.md index 2c88f862..fb7617da 100644 --- a/docs/rules/prefer-lowercase-title.md +++ b/docs/rules/prefer-lowercase-title.md @@ -1,6 +1,6 @@ # prefer-lowercase-title -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-mock-promise-shorthand.md b/docs/rules/prefer-mock-promise-shorthand.md index 4ce00659..b1e9f8ce 100644 --- a/docs/rules/prefer-mock-promise-shorthand.md +++ b/docs/rules/prefer-mock-promise-shorthand.md @@ -1,6 +1,6 @@ # prefer-mock-promise-shorthand -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-snapshot-hint.md b/docs/rules/prefer-snapshot-hint.md index c1fbd594..162240c6 100644 --- a/docs/rules/prefer-snapshot-hint.md +++ b/docs/rules/prefer-snapshot-hint.md @@ -1,6 +1,6 @@ # prefer-snapshot-hint -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index b372a189..39b4f208 100644 --- a/docs/rules/prefer-spy-on.md +++ b/docs/rules/prefer-spy-on.md @@ -1,6 +1,6 @@ # prefer-spy-on -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-boolean-matchers.md b/docs/rules/prefer-strict-boolean-matchers.md index 99e0d5f1..48d6bc10 100644 --- a/docs/rules/prefer-strict-boolean-matchers.md +++ b/docs/rules/prefer-strict-boolean-matchers.md @@ -1,6 +1,6 @@ # prefer-strict-boolean-matchers -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index 9fa1ade5..fec3a70e 100644 --- a/docs/rules/prefer-strict-equal.md +++ b/docs/rules/prefer-strict-equal.md @@ -1,6 +1,6 @@ # prefer-strict-equal -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-to-be-falsy.md b/docs/rules/prefer-to-be-falsy.md index 2b8c47bd..fc01c46c 100644 --- a/docs/rules/prefer-to-be-falsy.md +++ b/docs/rules/prefer-to-be-falsy.md @@ -1,6 +1,6 @@ # prefer-to-be-falsy -🚫 This rule is _disabled_ in the πŸ’Ύ `legacy-all` config. +🚫 This rule is _disabled_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-object.md b/docs/rules/prefer-to-be-object.md index 1480bb80..83792a4b 100644 --- a/docs/rules/prefer-to-be-object.md +++ b/docs/rules/prefer-to-be-object.md @@ -1,6 +1,6 @@ # prefer-to-be-object -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-truthy.md b/docs/rules/prefer-to-be-truthy.md index 5830e50c..14ef7d5b 100644 --- a/docs/rules/prefer-to-be-truthy.md +++ b/docs/rules/prefer-to-be-truthy.md @@ -1,6 +1,6 @@ # prefer-to-be-truthy -🚫 This rule is _disabled_ in the πŸ’Ύ `legacy-all` config. +🚫 This rule is _disabled_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be.md b/docs/rules/prefer-to-be.md index d7d45d87..e2c36699 100644 --- a/docs/rules/prefer-to-be.md +++ b/docs/rules/prefer-to-be.md @@ -1,6 +1,6 @@ # prefer-to-be -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index 2a31259d..85e2c316 100644 --- a/docs/rules/prefer-to-contain.md +++ b/docs/rules/prefer-to-contain.md @@ -1,6 +1,6 @@ # prefer-to-contain -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index 38432a46..b9e47c4a 100644 --- a/docs/rules/prefer-to-have-length.md +++ b/docs/rules/prefer-to-have-length.md @@ -1,6 +1,6 @@ # prefer-to-have-length -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index f74ea6b0..4e349ca5 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -1,6 +1,6 @@ # prefer-todo -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-vi-mocked.md b/docs/rules/prefer-vi-mocked.md index 31e0c72c..fedc4e75 100644 --- a/docs/rules/prefer-vi-mocked.md +++ b/docs/rules/prefer-vi-mocked.md @@ -1,6 +1,6 @@ # prefer-vi-mocked -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-hook.md b/docs/rules/require-hook.md index 1e28fc6a..da5fe0d9 100644 --- a/docs/rules/require-hook.md +++ b/docs/rules/require-hook.md @@ -1,6 +1,6 @@ # require-hook -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/require-local-test-context-for-concurrent-snapshots.md b/docs/rules/require-local-test-context-for-concurrent-snapshots.md index e6c26ac9..e017aa68 100644 --- a/docs/rules/require-local-test-context-for-concurrent-snapshots.md +++ b/docs/rules/require-local-test-context-for-concurrent-snapshots.md @@ -1,6 +1,6 @@ # require-local-test-context-for-concurrent-snapshots -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/require-mock-type-parameters.md b/docs/rules/require-mock-type-parameters.md index 598a3c2a..68f757d1 100644 --- a/docs/rules/require-mock-type-parameters.md +++ b/docs/rules/require-mock-type-parameters.md @@ -1,6 +1,6 @@ # require-mock-type-parameters -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index 68bca3b1..a204cd27 100644 --- a/docs/rules/require-to-throw-message.md +++ b/docs/rules/require-to-throw-message.md @@ -1,6 +1,6 @@ # require-to-throw-message -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index 84632692..22cde7ec 100644 --- a/docs/rules/require-top-level-describe.md +++ b/docs/rules/require-top-level-describe.md @@ -1,6 +1,6 @@ # require-top-level-describe -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/valid-describe-callback.md b/docs/rules/valid-describe-callback.md index 08382893..dbe8f336 100644 --- a/docs/rules/valid-describe-callback.md +++ b/docs/rules/valid-describe-callback.md @@ -1,6 +1,6 @@ # valid-describe-callback -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index b5e959df..8fb83d87 100644 --- a/docs/rules/valid-expect-in-promise.md +++ b/docs/rules/valid-expect-in-promise.md @@ -1,6 +1,6 @@ # valid-expect-in-promise -⚠️ This rule _warns_ in the πŸ’Ύ `legacy-all` config. +⚠️ This rule _warns_ in the 🌍 `legacy-all` config. diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index ac634999..e30648cc 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -1,6 +1,6 @@ # valid-expect -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index 49affb2d..8a6cf287 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -1,6 +1,6 @@ # valid-title -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ’Ύ `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/src/index.ts b/src/index.ts index 30098459..548a468b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -274,9 +274,7 @@ const plugin = { }, }, configs: { - 'legacy-recommended': createConfigLegacy(recommended), - 'legacy-all': createConfigLegacy(allRules), - recommended: { + recommended: { name: '@vitest/recommended', plugins: { get vitest() { @@ -294,6 +292,8 @@ const plugin = { }, rules: createConfig(allRules), }, + 'legacy-recommended': createConfigLegacy(recommended), + 'legacy-all': createConfigLegacy(allRules), env: { name: '@vitest/env', languageOptions: { From 07b682835640886790112a77dab021682e680d02 Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Mon, 23 Jun 2025 00:48:52 -0400 Subject: [PATCH 08/11] chore: update eslint rule docs configs --- .eslint-doc-generatorrc.js | 7 + README.md | 184 +++++++++--------- docs/rules/consistent-test-it.md | 56 +++--- docs/rules/consistent-vitest-vi.md | 29 ++- docs/rules/expect-expect.md | 12 +- docs/rules/max-nested-describe.md | 10 +- docs/rules/no-alias-methods.md | 2 - docs/rules/no-conditional-expect.md | 2 +- docs/rules/no-conditional-in-test.md | 5 +- docs/rules/no-conditional-tests.md | 16 +- docs/rules/no-done-callback.md | 34 ++-- docs/rules/no-duplicate-hooks.md | 2 - docs/rules/no-focused-tests.md | 14 +- docs/rules/no-hooks.md | 76 ++++---- docs/rules/no-identical-title.md | 8 +- docs/rules/no-interpolation-in-snapshots.md | 2 +- docs/rules/no-large-snapshots.md | 20 +- docs/rules/no-restricted-matchers.md | 12 +- docs/rules/no-restricted-vi-methods.md | 12 +- docs/rules/no-test-prefixes.md | 4 +- docs/rules/padding-around-after-all-blocks.md | 12 +- .../rules/padding-around-after-each-blocks.md | 12 +- docs/rules/padding-around-all.md | 3 +- .../rules/padding-around-before-all-blocks.md | 12 +- .../padding-around-before-each-blocks.md | 12 +- docs/rules/padding-around-expect-groups.md | 24 +-- docs/rules/prefer-called-times.md | 8 +- docs/rules/prefer-comparison-matcher.md | 16 +- docs/rules/prefer-describe-function-title.md | 10 +- docs/rules/prefer-each.md | 4 +- docs/rules/prefer-equality-matcher.md | 12 +- docs/rules/prefer-expect-assertions.md | 50 ++--- docs/rules/prefer-expect-resolves.md | 12 +- docs/rules/prefer-hooks-in-order.md | 36 ++-- docs/rules/prefer-hooks-on-top.md | 12 +- docs/rules/prefer-lowercase-title.md | 59 +++--- docs/rules/prefer-mock-promise-shorthand.md | 1 + docs/rules/prefer-snapshot-hint.md | 136 +++++++------ docs/rules/prefer-spy-on.md | 8 +- docs/rules/prefer-strict-boolean-matchers.md | 1 - docs/rules/prefer-strict-equal.md | 7 +- docs/rules/prefer-to-be-falsy.md | 1 - docs/rules/prefer-to-be-object.md | 7 +- docs/rules/prefer-to-be.md | 5 +- docs/rules/prefer-to-contain.md | 14 +- docs/rules/prefer-to-have-length.md | 7 +- docs/rules/prefer-todo.md | 4 +- docs/rules/prefer-vi-mocked.md | 20 +- docs/rules/require-hook.md | 52 +++-- ...l-test-context-for-concurrent-snapshots.md | 8 +- docs/rules/require-mock-type-parameters.md | 9 +- docs/rules/require-to-throw-message.md | 10 +- docs/rules/require-top-level-describe.md | 42 ++-- docs/rules/valid-describe-callback.md | 39 ++-- docs/rules/valid-expect-in-promise.md | 40 ++-- docs/rules/valid-expect.md | 95 +++++---- docs/rules/valid-title.md | 68 +++---- src/index.ts | 14 +- src/rules/expect-expect.ts | 2 +- src/rules/no-commented-out-tests.ts | 2 +- src/rules/no-identical-title.ts | 2 +- src/rules/no-import-node-test.ts | 2 +- ...l-test-context-for-concurrent-snapshots.ts | 2 +- src/rules/valid-describe-callback.ts | 2 +- src/rules/valid-expect.ts | 2 +- src/rules/valid-title.ts | 2 +- 66 files changed, 682 insertions(+), 723 deletions(-) diff --git a/.eslint-doc-generatorrc.js b/.eslint-doc-generatorrc.js index 3a44d1ed..e8357c6e 100644 --- a/.eslint-doc-generatorrc.js +++ b/.eslint-doc-generatorrc.js @@ -1,3 +1,5 @@ +import prettier from 'prettier' + /** @type {import('eslint-doc-generator').GenerateOptions} */ const config = { configEmoji: [ @@ -5,6 +7,11 @@ const config = { ['legacy-recommended', 'β˜‘οΈ'], ['legacy-all', '🌍'], ], + postprocess: async (content, path) => + prettier.format(content, { + ...(await prettier.resolveConfig(path)), + parser: 'markdown', + }), ruleDocTitleFormat: 'name', } diff --git a/README.md b/README.md index 79ac4c85..69769a49 100644 --- a/README.md +++ b/README.md @@ -24,20 +24,20 @@ npm install @vitest/eslint-plugin --save-dev Make sure you're running ESLint `v9.0.0` or higher for the latest version of this plugin to work. The following example is how your `eslint.config.js` should be setup for this plugin to work for you. ```js -import vitest from "@vitest/eslint-plugin"; +import vitest from '@vitest/eslint-plugin' export default [ { - files: ["tests/**"], // or any other pattern + files: ['tests/**'], // or any other pattern plugins: { - vitest + vitest, }, rules: { ...vitest.configs.recommended.rules, // you can also use vitest.configs.all.rules to enable all rules - "vitest/max-nested-describe": ["error", { "max": 3 }] // you can also modify rules' behavior using option like this + 'vitest/max-nested-describe': ['error', { max: 3 }], // you can also modify rules' behavior using option like this }, }, -]; +] ``` If you're not using the latest version of ESLint (version `v8.57.0` or lower) you can setup this plugin using the following configuration @@ -73,7 +73,6 @@ If you're using old ESLint configuration, make sure to use legacy key like the f } ``` - #### Enabling with type-testing Vitest ships with an optional [type-testing feature](https://vitest.dev/guide/testing-types), which is disabled by default. @@ -81,21 +80,21 @@ Vitest ships with an optional [type-testing feature](https://vitest.dev/guide/te If you're using this feature, you should also enabled `typecheck` in the settings for this plugin. This ensures that rules like [expect-expect](docs/rules/expect-expect.md) account for type-related assertions in tests. ```js -import vitest from "@vitest/eslint-plugin"; +import vitest from '@vitest/eslint-plugin' export default [ { - files: ["tests/**"], // or any other pattern + files: ['tests/**'], // or any other pattern plugins: { vitest, }, rules: { ...vitest.configs.recommended.rules, }, - settings: { + settings: { vitest: { - typecheck: true - } + typecheck: true, + }, }, languageOptions: { globals: { @@ -109,33 +108,34 @@ export default [ ### Shareable configurations #### Recommended + This plugin exports a recommended configuration that enforces good testing practices. To enable this configuration with `eslint.config.js`, use `vitest.configs.recommended`: ```js -import vitest from "@vitest/eslint-plugin"; +import vitest from '@vitest/eslint-plugin' export default [ { - files: ["tests/**"], // or any other pattern - ...vitest.configs.recommended, - } + files: ['tests/**'], // or any other pattern + ...vitest.configs.recommended, + }, ] ``` - #### All + If you want to enable all rules instead of only some you can do so by adding the all configuration to your `eslint.config.js` config file: ```js -import vitest from "@vitest/eslint-plugin"; +import vitest from '@vitest/eslint-plugin' export default [ { - files: ["tests/**"], // or any other pattern - ...vitest.configs.all, - } + files: ['tests/**'], // or any other pattern + ...vitest.configs.all, + }, ] ``` @@ -153,84 +153,84 @@ export default [ πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).\ ❌ Deprecated. -| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | -| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :- | :- | :- | :- | :- | :- | :- | -| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | 🌍 | | | | | | -| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌍 | | πŸ”§ | | | | -| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌍 | | πŸ”§ | | | | -| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | β˜‘οΈ | 🌍 | | | | | | -| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | 🌍 | | | | | | -| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | 🌍 | | | | | | -| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | 🌍 | | πŸ”§ | | | | -| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | β˜‘οΈ | 🌍 | | | | | | -| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | 🌍 | | | | | | -| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | 🌍 | | | | | | -| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | 🌍 | | | | | | -| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | 🌍 | | | | | | -| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | 🌍 | | | πŸ’‘ | | ❌ | -| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | 🌍 | | | | | | -| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | 🌍 | | πŸ”§ | | | | -| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | 🌍 | | | | | | -| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | β˜‘οΈ | 🌍 | | πŸ”§ | | | | -| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | β˜‘οΈ | 🌍 | | πŸ”§ | | | | -| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | 🌍 | πŸ”§ | | | | -| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | 🌍 | | πŸ”§ | | | | -| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | 🌍 | | | | | | -| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from __mocks__ directory | | 🌍 | | | | | | -| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | 🌍 | | | | | | -| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | 🌍 | | | | | | -| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌍 | | | | | | -| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | 🌍 | | πŸ”§ | | | | -| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌍 | | | | | | -| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | 🌍 | | πŸ”§ | | | | -| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | 🌍 | | πŸ”§ | | | | -| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | 🌍 | | πŸ”§ | | | | -| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | 🌍 | | πŸ”§ | | | | -| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌍 | | πŸ”§ | | | | -| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌍 | | πŸ”§ | | | | -| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | 🌍 | | πŸ”§ | | | | -| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌍 | | | | | | -| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | 🌍 | | | πŸ’‘ | | | -| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | 🌍 | | | πŸ’‘ | | | -| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | 🌍 | | πŸ”§ | | | | -| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌍 | | | | | | -| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌍 | | | | | | -| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌍 | | πŸ”§ | | | | -| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌍 | | πŸ”§ | | | | -| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌍 | | πŸ”§ | | | | -| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | 🌍 | | | | | | -| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | 🌍 | | πŸ”§ | | | | -| [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 | | 🌍 | | πŸ”§ | | | | -| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | 🌍 | | | πŸ’‘ | | | -| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | 🌍 | | πŸ”§ | | | | -| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | 🌍 | πŸ”§ | | | | -| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | 🌍 | | πŸ”§ | | | | -| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | 🌍 | πŸ”§ | | | | -| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | 🌍 | | πŸ”§ | | | | -| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | 🌍 | | πŸ”§ | | | | -| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | 🌍 | | πŸ”§ | | | | -| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | 🌍 | | πŸ”§ | | πŸ’­ | | -| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | 🌍 | | | | | | -| [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 | β˜‘οΈ | 🌍 | | | | | | -| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | 🌍 | | πŸ”§ | | | | -| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | 🌍 | | | | | | -| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | 🌍 | | | | | | -| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | β˜‘οΈ | 🌍 | | | | | | -| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | β˜‘οΈ | 🌍 | | πŸ”§ | | | | -| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | 🌍 | | | | | | -| [valid-title](docs/rules/valid-title.md) | enforce valid titles | β˜‘οΈ | 🌍 | | πŸ”§ | | | | +| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | +| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | :-- | :-- | +| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | 🌍 | | | | | | +| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌍 | | πŸ”§ | | | | +| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌍 | | πŸ”§ | | | | +| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | β˜‘οΈ | 🌍 | | | | | | +| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | 🌍 | | | | | | +| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | 🌍 | | | | | | +| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | 🌍 | | πŸ”§ | | | | +| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | β˜‘οΈ | 🌍 | | | | | | +| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | 🌍 | | | | | | +| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | 🌍 | | | | | | +| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | 🌍 | | | | | | +| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | 🌍 | | | | | | +| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | 🌍 | | | πŸ’‘ | | ❌ | +| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | 🌍 | | | | | | +| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | 🌍 | | πŸ”§ | | | | +| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | 🌍 | | | | | | +| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | β˜‘οΈ | 🌍 | | πŸ”§ | | | | +| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | β˜‘οΈ | 🌍 | | πŸ”§ | | | | +| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | 🌍 | πŸ”§ | | | | +| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | 🌍 | | πŸ”§ | | | | +| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | 🌍 | | | | | | +| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from **mocks** directory | | 🌍 | | | | | | +| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | 🌍 | | | | | | +| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | 🌍 | | | | | | +| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌍 | | | | | | +| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | 🌍 | | πŸ”§ | | | | +| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌍 | | | | | | +| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | 🌍 | | πŸ”§ | | | | +| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | 🌍 | | πŸ”§ | | | | +| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | 🌍 | | πŸ”§ | | | | +| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | 🌍 | | πŸ”§ | | | | +| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | 🌍 | | πŸ”§ | | | | +| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌍 | | πŸ”§ | | | | +| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌍 | | πŸ”§ | | | | +| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | 🌍 | | πŸ”§ | | | | +| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌍 | | | | | | +| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | 🌍 | | | πŸ’‘ | | | +| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | 🌍 | | | πŸ’‘ | | | +| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | 🌍 | | πŸ”§ | | | | +| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌍 | | | | | | +| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌍 | | | | | | +| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌍 | | πŸ”§ | | | | +| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌍 | | πŸ”§ | | | | +| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌍 | | πŸ”§ | | | | +| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | 🌍 | | | | | | +| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | 🌍 | | πŸ”§ | | | | +| [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 | | 🌍 | | πŸ”§ | | | | +| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | 🌍 | | | πŸ’‘ | | | +| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | 🌍 | | πŸ”§ | | | | +| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | 🌍 | πŸ”§ | | | | +| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | 🌍 | | πŸ”§ | | | | +| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | 🌍 | πŸ”§ | | | | +| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | 🌍 | | πŸ”§ | | | | +| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | 🌍 | | πŸ”§ | | | | +| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | 🌍 | | πŸ”§ | | | | +| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | 🌍 | | πŸ”§ | | πŸ’­ | | +| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | 🌍 | | | | | | +| [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 | β˜‘οΈ | 🌍 | | | | | | +| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | 🌍 | | πŸ”§ | | | | +| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | 🌍 | | | | | | +| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | 🌍 | | | | | | +| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | β˜‘οΈ | 🌍 | | | | | | +| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | β˜‘οΈ | 🌍 | | πŸ”§ | | | | +| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | 🌍 | | | | | | +| [valid-title](docs/rules/valid-title.md) | enforce valid titles | β˜‘οΈ | 🌍 | | πŸ”§ | | | | #### Credits - [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) - Most of the rules in this plugin are essentially ports of Jest plugin rules with minor modifications + Most of the rules in this plugin are essentially ports of Jest plugin rules with minor modifications ### Licence diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index 70233e78..9355e7d3 100644 --- a/docs/rules/consistent-test-it.md +++ b/docs/rules/consistent-test-it.md @@ -12,11 +12,11 @@ Examples of **incorrect** code for this rule: ```js test('it works', () => { - // ... + // ... }) it('it works', () => { - // ... + // ... }) ``` @@ -24,13 +24,13 @@ Examples of **correct** code for this rule: ```js test('it works', () => { - // ... + // ... }) ``` ```js test('it works', () => { - // ... + // ... }) ``` @@ -38,22 +38,16 @@ test('it works', () => { ```json { - "type":"object", - "properties":{ - "fn":{ - "enum":[ - "it", - "test" - ] - }, - "withinDescribe":{ - "enum":[ - "it", - "test" - ] - } - }, - "additionalProperties":false + "type": "object", + "properties": { + "fn": { + "enum": ["it", "test"] + }, + "withinDescribe": { + "enum": ["it", "test"] + } + }, + "additionalProperties": false } ``` @@ -68,23 +62,25 @@ Decides whether to prefer `test` or `it` when used within a `describe` block. ```js /*eslint vitest/consistent-test-it: ["error", {"fn": "test"}]*/ -test('it works', () => { // <-- Valid - // ... +test('it works', () => { + // <-- Valid + // ... }) -test.only('it works', () => { // <-- Valid - // ... +test.only('it works', () => { + // <-- Valid + // ... }) - -it('it works', () => { // <-- Invalid - // ... +it('it works', () => { + // <-- Invalid + // ... }) -it.only('it works', () => { // <-- Invalid - // ... +it.only('it works', () => { + // <-- Invalid + // ... }) ``` The default configuration is top level `test` and all tests nested with `describe` to use `it`. - diff --git a/docs/rules/consistent-vitest-vi.md b/docs/rules/consistent-vitest-vi.md index 15d4c3b1..dfdd8936 100644 --- a/docs/rules/consistent-vitest-vi.md +++ b/docs/rules/consistent-vitest-vi.md @@ -11,39 +11,36 @@ Examples of **incorrect** code for this rule: ```js -vitest.mock('./src/calculator.ts', { spy: true }); +vitest.mock('./src/calculator.ts', { spy: true }) -vi.stubEnv('NODE_ENV', 'production'); +vi.stubEnv('NODE_ENV', 'production') ``` Examples of **correct** code for this rule: ```js -vi.mock('./src/calculator.ts', { spy: true }); +vi.mock('./src/calculator.ts', { spy: true }) -vi.stubEnv('NODE_ENV', 'production'); +vi.stubEnv('NODE_ENV', 'production') ``` ```js -vitest.mock('./src/calculator.ts', { spy: true }); +vitest.mock('./src/calculator.ts', { spy: true }) -vitest.stubEnv('NODE_ENV', 'production'); +vitest.stubEnv('NODE_ENV', 'production') ``` ## Options ```json { - "type":"object", - "properties":{ - "fn":{ - "enum":[ - "vi", - "vitest" - ] - } - }, - "additionalProperties":false + "type": "object", + "properties": { + "fn": { + "enum": ["vi", "vitest"] + } + }, + "additionalProperties": false } ``` diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index 2fb4bfe6..3a612fae 100644 --- a/docs/rules/expect-expect.md +++ b/docs/rules/expect-expect.md @@ -4,7 +4,6 @@ - ## Rule Details This rule aims to enforce having at least one expectation in test body to ensure that the test is actually testing something. @@ -13,7 +12,7 @@ Examples of **incorrect** code for this rule: ```js test('myLogic', () => { - console.log('myLogic') + console.log('myLogic') }) test('myLogic', () => {}) @@ -50,20 +49,17 @@ If you're using Vitest's [type-testing feature](https://vitest.dev/guide/testing An array of strings that are the names of the functions that are used for assertions. Function names can also be wildcard patterns like `expect*`,`function.**.expect` or `expect.anything`. - The following is an example of correct code for this rule with the option `assertFunctionNames`: ```js import CheckForMe from 'check-for-me' test('myLogic', () => { - expect("myLogic").toBe("myOutput") + expect('myLogic').toBe('myOutput') }) ``` - ### `additionalTestBlockFunctions` - ```json { "rules": { @@ -83,8 +79,8 @@ The following is an example of correct code for this rule with the option `addit import CheckForMe from 'check-for-me' checkForMe('myLogic', () => { checkForMe('myLogic', () => { - const actual = myLogic() - expect(actual).toBe(true) + const actual = myLogic() + expect(actual).toBe(true) }) }) ``` diff --git a/docs/rules/max-nested-describe.md b/docs/rules/max-nested-describe.md index 2cc29613..e0b9dba6 100644 --- a/docs/rules/max-nested-describe.md +++ b/docs/rules/max-nested-describe.md @@ -10,9 +10,9 @@ Examples of **incorrect** code for this rule with `max: 1`: ```js describe('outer', () => { - describe('inner', () => { - // ... - }) + describe('inner', () => { + // ... + }) }) ``` @@ -20,7 +20,7 @@ Examples of **correct** code for this rule: ```js describe('inner', () => { - // ... + // ... }) ``` @@ -32,6 +32,6 @@ Maximum number of nested `describe` blocks. ```js { - max: number + max: number } ``` diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index c608d784..6476b0ef 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -6,7 +6,6 @@ - ## Rule Details This rule disallows alias methods and forces the use of the original method. @@ -21,7 +20,6 @@ expect(a).toBeCalled() expect(a).toBeCalledTimes(1) ``` - Examples of **correct** code for this rule: ```js diff --git a/docs/rules/no-conditional-expect.md b/docs/rules/no-conditional-expect.md index c97342af..7ace0bba 100644 --- a/docs/rules/no-conditional-expect.md +++ b/docs/rules/no-conditional-expect.md @@ -13,7 +13,7 @@ Examples of **incorrect** code for this rule: ```ts test('foo', () => { if (true) { - expect(1).toBe(1) + expect(1).toBe(1) } }) ``` diff --git a/docs/rules/no-conditional-in-test.md b/docs/rules/no-conditional-in-test.md index 54762858..62558677 100644 --- a/docs/rules/no-conditional-in-test.md +++ b/docs/rules/no-conditional-in-test.md @@ -3,6 +3,7 @@ ⚠️ This rule _warns_ in the 🌍 `legacy-all` config. + ### Rule Details This rule aims to prevent conditional tests. @@ -12,7 +13,7 @@ Examples of **incorrect** code for this rule: ```js test('my test', () => { if (true) { - doTheThing() + doTheThing() } }) ``` @@ -21,6 +22,6 @@ Examples of **correct** code for this rule: ```js test('my test', () => { - expect(true).toBe(true) + expect(true).toBe(true) }) ``` diff --git a/docs/rules/no-conditional-tests.md b/docs/rules/no-conditional-tests.md index 28508821..9b4eec6b 100644 --- a/docs/rules/no-conditional-tests.md +++ b/docs/rules/no-conditional-tests.md @@ -10,11 +10,11 @@ Examples of **incorrect** code for this rule: ```js describe('my tests', () => { - if (true) { - it('is awesome', () => { - doTheThing() - }) - } + if (true) { + it('is awesome', () => { + doTheThing() + }) + } }) ``` @@ -22,8 +22,8 @@ Examples of **correct** code for this rule: ```js describe('my tests', () => { - it('is awesome', () => { - doTheThing() - }) + it('is awesome', () => { + doTheThing() + }) }) ``` diff --git a/docs/rules/no-done-callback.md b/docs/rules/no-done-callback.md index 12752e2c..732c55ad 100644 --- a/docs/rules/no-done-callback.md +++ b/docs/rules/no-done-callback.md @@ -25,13 +25,13 @@ test('foo', (done) => { test('foo', (done) => { setTimeout(() => { - done() + done() }, 1000) }) test('foo', (done) => { setTimeout(() => { - done() + done() }, 1000) }) ``` @@ -48,28 +48,32 @@ test('foo', async () => { }) test('foo', async () => { - await new Promise((resolve) => setTimeout(() => { - resolve() - }, 1000)) + await new Promise((resolve) => + setTimeout(() => { + resolve() + }, 1000), + ) }) test('foo', async () => { - await new Promise((resolve) => setTimeout(() => { - resolve() - }, 1000)) + await new Promise((resolve) => + setTimeout(() => { + resolve() + }, 1000), + ) }) test.concurrent('foo', ({ expect }) => { - expect(1).toMatchSnapshot(); -}); + expect(1).toMatchSnapshot() +}) test.concurrent('foo', (context) => { - context.expect(1).toBe(1); -}); + context.expect(1).toBe(1) +}) describe.concurrent('foo', () => { test('foo', ({ expect }) => { - expect(1).toBe(1); - }); -}); + expect(1).toBe(1) + }) +}) ``` diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index 03163ef0..01624e01 100644 --- a/docs/rules/no-duplicate-hooks.md +++ b/docs/rules/no-duplicate-hooks.md @@ -11,7 +11,6 @@ This rule aims to prevent duplicate hooks and teardown hooks. Examples of **incorrect** code for this rule: ```ts - test('foo', () => { beforeEach(() => {}) beforeEach(() => {}) // duplicate beforeEach @@ -25,4 +24,3 @@ test('foo', () => { beforeEach(() => {}) }) ``` - diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index 48fc88ff..e0f5552f 100644 --- a/docs/rules/no-focused-tests.md +++ b/docs/rules/no-focused-tests.md @@ -12,11 +12,11 @@ Examples of **incorrect** code for this rule: ```js it.only('test', () => { - // ... + // ... }) test.only('it', () => { - // ... + // ... }) ``` @@ -24,11 +24,11 @@ Examples of **correct** code for this rule: ```js it('test', () => { - // ... + // ... }) test('it', () => { - /* ... */ + /* ... */ }) ``` @@ -47,8 +47,8 @@ export default [ }, rules: { ...vitest.configs.recommended.all, - 'vitest/no-focused-tests': ['error', { 'fixable': false }] - } - } + 'vitest/no-focused-tests': ['error', { fixable: false }], + }, + }, ] ``` diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index c86e62d2..c94a808d 100644 --- a/docs/rules/no-hooks.md +++ b/docs/rules/no-hooks.md @@ -27,36 +27,36 @@ function setupBar(options) { } describe('foo', () => { - let foo; + let foo beforeEach(() => { - foo = setupFoo(); - }); + foo = setupFoo() + }) afterEach(() => { - foo = null; - }); + foo = null + }) it('does something', () => { - expect(foo.doesSomething()).toBe(true); - }); + expect(foo.doesSomething()).toBe(true) + }) describe('with bar', () => { - let bar; + let bar beforeEach(() => { - bar = setupBar(); - }); + bar = setupBar() + }) afterEach(() => { - bar = null; - }); + bar = null + }) it('does something with bar', () => { - expect(foo.doesSomething(bar)).toBe(true); - }); - }); -}); + expect(foo.doesSomething(bar)).toBe(true) + }) + }) +}) ``` Examples of **correct** code for this rule: @@ -74,16 +74,16 @@ function setupBar(options) { describe('foo', () => { it('does something', () => { - const foo = setupFoo(); - expect(foo.doesSomething()).toBe(true); - }); + const foo = setupFoo() + expect(foo.doesSomething()).toBe(true) + }) it('does something with bar', () => { - const foo = setupFoo(); - const bar = setupBar(); - expect(foo.doesSomething(bar)).toBe(true); - }); -}); + const foo = setupFoo() + const bar = setupBar() + expect(foo.doesSomething(bar)).toBe(true) + }) +}) ``` ## Options @@ -121,23 +121,23 @@ function setupFoo(options) { /* ... */ } -let foo; +let foo beforeEach(() => { - foo = setupFoo(); -}); + foo = setupFoo() +}) afterEach(() => { - vi.resetModules(); -}); + vi.resetModules() +}) test('foo does this', () => { // ... -}); +}) test('foo does that', () => { // ... -}); +}) ``` Examples of **correct** code for the `{ "allow": ["afterEach"] }` option: @@ -150,16 +150,16 @@ function setupFoo(options) { } afterEach(() => { - vi.resetModules(); -}); + vi.resetModules() +}) test('foo does this', () => { - const foo = setupFoo(); + const foo = setupFoo() // ... -}); +}) test('foo does that', () => { - const foo = setupFoo(); + const foo = setupFoo() // ... -}); -``` \ No newline at end of file +}) +``` diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index 25e99b9f..f9a58ae2 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -12,11 +12,11 @@ Examples of **incorrect** code for this rule: ```js it('is awesome', () => { - /* ... */ + /* ... */ }) it('is awesome', () => { - /* ... */ + /* ... */ }) ``` @@ -24,10 +24,10 @@ Examples of **correct** code for this rule: ```js it('is awesome', () => { - /* ... */ + /* ... */ }) it('is very awesome', () => { - /* ... */ + /* ... */ }) ``` diff --git a/docs/rules/no-interpolation-in-snapshots.md b/docs/rules/no-interpolation-in-snapshots.md index db99bef0..214d276f 100644 --- a/docs/rules/no-interpolation-in-snapshots.md +++ b/docs/rules/no-interpolation-in-snapshots.md @@ -23,4 +23,4 @@ expect('foo').toMatchSnapshot(`foo ${bar}`) expect('foo').toMatchSnapshot() expect('foo').toMatchSnapshot('foo') expect('foo').toMatchSnapshot(bar) -``` \ No newline at end of file +``` diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index e156f1bf..efb0fe89 100644 --- a/docs/rules/no-large-snapshots.md +++ b/docs/rules/no-large-snapshots.md @@ -8,26 +8,25 @@ This rule aims to prevent large snapshots. - ### Options This rule accepts an object with the following properties: -* `maxSize` (default: `50`): The maximum size of a snapshot. -* `inlineMaxSize` (default: `0`): The maximum size of a snapshot when it is inline. -* `allowedSnapshots` (default: `[]`): The list of allowed snapshots. +- `maxSize` (default: `50`): The maximum size of a snapshot. +- `inlineMaxSize` (default: `0`): The maximum size of a snapshot when it is inline. +- `allowedSnapshots` (default: `[]`): The list of allowed snapshots. ### For example: ```json { "vitest/no-large-snapshots": [ - "error", - { - "maxSize": 50, - "inlineMaxSize": 0, - "allowedSnapshots": [] - } + "error", + { + "maxSize": 50, + "inlineMaxSize": 0, + "allowedSnapshots": [] + } ] } ``` @@ -51,4 +50,3 @@ test('large snapshot', () => { ## When Not To Use It If you don't want to limit the size of your snapshots, you can disable this rule. - diff --git a/docs/rules/no-restricted-matchers.md b/docs/rules/no-restricted-matchers.md index 439380b4..9d226fe4 100644 --- a/docs/rules/no-restricted-matchers.md +++ b/docs/rules/no-restricted-matchers.md @@ -8,19 +8,17 @@ This rule disallows the use of certain matchers. - ### Forexample - ### Options ```json { "vitest/no-restricted-matchers": [ - "error", - { - "not": null, - } + "error", + { + "not": null + } ] } ``` @@ -35,4 +33,4 @@ Examples of **correct** code for this rule with the above configuration ```js expect(a).toBe(b) -``` \ No newline at end of file +``` diff --git a/docs/rules/no-restricted-vi-methods.md b/docs/rules/no-restricted-vi-methods.md index cb365139..814f4a69 100644 --- a/docs/rules/no-restricted-vi-methods.md +++ b/docs/rules/no-restricted-vi-methods.md @@ -36,18 +36,18 @@ For example: Examples of **incorrect** code for this rule with the above configuration ```js -vi.useFakeTimers(); +vi.useFakeTimers() it('calls the callback after 1 second via advanceTimersByTime', () => { // ... - vi.advanceTimersByTime(1000); + vi.advanceTimersByTime(1000) // ... -}); +}) test('plays video', () => { - const spy = vi.spyOn(video, 'play'); + const spy = vi.spyOn(video, 'play') // ... -}); -``` \ No newline at end of file +}) +``` diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index 309b7ab3..c7aabca2 100644 --- a/docs/rules/no-test-prefixes.md +++ b/docs/rules/no-test-prefixes.md @@ -11,11 +11,11 @@ Examples of **incorrect** code for this rule: ```js -xdescribe.each([])("foo", function () {}) +xdescribe.each([])('foo', function () {}) ``` Examples of **correct** code for this rule: ```js -describe.skip.each([])("foo", function () {}) +describe.skip.each([])('foo', function () {}) ``` diff --git a/docs/rules/padding-around-after-all-blocks.md b/docs/rules/padding-around-after-all-blocks.md index 87d30633..a82e7b8c 100644 --- a/docs/rules/padding-around-after-all-blocks.md +++ b/docs/rules/padding-around-after-all-blocks.md @@ -17,17 +17,17 @@ its scope. Examples of **incorrect** code for this rule: ```js -const someText = 'hoge'; -afterAll(() => {}); -describe('foo', () => {}); +const someText = 'hoge' +afterAll(() => {}) +describe('foo', () => {}) ``` Examples of **correct** code for this rule: ```js -const someText = 'hoge'; +const someText = 'hoge' -afterAll(() => {}); +afterAll(() => {}) -describe('foo', () => {}); +describe('foo', () => {}) ``` diff --git a/docs/rules/padding-around-after-each-blocks.md b/docs/rules/padding-around-after-each-blocks.md index cca69236..77dab636 100644 --- a/docs/rules/padding-around-after-each-blocks.md +++ b/docs/rules/padding-around-after-each-blocks.md @@ -17,17 +17,17 @@ its scope. Examples of **incorrect** code for this rule: ```js -const someText = 'hoge'; -afterEach(() => {}); -describe('foo', () => {}); +const someText = 'hoge' +afterEach(() => {}) +describe('foo', () => {}) ``` Examples of **correct** code for this rule: ```js -const someText = 'hoge'; +const someText = 'hoge' -afterEach(() => {}); +afterEach(() => {}) -describe('foo', () => {}); +describe('foo', () => {}) ``` diff --git a/docs/rules/padding-around-all.md b/docs/rules/padding-around-all.md index 6e19182a..0a9cc2b6 100644 --- a/docs/rules/padding-around-all.md +++ b/docs/rules/padding-around-all.md @@ -7,6 +7,7 @@ ## Rule Details + This is a meta rule that simply enables all of the following rules: - [padding-around-after-all-blocks](padding-around-after-all-blocks.md) @@ -15,4 +16,4 @@ This is a meta rule that simply enables all of the following rules: - [padding-around-before-each-blocks](padding-around-before-each-blocks.md) - [padding-around-expect-groups](padding-around-expect-groups.md) - [padding-around-describe-blocks](padding-around-describe-blocks.md) -- [padding-around-test-blocks](padding-around-test-blocks.md) \ No newline at end of file +- [padding-around-test-blocks](padding-around-test-blocks.md) diff --git a/docs/rules/padding-around-before-all-blocks.md b/docs/rules/padding-around-before-all-blocks.md index 02639944..5fc6b292 100644 --- a/docs/rules/padding-around-before-all-blocks.md +++ b/docs/rules/padding-around-before-all-blocks.md @@ -17,17 +17,17 @@ its scope. Examples of **incorrect** code for this rule: ```js -const someText = 'hoge'; -beforeAll(() => {}); -describe('foo', () => {}); +const someText = 'hoge' +beforeAll(() => {}) +describe('foo', () => {}) ``` Examples of **correct** code for this rule: ```js -const someText = 'hoge'; +const someText = 'hoge' -beforeAll(() => {}); +beforeAll(() => {}) -describe('foo', () => {}); +describe('foo', () => {}) ``` diff --git a/docs/rules/padding-around-before-each-blocks.md b/docs/rules/padding-around-before-each-blocks.md index 51062bf6..7dbc2fe5 100644 --- a/docs/rules/padding-around-before-each-blocks.md +++ b/docs/rules/padding-around-before-each-blocks.md @@ -17,17 +17,17 @@ its scope. Examples of **incorrect** code for this rule: ```js -const someText = 'hoge'; -beforeEach(() => {}); -describe('foo', () => {}); +const someText = 'hoge' +beforeEach(() => {}) +describe('foo', () => {}) ``` Examples of **correct** code for this rule: ```js -const someText = 'hoge'; +const someText = 'hoge' -beforeEach(() => {}); +beforeEach(() => {}) -describe('foo', () => {}); +describe('foo', () => {}) ``` diff --git a/docs/rules/padding-around-expect-groups.md b/docs/rules/padding-around-expect-groups.md index 85c4c404..d3143f8b 100644 --- a/docs/rules/padding-around-expect-groups.md +++ b/docs/rules/padding-around-expect-groups.md @@ -18,25 +18,25 @@ Examples of **incorrect** code for this rule: ```js test('test', () => { - let abc = 123; - expect(abc).toEqual(123); - expect(123).toEqual(abc); - abc = 456; - expect(abc).toEqual(456); -}); + let abc = 123 + expect(abc).toEqual(123) + expect(123).toEqual(abc) + abc = 456 + expect(abc).toEqual(456) +}) ``` Examples of **correct** code for this rule: ```js test('test', () => { - let abc = 123; + let abc = 123 - expect(abc).toEqual(123); - expect(123).toEqual(abc); + expect(abc).toEqual(123) + expect(123).toEqual(abc) - abc = 456; + abc = 456 - expect(abc).toEqual(456); -}); + expect(abc).toEqual(456) +}) ``` diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index 67fcd19c..db708405 100644 --- a/docs/rules/prefer-called-times.md +++ b/docs/rules/prefer-called-times.md @@ -14,10 +14,10 @@ Examples of **incorrect** code for this rule: ```ts test('foo', () => { - const mock = vi.fn() - mock('foo') - expect(mock).toBeCalledOnce() - expect(mock).toHaveBeenCalledOnce() + const mock = vi.fn() + mock('foo') + expect(mock).toBeCalledOnce() + expect(mock).toHaveBeenCalledOnce() }) ``` diff --git a/docs/rules/prefer-comparison-matcher.md b/docs/rules/prefer-comparison-matcher.md index 3832468d..731ddf45 100644 --- a/docs/rules/prefer-comparison-matcher.md +++ b/docs/rules/prefer-comparison-matcher.md @@ -16,19 +16,19 @@ This rule checks for comparisons in a test that could be replaced with one of th Examples of **incorrect** code for this rule: ```js -expect(x > 5).toBe(true); -expect(x < 7).not.toEqual(true); -expect(x <= y).toStrictEqual(true); +expect(x > 5).toBe(true) +expect(x < 7).not.toEqual(true) +expect(x <= y).toStrictEqual(true) ``` Examples of **correct** code for this rule: ```js -expect(x).toBeGreaterThan(5); -expect(x).not.toBeLessThanOrEqual(7); -expect(x).toBeLessThanOrEqual(y); +expect(x).toBeGreaterThan(5) +expect(x).not.toBeLessThanOrEqual(7) +expect(x).toBeLessThanOrEqual(y) // special case - see below -expect(x < 'Carl').toBe(true); +expect(x < 'Carl').toBe(true) // Rule only works on inters and big integers -``` \ No newline at end of file +``` diff --git a/docs/rules/prefer-describe-function-title.md b/docs/rules/prefer-describe-function-title.md index bb68c986..81f8ad39 100644 --- a/docs/rules/prefer-describe-function-title.md +++ b/docs/rules/prefer-describe-function-title.md @@ -13,16 +13,16 @@ This rule aims to enforce passing a named function to `describe()` instead of an Passing named functions means the correct title will be used even if the function is renamed. This rule will report if a string is passed to a `describe()` block if: -* The string matches a function imported into the file -* That function's name also matches the test file's name +- The string matches a function imported into the file +- That function's name also matches the test file's name Examples of **incorrect** code for this rule: ```ts // myFunction.test.js -import { myFunction } from "./myFunction" +import { myFunction } from './myFunction' -describe("myFunction", () => { +describe('myFunction', () => { // ... }) ``` @@ -31,7 +31,7 @@ Examples of **correct** code for this rule: ```ts // myFunction.test.js -import { myFunction } from "./myFunction" +import { myFunction } from './myFunction' describe(myFunction, () => { // ... diff --git a/docs/rules/prefer-each.md b/docs/rules/prefer-each.md index 483b2773..7252dbfe 100644 --- a/docs/rules/prefer-each.md +++ b/docs/rules/prefer-each.md @@ -8,7 +8,7 @@ // bad for (const item of items) { describe(item, () => { - expect(item).toBe('foo') + expect(item).toBe('foo') }) } @@ -16,4 +16,4 @@ for (const item of items) { describe.each(items)('item', (item) => { expect(item).toBe('foo') }) -``` \ No newline at end of file +``` diff --git a/docs/rules/prefer-equality-matcher.md b/docs/rules/prefer-equality-matcher.md index 25c09664..cff2470c 100644 --- a/docs/rules/prefer-equality-matcher.md +++ b/docs/rules/prefer-equality-matcher.md @@ -13,11 +13,9 @@ This rule aims to enforce the use of the built-in equality matchers. Examples of **incorrect** code for this rule: ```ts - // bad - expect(1 == 1).toBe(1) - +// bad +expect(1 == 1).toBe(1) - // bad - expect(1).toEqual(1) - -``` \ No newline at end of file +// bad +expect(1).toEqual(1) +``` diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index 41168266..8b90de7e 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -18,26 +18,26 @@ Examples of **incorrect** code for this rule: ```js test('no assertions', () => { // ... -}); +}) test('assertions not first', () => { - expect(true).toBe(true); + expect(true).toBe(true) // ... -}); +}) ``` Examples of **correct** code for this rule: ```js test('assertions first', () => { - expect.assertions(1); + expect.assertions(1) // ... -}); +}) test('assertions first', () => { - expect.hasAssertions(); + expect.hasAssertions() // ... -}); +}) ``` ## Options @@ -73,21 +73,21 @@ when this option is enabled the following code will be considered incorrect: ```js test('assertions first', () => { - for (let i = 0; i < 10; i++) { - expect(i).toBeLessThan(10); - } -}); + for (let i = 0; i < 10; i++) { + expect(i).toBeLessThan(10) + } +}) ``` To fix this, you'll need to add `expect.assertions(1)` or `expect.hasAssertions()` as the first expression: ```js test('assertions first', () => { - expect.hasAssertions(); - for (let i = 0; i < 10; i++) { - expect(i).toBeLessThan(10); - } -}); + expect.hasAssertions() + for (let i = 0; i < 10; i++) { + expect(i).toBeLessThan(10) + } +}) ``` `onlyFunctionsWithExpectInCallback` @@ -98,19 +98,19 @@ when this option is enabled the following code will be considered incorrect: ```js test('assertions first', () => { - fetchData((data) => { - expect(data).toBe('peanut butter'); - }); -}); + fetchData((data) => { + expect(data).toBe('peanut butter') + }) +}) ``` To fix this, you'll need to add `expect.assertions(1)` or `expect.hasAssertions()` as the first expression: ```js test('assertions first', () => { - expect.assertions(1); - fetchData((data) => { - expect(data).toBe('peanut butter'); - }); -}); + expect.assertions(1) + fetchData((data) => { + expect(data).toBe('peanut butter') + }) +}) ``` diff --git a/docs/rules/prefer-expect-resolves.md b/docs/rules/prefer-expect-resolves.md index bfcf2132..2247cd92 100644 --- a/docs/rules/prefer-expect-resolves.md +++ b/docs/rules/prefer-expect-resolves.md @@ -7,9 +7,13 @@ ```ts -// bad -it('passes', async () => { expect(await someValue()).toBe(true); }); +// bad +it('passes', async () => { + expect(await someValue()).toBe(true) +}) -// good -it('passes', async () => { await expect(someValue()).resolves.toBe(true); }); +// good +it('passes', async () => { + await expect(someValue()).resolves.toBe(true) +}) ``` diff --git a/docs/rules/prefer-hooks-in-order.md b/docs/rules/prefer-hooks-in-order.md index 242a80bb..ceee0488 100644 --- a/docs/rules/prefer-hooks-in-order.md +++ b/docs/rules/prefer-hooks-in-order.md @@ -4,27 +4,27 @@ -```js - // consistent order of hooks - ['beforeAll', 'beforeEach', 'afterEach', 'afterAll'] +```js +// consistent order of hooks +;['beforeAll', 'beforeEach', 'afterEach', 'afterAll'] ``` ```js - // bad - afterAll(() => { - removeMyDatabase(); - }); - beforeAll(() => { - createMyDatabase(); - }); +// bad +afterAll(() => { + removeMyDatabase() +}) +beforeAll(() => { + createMyDatabase() +}) ``` ```js - // good - beforeAll(() => { - createMyDatabase(); - }); - afterAll(() => { - removeMyDatabase(); - }); -``` \ No newline at end of file +// good +beforeAll(() => { + createMyDatabase() +}) +afterAll(() => { + removeMyDatabase() +}) +``` diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index 3215ee3d..d54b2e7d 100644 --- a/docs/rules/prefer-hooks-on-top.md +++ b/docs/rules/prefer-hooks-on-top.md @@ -3,29 +3,29 @@ ⚠️ This rule _warns_ in the 🌍 `legacy-all` config. + ```ts // bad describe('foo', () => { it('bar', () => { - // ... + // ... }) beforeEach(() => { - // ... + // ... }) }) - // good describe('foo', () => { beforeEach(() => { - // ... + // ... }) it('bar', () => { - // ... + // ... }) }) -``` \ No newline at end of file +``` diff --git a/docs/rules/prefer-lowercase-title.md b/docs/rules/prefer-lowercase-title.md index fb7617da..8cf308dc 100644 --- a/docs/rules/prefer-lowercase-title.md +++ b/docs/rules/prefer-lowercase-title.md @@ -12,7 +12,7 @@ Examples of **incorrect** code for this rule: ```js test('It works', () => { - // ... + // ... }) ``` @@ -20,44 +20,39 @@ Examples of **correct** code for this rule: ```js test('it works', () => { - // ... + // ... }) ``` - ### Options ```json { - "type":"object", - "properties":{ - "ignore":{ - "type":"array", - "items":{ - "enum":[ - "describe", - "test", - "it" - ] - }, - "additionalProperties":false - }, - "allowedPrefixes":{ - "type":"array", - "items":{ - "type":"string" - }, - "additionalItems":false + "type": "object", + "properties": { + "ignore": { + "type": "array", + "items": { + "enum": ["describe", "test", "it"] }, - "ignoreTopLevelDescribe":{ - "type":"boolean", - "default":false + "additionalProperties": false + }, + "allowedPrefixes": { + "type": "array", + "items": { + "type": "string" }, - "lowercaseFirstCharacterOnly":{ - "type":"boolean", - "default":true - } - }, - "additionalProperties":false + "additionalItems": false + }, + "ignoreTopLevelDescribe": { + "type": "boolean", + "default": false + }, + "lowercaseFirstCharacterOnly": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false } -``` \ No newline at end of file +``` diff --git a/docs/rules/prefer-mock-promise-shorthand.md b/docs/rules/prefer-mock-promise-shorthand.md index b1e9f8ce..11c423bc 100644 --- a/docs/rules/prefer-mock-promise-shorthand.md +++ b/docs/rules/prefer-mock-promise-shorthand.md @@ -5,6 +5,7 @@ πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + ```ts // bad vi.fn().mockReturnValue(Promise.reject(42)) diff --git a/docs/rules/prefer-snapshot-hint.md b/docs/rules/prefer-snapshot-hint.md index 162240c6..a3a6e112 100644 --- a/docs/rules/prefer-snapshot-hint.md +++ b/docs/rules/prefer-snapshot-hint.md @@ -22,53 +22,52 @@ Examples of **incorrect** code for this rule with the `always` option: ```ts const snapshotOutput = ({ stdout, stderr }) => { - expect(stdout).toMatchSnapshot(); - expect(stderr).toMatchSnapshot(); -}; + expect(stdout).toMatchSnapshot() + expect(stderr).toMatchSnapshot() +} describe('cli', () => { describe('--version flag', () => { it('prints the version', async () => { - snapshotOutput(await runCli(['--version'])); - }); - }); + snapshotOutput(await runCli(['--version'])) + }) + }) describe('--config flag', () => { it('reads the config', async () => { const { stdout, parsedConfig } = await runCli([ '--config', 'vitest.config.js', - ]); + ]) - expect(stdout).toMatchSnapshot(); - expect(parsedConfig).toMatchSnapshot(); - }); + expect(stdout).toMatchSnapshot() + expect(parsedConfig).toMatchSnapshot() + }) it('prints nothing to stderr', async () => { - const { stderr } = await runCli(['--config', 'vitest.config.js']); + const { stderr } = await runCli(['--config', 'vitest.config.js']) - expect(stderr).toMatchSnapshot(); - }); + expect(stderr).toMatchSnapshot() + }) describe('when the file does not exist', () => { it('throws an error', async () => { await expect( runCli(['--config', 'does-not-exist.js']), - ).rejects.toThrowErrorMatchingSnapshot(); - }); - }); - }); -}); + ).rejects.toThrowErrorMatchingSnapshot() + }) + }) + }) +}) ``` - Examples of **correct** code for this rule with the `always` option: ```ts const snapshotOutput = ({ stdout, stderr }, hints) => { - expect(stdout).toMatchSnapshot({}, `stdout: ${hints.stdout}`); - expect(stderr).toMatchSnapshot({}, `stderr: ${hints.stderr}`); -}; + expect(stdout).toMatchSnapshot({}, `stdout: ${hints.stdout}`) + expect(stderr).toMatchSnapshot({}, `stderr: ${hints.stderr}`) +} describe('cli', () => { describe('--version flag', () => { @@ -76,79 +75,78 @@ describe('cli', () => { snapshotOutput(await runCli(['--version']), { stdout: 'version string', stderr: 'empty', - }); - }); - }); + }) + }) + }) describe('--config flag', () => { it('reads the config', async () => { - const { stdout } = await runCli(['--config', 'vitest.config.js']); + const { stdout } = await runCli(['--config', 'vitest.config.js']) - expect(stdout).toMatchSnapshot({}, 'stdout: config settings'); - }); + expect(stdout).toMatchSnapshot({}, 'stdout: config settings') + }) it('prints nothing to stderr', async () => { - const { stderr } = await runCli(['--config', 'vitest.config.js']); + const { stderr } = await runCli(['--config', 'vitest.config.js']) - expect(stderr).toMatchInlineSnapshot(); - }); + expect(stderr).toMatchInlineSnapshot() + }) describe('when the file does not exist', () => { it('throws an error', async () => { await expect( runCli(['--config', 'does-not-exist.js']), - ).rejects.toThrowErrorMatchingSnapshot('stderr: config error'); - }); - }); - }); -}); + ).rejects.toThrowErrorMatchingSnapshot('stderr: config error') + }) + }) + }) +}) ``` - #### `multi` (default) Examples of **incorrect** code for the `'multi'` option: ```ts const snapshotOutput = ({ stdout, stderr }) => { - expect(stdout).toMatchSnapshot(); - expect(stderr).toMatchSnapshot(); -}; + expect(stdout).toMatchSnapshot() + expect(stderr).toMatchSnapshot() +} describe('cli', () => { describe('--version flag', () => { it('prints the version', async () => { - snapshotOutput(await runCli(['--version'])); - }); - }); + snapshotOutput(await runCli(['--version'])) + }) + }) describe('--config flag', () => { it('reads the config', async () => { const { stdout, parsedConfig } = await runCli([ '--config', 'vitest.config.js', - ]); + ]) - expect(stdout).toMatchSnapshot(); - expect(parsedConfig).toMatchSnapshot(); - }); + expect(stdout).toMatchSnapshot() + expect(parsedConfig).toMatchSnapshot() + }) it('prints nothing to stderr', async () => { - const { stderr } = await runCli(['--config', 'vitest.config.js']); + const { stderr } = await runCli(['--config', 'vitest.config.js']) - expect(stderr).toMatchSnapshot(); - }); - }); -}); + expect(stderr).toMatchSnapshot() + }) + }) +}) ``` Examples of **correct** code for the `'multi'` option: ```ts const snapshotOutput = ({ stdout, stderr }, hints) => { - expect(stdout).toMatchSnapshot({}, `stdout: ${hints.stdout}`); - expect(stderr).toMatchSnapshot({}, `stderr: ${hints.stderr}`); -}; + expect(stdout).toMatchSnapshot({}, `stdout: ${hints.stdout}`) + expect(stderr).toMatchSnapshot({}, `stderr: ${hints.stderr}`) +} describe('cli', () => { describe('--version flag', () => { @@ -156,30 +154,30 @@ describe('cli', () => { snapshotOutput(await runCli(['--version']), { stdout: 'version string', stderr: 'empty', - }); - }); - }); + }) + }) + }) describe('--config flag', () => { it('reads the config', async () => { - const { stdout } = await runCli(['--config', 'vitest.config.js']); + const { stdout } = await runCli(['--config', 'vitest.config.js']) - expect(stdout).toMatchSnapshot(); - }); + expect(stdout).toMatchSnapshot() + }) it('prints nothing to stderr', async () => { - const { stderr } = await runCli(['--config', 'vitest.config.js']); + const { stderr } = await runCli(['--config', 'vitest.config.js']) - expect(stderr).toMatchInlineSnapshot(); - }); + expect(stderr).toMatchInlineSnapshot() + }) describe('when the file does not exist', () => { it('throws an error', async () => { await expect( runCli(['--config', 'does-not-exist.js']), - ).rejects.toThrowErrorMatchingSnapshot(); - }); - }); - }); -}); + ).rejects.toThrowErrorMatchingSnapshot() + }) + }) + }) +}) ``` diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index 39b4f208..51a38da3 100644 --- a/docs/rules/prefer-spy-on.md +++ b/docs/rules/prefer-spy-on.md @@ -11,13 +11,13 @@ This rule triggers a warning if an object's property is overwritten with a vitest mock. ```ts -Date.now = vi.fn(); -Date.now = vi.fn(() => 10); +Date.now = vi.fn() +Date.now = vi.fn(() => 10) ``` These patterns would not be considered warnings: ```ts -vi.spyOn(Date, 'now'); -vi.spyOn(Date, 'now').mockImplementation(() => 10); +vi.spyOn(Date, 'now') +vi.spyOn(Date, 'now').mockImplementation(() => 10) ``` diff --git a/docs/rules/prefer-strict-boolean-matchers.md b/docs/rules/prefer-strict-boolean-matchers.md index 48d6bc10..feb6a2f8 100644 --- a/docs/rules/prefer-strict-boolean-matchers.md +++ b/docs/rules/prefer-strict-boolean-matchers.md @@ -15,7 +15,6 @@ expectTypeOf(foo).toBeTruthy() expect(foo).toBeFalsy() expectTypeOf(foo).toBeFalsy() - // good expect(foo).toBe(true) expectTypeOf(foo).toBe(true) diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index fec3a70e..1f8d34db 100644 --- a/docs/rules/prefer-strict-equal.md +++ b/docs/rules/prefer-strict-equal.md @@ -9,9 +9,8 @@ ```ts // bad -expect(something).toEqual(somethingElse); +expect(something).toEqual(somethingElse) // good -expect(something).toStrictEqual(somethingElse); - -``` \ No newline at end of file +expect(something).toStrictEqual(somethingElse) +``` diff --git a/docs/rules/prefer-to-be-falsy.md b/docs/rules/prefer-to-be-falsy.md index fc01c46c..e047d8a9 100644 --- a/docs/rules/prefer-to-be-falsy.md +++ b/docs/rules/prefer-to-be-falsy.md @@ -23,4 +23,3 @@ Examples of **correct** code for this rule: expect(foo).toBeFalsy() expectTypeOf(foo).toBeFalsy() ``` - diff --git a/docs/rules/prefer-to-be-object.md b/docs/rules/prefer-to-be-object.md index 83792a4b..4ad41b79 100644 --- a/docs/rules/prefer-to-be-object.md +++ b/docs/rules/prefer-to-be-object.md @@ -5,9 +5,10 @@ πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + ```js -expectTypeOf({}).not.toBeInstanceOf(Object); +expectTypeOf({}).not.toBeInstanceOf(Object) // should be -expectTypeOf({}).not.toBeObject(); -``` \ No newline at end of file +expectTypeOf({}).not.toBeObject() +``` diff --git a/docs/rules/prefer-to-be.md b/docs/rules/prefer-to-be.md index e2c36699..9861ccac 100644 --- a/docs/rules/prefer-to-be.md +++ b/docs/rules/prefer-to-be.md @@ -6,7 +6,7 @@ -### Correct +### Correct ```ts import { test } from 'vitest' @@ -16,7 +16,7 @@ test('foo', () => { }) ``` -### Incorrect +### Incorrect ```ts import { test } from 'vitest' @@ -25,4 +25,3 @@ test('foo', () => { expect(1).toEqual(1) }) ``` - \ No newline at end of file diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index 85e2c316..1a5374f5 100644 --- a/docs/rules/prefer-to-contain.md +++ b/docs/rules/prefer-to-contain.md @@ -6,22 +6,18 @@ - This rule triggers a warning if `toBe()`, `toEqual()` or `toStrickEqual()` is used to assert object inclusion in an array. - The following patterns are considered warnings: - ```ts -expect(a.includes(b)).toBe(true); -expect(a.includes(b)).toEqual(true); -expect(a.includes(b)).toStrictEqual(true); +expect(a.includes(b)).toBe(true) +expect(a.includes(b)).toEqual(true) +expect(a.includes(b)).toStrictEqual(true) ``` - The following patterns are not considered warnings: ```ts -expect(a).toContain(b); -``` \ No newline at end of file +expect(a).toContain(b) +``` diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index b9e47c4a..f96a5f14 100644 --- a/docs/rules/prefer-to-have-length.md +++ b/docs/rules/prefer-to-have-length.md @@ -5,10 +5,11 @@ πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). + ```js // bad -expect(files.length).toStrictEqual(1); +expect(files.length).toStrictEqual(1) // good -expect(files).toHaveLength(1); -``` \ No newline at end of file +expect(files).toHaveLength(1) +``` diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index 4e349ca5..faba15a8 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -13,7 +13,7 @@ When tests are empty it's better to mark them as `test.todo` as it will be highl The following pattern is considered a warning: ```js -test('foo'); +test('foo') test('foo', () => {}) test.skip('foo', () => {}) ``` @@ -21,5 +21,5 @@ test.skip('foo', () => {}) The following pattern is not considered a warning: ```js -test.todo('foo'); +test.todo('foo') ``` diff --git a/docs/rules/prefer-vi-mocked.md b/docs/rules/prefer-vi-mocked.md index fedc4e75..434c1385 100644 --- a/docs/rules/prefer-vi-mocked.md +++ b/docs/rules/prefer-vi-mocked.md @@ -24,18 +24,18 @@ Restricted types: The following patterns are warnings: ```typescript -(foo as Mock).mockReturnValue(1); -const mock = (foo as Mock).mockReturnValue(1); -(foo as unknown as Mock).mockReturnValue(1); -(Obj.foo as Mock).mockReturnValue(1); -([].foo as Mock).mockReturnValue(1); +;(foo as Mock).mockReturnValue(1) +const mock = (foo as Mock).mockReturnValue(1) +;(foo as unknown as Mock).mockReturnValue(1) +;(Obj.foo as Mock).mockReturnValue(1) +;([].foo as Mock).mockReturnValue(1) ``` The following patterns are not warnings: ```js -vi.mocked(foo).mockReturnValue(1); -const mock = vi.mocked(foo).mockReturnValue(1); -vi.mocked(Obj.foo).mockReturnValue(1); -vi.mocked([].foo).mockReturnValue(1); -``` \ No newline at end of file +vi.mocked(foo).mockReturnValue(1) +const mock = vi.mocked(foo).mockReturnValue(1) +vi.mocked(Obj.foo).mockReturnValue(1) +vi.mocked([].foo).mockReturnValue(1) +``` diff --git a/docs/rules/require-hook.md b/docs/rules/require-hook.md index da5fe0d9..0c14a5c1 100644 --- a/docs/rules/require-hook.md +++ b/docs/rules/require-hook.md @@ -4,9 +4,9 @@ -It's common when writing tests to need to perform a particular setup work before and after a test suite run. Because Vitest executes all `describe` handlers in a test file _before_ it executes any of the actual tests, it's important to ensure setup and teardown work is done inside `before*` and `after*` handlers respectively, rather than inside the `describe` blocks. +It's common when writing tests to need to perform a particular setup work before and after a test suite run. Because Vitest executes all `describe` handlers in a test file _before_ it executes any of the actual tests, it's important to ensure setup and teardown work is done inside `before*` and `after*` handlers respectively, rather than inside the `describe` blocks. -## Details +## Details This rule flags any expression that is either at the toplevel of a test file or directly within the body of a `describe` except the following: @@ -18,52 +18,48 @@ This rule flags any expression that is either at the toplevel of a test file or This rule flags any function within in a `describe` block and suggest wrapping them in one of the four lifecycle hooks. - The following patterns are considered warnings: ```ts import { database } from './api' describe('foo', () => { - database.connect() + database.connect() - test('bar', () => { - // ... - }) + test('bar', () => { + // ... + }) - database.disconnect() + database.disconnect() }) ``` - - The following patterns are not warnings: - - ```ts describe('foo', () => { - before(() => { - database.connect() - }) + before(() => { + database.connect() + }) - test('bar', () => { - // ... - }) + test('bar', () => { + // ... + }) }) ``` - ## Options If there are methods that you want to call outside of hooks and tests, you can mark them as allowed using the `allowedFunctionCalls` option. - ```json { - "vitest/require-hook": ["error", { - "allowedFunctionCalls": ["database.connect"] - }] + "vitest/require-hook": [ + "error", + { + "allowedFunctionCalls": ["database.connect"] + } + ] } ``` @@ -73,12 +69,12 @@ The following patterns are not warnings because `database.connect` is allowed: import { database } from './api' describe('foo', () => { - database.connect() + database.connect() - test('bar', () => { - // ... - }) + test('bar', () => { + // ... + }) - database.disconnect() + database.disconnect() }) ``` diff --git a/docs/rules/require-local-test-context-for-concurrent-snapshots.md b/docs/rules/require-local-test-context-for-concurrent-snapshots.md index e017aa68..5907606e 100644 --- a/docs/rules/require-local-test-context-for-concurrent-snapshots.md +++ b/docs/rules/require-local-test-context-for-concurrent-snapshots.md @@ -10,13 +10,13 @@ Examples of **incorrect** code for this rule: ```js test.concurrent('myLogic', () => { - expect(true).toMatchSnapshot(); + expect(true).toMatchSnapshot() }) describe.concurrent('something', () => { - test('myLogic', () => { - expect(true).toMatchInlineSnapshot(); - }) + test('myLogic', () => { + expect(true).toMatchInlineSnapshot() + }) }) ``` diff --git a/docs/rules/require-mock-type-parameters.md b/docs/rules/require-mock-type-parameters.md index 68f757d1..6af175c3 100644 --- a/docs/rules/require-mock-type-parameters.md +++ b/docs/rules/require-mock-type-parameters.md @@ -36,9 +36,12 @@ test('foo', () => { ```json { - "vitest/require-hook": ["error", { - "checkImportFunctions": false - }] + "vitest/require-hook": [ + "error", + { + "checkImportFunctions": false + } + ] } ``` diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index a204cd27..ed385152 100644 --- a/docs/rules/require-to-throw-message.md +++ b/docs/rules/require-to-throw-message.md @@ -12,13 +12,13 @@ The following patterns are considered warnings: ```js test('foo', () => { expect(() => { - throw new Error('foo') + throw new Error('foo') }).toThrow() }) test('foo', () => { expect(() => { - throw new Error('foo') + throw new Error('foo') }).toThrowError() }) ``` @@ -28,13 +28,13 @@ The following patterns are not considered warnings: ```js test('foo', () => { expect(() => { - throw new Error('foo') + throw new Error('foo') }).toThrow('foo') }) test('foo', () => { expect(() => { - throw new Error('foo') + throw new Error('foo') }).toThrowError('foo') }) -``` \ No newline at end of file +``` diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index 22cde7ec..2cc8a15a 100644 --- a/docs/rules/require-top-level-describe.md +++ b/docs/rules/require-top-level-describe.md @@ -6,57 +6,47 @@ This rule triggers warning if a test case (`test` and `it`) or a hook (`beforeAll`, `beforeEach`, `afterEach`, `afterAll`) is not located in a top-level `describe` block. - ## Options -This rule accepts an object with the following properties: +This rule accepts an object with the following properties: - `maxNumberOfTopLevelDescribes`: The maximum number of top-level tests allowed in a file. Defaults to `Infinity`. Allowing any number of top-level describe blocks. ```json { - "vitest/require-top-level-describe": [ - "error", - { - "maxNumberOfTopLevelDescribes": 2 - } - ] + "vitest/require-top-level-describe": [ + "error", + { + "maxNumberOfTopLevelDescribes": 2 + } + ] } ``` - - The following patterns are considered warnings: ```js test('foo', () => {}) beforeEach(() => { - describe('bar', () => { - test('baz', () => {}) - }) + describe('bar', () => { + test('baz', () => {}) + }) }) - - ``` The following patterns are not considered warnings: ```js describe('foo', () => { - test('bar', () => {}) + test('bar', () => {}) }) describe('foo', () => { - beforeEach(() => { - describe('bar', () => { - test('baz', () => {}) - }) - }) + beforeEach(() => { + describe('bar', () => { + test('baz', () => {}) + }) + }) }) - ``` - - - - diff --git a/docs/rules/valid-describe-callback.md b/docs/rules/valid-describe-callback.md index dbe8f336..c36d9099 100644 --- a/docs/rules/valid-describe-callback.md +++ b/docs/rules/valid-describe-callback.md @@ -4,45 +4,42 @@ - This rule validates the second parameter of a `describe()` function is a callback. - should not contain parameters -- should not contain any `return` statements +- should not contain any `return` statements The following are considered warnings: ```js // callback function parameters are not allowed -describe("myfunc", done => { - // +describe('myfunc', (done) => { + // }) - -describe("myfunc", () => { - // no return statements are allowed in a block of a callback function - return Promise.resolve().then(() => { - // - }) +describe('myfunc', () => { + // no return statements are allowed in a block of a callback function + return Promise.resolve().then(() => { + // + }) }) // returning a value from a describe block is not allowed -describe("myfunc", () => - it("should do something", () => { - // - }) -) +describe('myfunc', () => + it('should do something', () => { + // + })) ``` The following are not considered warnings: ```js -describe("myfunc", async () => { - // +describe('myfunc', async () => { + // }) -describe("myfunc", () => { - it("should do something", () => { - // - }) +describe('myfunc', () => { + it('should do something', () => { + // + }) }) ``` diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index 8fb83d87..c3df3f3f 100644 --- a/docs/rules/valid-expect-in-promise.md +++ b/docs/rules/valid-expect-in-promise.md @@ -11,41 +11,39 @@ The following patterns is considered warning: ```js test('promise test', async () => { something().then((value) => { - expect(value).toBe('red'); - }); -}); + expect(value).toBe('red') + }) +}) test('promises test', () => { const onePromise = something().then((value) => { - expect(value).toBe('red'); - }); + expect(value).toBe('red') + }) const twoPromise = something().then((value) => { - expect(value).toBe('blue'); - }); + expect(value).toBe('blue') + }) - return Promise.any([onePromise, twoPromise]); -}); + return Promise.any([onePromise, twoPromise]) +}) ``` The following pattern is not warning: ```js - test('promise test', async () => { await something().then((value) => { - expect(value).toBe('red'); - }); -}); + expect(value).toBe('red') + }) +}) test('promises test', () => { const onePromise = something().then((value) => { - expect(value).toBe('red'); - }); + expect(value).toBe('red') + }) const twoPromise = something().then((value) => { - expect(value).toBe('blue'); - }); - - return Promise.all([onePromise, twoPromise]); -}); + expect(value).toBe('blue') + }) -``` \ No newline at end of file + return Promise.all([onePromise, twoPromise]) +}) +``` diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index e30648cc..edd9a101 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -12,74 +12,69 @@ This rule triggers a warning if `expect` is called with no argument or with more 1. `alwaysAwait` - - Type: `boolean` - - Default: `false` +- Type: `boolean` +- Default: `false` - - Enforce `expect` to be called with an `await` expression. +- Enforce `expect` to be called with an `await` expression. - ```js - // βœ… good - await expect(Promise.resolve(1)).resolves.toBe(1) - await expect(Promise.reject(1)).rejects.toBe(1) - - // ❌ bad - expect(Promise.resolve(1)).resolves.toBe(1) - expect(Promise.reject(1)).rejects.toBe(1) - ``` + ```js + // βœ… good + await expect(Promise.resolve(1)).resolves.toBe(1) + await expect(Promise.reject(1)).rejects.toBe(1) + // ❌ bad + expect(Promise.resolve(1)).resolves.toBe(1) + expect(Promise.reject(1)).rejects.toBe(1) + ``` 2. `asyncMatchers` - - Type: `string[]` - - Default: `[]` - +- Type: `string[]` +- Default: `[]` - ```js - { +```js +{ "vitest/valid-expect": ["error", { "asyncMatchers": ["toBeResolved", "toBeRejected"] }] - } - ``` - - avoid using asyncMatchers with `expect`: - +} +``` +avoid using asyncMatchers with `expect`: 3. `minArgs` - - Type: `number` - - Default: `1` +- Type: `number` +- Default: `1` - - Enforce `expect` to be called with at least `minArgs` arguments. +- Enforce `expect` to be called with at least `minArgs` arguments. - ```js - // βœ… good - expect(1).toBe(1) - expect(1, 2).toBe(1) - expect(1, 2, 3).toBe(1) - - // ❌ bad - expect().toBe(1) - expect(1).toBe() - ``` + ```js + // βœ… good + expect(1).toBe(1) + expect(1, 2).toBe(1) + expect(1, 2, 3).toBe(1) + + // ❌ bad + expect().toBe(1) + expect(1).toBe() + ``` 4. `maxArgs` - - Type: `number` - - Default: `1` - - - Enforce `expect` to be called with at most `maxArgs` arguments. - - Exception: `expect(value, "message")` is allowed. +- Type: `number` +- Default: `1` - ```js - // βœ… good - expect(1).toBe(1) - expect(1, "expect value to be one").toBe(1) - const message = "expect value to be one" - expect(1, `Error Message: ${message}`).toBe(1) +- Enforce `expect` to be called with at most `maxArgs` arguments. +- Exception: `expect(value, "message")` is allowed. - - // ❌ bad - expect(1, 2, 3, 4).toBe(1) - ``` + ```js + // βœ… good + expect(1).toBe(1) + expect(1, 'expect value to be one').toBe(1) + const message = 'expect value to be one' + expect(1, `Error Message: ${message}`).toBe(1) + + // ❌ bad + expect(1, 2, 3, 4).toBe(1) + ``` diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index 8a6cf287..aec2b1fc 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -17,13 +17,13 @@ This rule has an object option: ```json { "vitest/valid-title": [ - "error", - { - "ignoreTypeOfDescribeName": false, - "allowArguments": false, - "disallowedWords": ["skip", "only"], - "mustNotMatch": ["^\\s+$", "^\\s*\\d+\\s*$"], - "mustMatch": ["^\\s*\\w+\\s*$"] + "error", + { + "ignoreTypeOfDescribeName": false, + "allowArguments": false, + "disallowedWords": ["skip", "only"], + "mustNotMatch": ["^\\s+$", "^\\s*\\d+\\s*$"], + "mustMatch": ["^\\s*\\w+\\s*$"] } ] } @@ -38,7 +38,7 @@ Examples of **incorrect** code for this rule with the `{ "ignoreTypeOfDescribeNa ```js describe(1, () => { it('should be a number', () => { - expect(1).toBe(1) + expect(1).toBe(1) }) }) ``` @@ -48,7 +48,7 @@ Examples of **correct** code for this rule with the `{ "ignoreTypeOfDescribeName ```js describe('1', () => { it('should be a number', () => { - expect(1).toBe(1) + expect(1).toBe(1) }) }) ``` @@ -61,9 +61,7 @@ Examples of **correct** code for this rule with the `{ "allowArguments": false } ```js describe('name', () => { - it('name', () => { - - }) + it('name', () => {}) }) ``` @@ -71,9 +69,7 @@ Examples of **correct** code for this rule with the `{ "allowArguments": true }` ```js describe(foo, () => { - it(hoge, () => { - - }) + it(hoge, () => {}) }) ``` @@ -86,7 +82,7 @@ Examples of **incorrect** code for this rule with the `{ "disallowedWords": ["sk ```js describe('foo', () => { it.skip('should be skipped', () => { - expect(1).toBe(1) + expect(1).toBe(1) }) }) ``` @@ -96,7 +92,7 @@ Examples of **correct** code for this rule with the `{ "disallowedWords": ["skip ```js describe('foo', () => { it('should be skipped', () => { - expect(1).toBe(1) + expect(1).toBe(1) }) }) ``` @@ -110,7 +106,7 @@ Examples of **incorrect** code for this rule with the `{ "mustNotMatch": ["^\\s+ ```js describe('foo', () => { it(' ', () => { - expect(1).toBe(1) + expect(1).toBe(1) }) }) ``` @@ -118,10 +114,9 @@ describe('foo', () => { Examples of **correct** code for this rule with the `{ "mustNotMatch": ["^\\s+$", "^\\s*\\d+\\s*$"] }` option: ```js - describe('foo', () => { it('should be a number', () => { - expect(1).toBe(1) + expect(1).toBe(1) }) }) ``` @@ -143,7 +138,7 @@ Examples of **incorrect** code for this rule with the `{ "mustMatch": ["^\\s*\\w ```js describe('foo', () => { it(' ', () => { - expect(1).toBe(1) + expect(1).toBe(1) }) }) ``` @@ -151,10 +146,9 @@ describe('foo', () => { Examples of **correct** code for this rule with the `{ "mustMatch": ["^\\s*\\w+\\s*$"] }` option: ```js - describe('foo', () => { it('should be a number', () => { - expect(1).toBe(1) + expect(1).toBe(1) }) }) ``` @@ -188,22 +182,22 @@ Note: If you'd like to use a function or class names inside `describe`, `test` o To enable typechecking for vitest make sure settings key is added in your configuration ```js -import vitest from "eslint-plugin-vitest"; +import vitest from 'eslint-plugin-vitest' export default [ - { - files: ["tests/**"], - plugins: { - vitest - }, - rules: { - ...vitest.configs.recommended.rules - }, - settings: { + { + files: ['tests/**'], + plugins: { + vitest, + }, + rules: { + ...vitest.configs.recommended.rules, + }, + settings: { vitest: { - typecheck: true - } - } - } + typecheck: true, + }, + }, + }, ] ``` diff --git a/src/index.ts b/src/index.ts index 548a468b..b8870318 100644 --- a/src/index.ts +++ b/src/index.ts @@ -173,12 +173,7 @@ const recommended = { [noImportNodeTestName]: 'error', } as const -const plugin = { - meta: { - name: 'vitest', - version, - }, - rules: { +const rules = { [lowerCaseTitleName]: lowerCaseTitle, [maxNestedDescribeName]: maxNestedDescribe, [noIdenticalTitleName]: noIdenticalTitle, @@ -249,7 +244,14 @@ const plugin = { [noImportingVitestGlobalsName]: noImportingVitestGlobals, [preferImportingVitestGlobalsName]: preferImportingVitestGlobals, [preferCalledTimesName]: preferCalledTimes +} + +const plugin = { + meta: { + name: 'vitest', + version, }, + rules, environments: { env: { globals: { diff --git a/src/rules/expect-expect.ts b/src/rules/expect-expect.ts index e698f2a4..8c52761a 100644 --- a/src/rules/expect-expect.ts +++ b/src/rules/expect-expect.ts @@ -21,7 +21,7 @@ export default createEslintRule({ type: 'suggestion', docs: { description: 'enforce having expectation in test body', - recommended: false, + recommended: true, }, schema: [ { diff --git a/src/rules/no-commented-out-tests.ts b/src/rules/no-commented-out-tests.ts index 874ac371..08464b37 100644 --- a/src/rules/no-commented-out-tests.ts +++ b/src/rules/no-commented-out-tests.ts @@ -17,7 +17,7 @@ export default createEslintRule({ docs: { description: 'disallow commented out tests', requiresTypeChecking: false, - recommended: false, + recommended: true, }, messages: { noCommentedOutTests: diff --git a/src/rules/no-identical-title.ts b/src/rules/no-identical-title.ts index d29fa634..ee8fe363 100644 --- a/src/rules/no-identical-title.ts +++ b/src/rules/no-identical-title.ts @@ -29,7 +29,7 @@ export default createEslintRule({ type: 'problem', docs: { description: 'disallow identical titles', - recommended: false, + recommended: true, }, fixable: 'code', schema: [], diff --git a/src/rules/no-import-node-test.ts b/src/rules/no-import-node-test.ts index 7d85602a..47ff3858 100644 --- a/src/rules/no-import-node-test.ts +++ b/src/rules/no-import-node-test.ts @@ -9,7 +9,7 @@ export default createEslintRule({ meta: { docs: { description: 'disallow importing `node:test`', - recommended: false, + recommended: true, }, type: 'suggestion', messages: { diff --git a/src/rules/require-local-test-context-for-concurrent-snapshots.ts b/src/rules/require-local-test-context-for-concurrent-snapshots.ts index ba1aa1ce..57dfe1d2 100644 --- a/src/rules/require-local-test-context-for-concurrent-snapshots.ts +++ b/src/rules/require-local-test-context-for-concurrent-snapshots.ts @@ -12,7 +12,7 @@ export default createEslintRule({ meta: { docs: { description: 'require local Test Context for concurrent snapshot tests', - recommended: false, + recommended: true, }, messages: { requireLocalTestContext: 'Use local Test Context instead', diff --git a/src/rules/valid-describe-callback.ts b/src/rules/valid-describe-callback.ts index 0ff52fac..fe5bef16 100644 --- a/src/rules/valid-describe-callback.ts +++ b/src/rules/valid-describe-callback.ts @@ -62,7 +62,7 @@ export default createEslintRule({ type: 'problem', docs: { description: 'enforce valid describe callback', - recommended: false, + recommended: true, }, messages: { nameAndCallback: 'Describe requires a name and callback arguments', diff --git a/src/rules/valid-expect.ts b/src/rules/valid-expect.ts index 0f724e6d..f9a543f7 100644 --- a/src/rules/valid-expect.ts +++ b/src/rules/valid-expect.ts @@ -134,7 +134,7 @@ export default createEslintRule< meta: { docs: { description: 'enforce valid `expect()` usage', - recommended: false, + recommended: true, }, messages: { tooManyArgs: 'Expect takes at most {{ amount}} argument{{ s }}', diff --git a/src/rules/valid-title.ts b/src/rules/valid-title.ts index 6758a909..8aa7a087 100644 --- a/src/rules/valid-title.ts +++ b/src/rules/valid-title.ts @@ -124,7 +124,7 @@ export default createEslintRule({ meta: { docs: { description: 'enforce valid titles', - recommended: false, + recommended: true, }, messages: { titleMustBeString: From dec9e3af72cb5adae7c4ff44611786eaa89f0ddf Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Mon, 23 Jun 2025 00:51:41 -0400 Subject: [PATCH 09/11] chore: update eslint rule docs configs --- .eslint-doc-generatorrc.js | 3 +- README.md | 140 +++++++++--------- docs/rules/consistent-test-filename.md | 2 +- docs/rules/consistent-test-it.md | 2 +- docs/rules/consistent-vitest-vi.md | 2 +- docs/rules/expect-expect.md | 2 +- docs/rules/max-expects.md | 2 +- docs/rules/max-nested-describe.md | 2 +- docs/rules/no-alias-methods.md | 2 +- docs/rules/no-commented-out-tests.md | 2 +- docs/rules/no-conditional-expect.md | 2 +- docs/rules/no-conditional-in-test.md | 2 +- docs/rules/no-conditional-tests.md | 2 +- docs/rules/no-disabled-tests.md | 2 +- docs/rules/no-done-callback.md | 2 +- docs/rules/no-duplicate-hooks.md | 2 +- docs/rules/no-focused-tests.md | 2 +- docs/rules/no-hooks.md | 2 +- docs/rules/no-identical-title.md | 2 +- docs/rules/no-import-node-test.md | 2 +- docs/rules/no-importing-vitest-globals.md | 2 +- docs/rules/no-interpolation-in-snapshots.md | 2 +- docs/rules/no-large-snapshots.md | 2 +- docs/rules/no-mocks-import.md | 2 +- docs/rules/no-restricted-matchers.md | 2 +- docs/rules/no-restricted-vi-methods.md | 2 +- docs/rules/no-standalone-expect.md | 2 +- docs/rules/no-test-prefixes.md | 2 +- docs/rules/no-test-return-statement.md | 2 +- docs/rules/padding-around-after-all-blocks.md | 2 +- .../rules/padding-around-after-each-blocks.md | 2 +- docs/rules/padding-around-all.md | 2 +- .../rules/padding-around-before-all-blocks.md | 2 +- .../padding-around-before-each-blocks.md | 2 +- docs/rules/padding-around-describe-blocks.md | 2 +- docs/rules/padding-around-expect-groups.md | 2 +- docs/rules/padding-around-test-blocks.md | 2 +- docs/rules/prefer-called-times.md | 2 +- docs/rules/prefer-called-with.md | 2 +- docs/rules/prefer-comparison-matcher.md | 2 +- docs/rules/prefer-describe-function-title.md | 2 +- docs/rules/prefer-each.md | 2 +- docs/rules/prefer-equality-matcher.md | 2 +- docs/rules/prefer-expect-assertions.md | 2 +- docs/rules/prefer-expect-resolves.md | 2 +- docs/rules/prefer-hooks-in-order.md | 2 +- docs/rules/prefer-hooks-on-top.md | 2 +- docs/rules/prefer-importing-vitest-globals.md | 2 +- docs/rules/prefer-lowercase-title.md | 2 +- docs/rules/prefer-mock-promise-shorthand.md | 2 +- docs/rules/prefer-snapshot-hint.md | 2 +- docs/rules/prefer-spy-on.md | 2 +- docs/rules/prefer-strict-boolean-matchers.md | 2 +- docs/rules/prefer-strict-equal.md | 2 +- docs/rules/prefer-to-be-falsy.md | 2 +- docs/rules/prefer-to-be-object.md | 2 +- docs/rules/prefer-to-be-truthy.md | 2 +- docs/rules/prefer-to-be.md | 2 +- docs/rules/prefer-to-contain.md | 2 +- docs/rules/prefer-to-have-length.md | 2 +- docs/rules/prefer-todo.md | 2 +- docs/rules/prefer-vi-mocked.md | 2 +- docs/rules/require-hook.md | 2 +- ...l-test-context-for-concurrent-snapshots.md | 2 +- docs/rules/require-mock-type-parameters.md | 2 +- docs/rules/require-to-throw-message.md | 2 +- docs/rules/require-top-level-describe.md | 2 +- docs/rules/valid-describe-callback.md | 2 +- docs/rules/valid-expect-in-promise.md | 2 +- docs/rules/valid-expect.md | 2 +- docs/rules/valid-title.md | 2 +- 71 files changed, 141 insertions(+), 140 deletions(-) diff --git a/.eslint-doc-generatorrc.js b/.eslint-doc-generatorrc.js index e8357c6e..bfa9be88 100644 --- a/.eslint-doc-generatorrc.js +++ b/.eslint-doc-generatorrc.js @@ -3,9 +3,10 @@ import prettier from 'prettier' /** @type {import('eslint-doc-generator').GenerateOptions} */ const config = { configEmoji: [ + ['all', '🟒'], ['recommended', 'βœ…'], ['legacy-recommended', 'β˜‘οΈ'], - ['legacy-all', '🌍'], + ['legacy-all', 'πŸ”΅'], ], postprocess: async (content, path) => prettier.format(content, { diff --git a/README.md b/README.md index 69769a49..6831afad 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ export default [ πŸ’Ό Configurations enabled in.\ ⚠️ Configurations set to warn in.\ 🚫 Configurations disabled in.\ -🌍 Set in the `legacy-all` configuration.\ +πŸ”΅ Set in the `legacy-all` configuration.\ β˜‘οΈ Set in the `legacy-recommended` configuration.\ πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\ @@ -155,75 +155,75 @@ export default [ | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | | :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | :-- | :-- | -| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | 🌍 | | | | | | -| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌍 | | πŸ”§ | | | | -| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌍 | | πŸ”§ | | | | -| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | β˜‘οΈ | 🌍 | | | | | | -| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | 🌍 | | | | | | -| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | 🌍 | | | | | | -| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | 🌍 | | πŸ”§ | | | | -| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | β˜‘οΈ | 🌍 | | | | | | -| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | 🌍 | | | | | | -| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | 🌍 | | | | | | -| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | 🌍 | | | | | | -| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | 🌍 | | | | | | -| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | 🌍 | | | πŸ’‘ | | ❌ | -| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | 🌍 | | | | | | -| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | 🌍 | | πŸ”§ | | | | -| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | 🌍 | | | | | | -| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | β˜‘οΈ | 🌍 | | πŸ”§ | | | | -| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | β˜‘οΈ | 🌍 | | πŸ”§ | | | | -| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | 🌍 | πŸ”§ | | | | -| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | 🌍 | | πŸ”§ | | | | -| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | 🌍 | | | | | | -| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from **mocks** directory | | 🌍 | | | | | | -| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | 🌍 | | | | | | -| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | 🌍 | | | | | | -| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌍 | | | | | | -| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | 🌍 | | πŸ”§ | | | | -| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌍 | | | | | | -| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | 🌍 | | πŸ”§ | | | | -| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | 🌍 | | πŸ”§ | | | | -| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | 🌍 | | πŸ”§ | | | | -| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | 🌍 | | πŸ”§ | | | | -| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | 🌍 | | πŸ”§ | | | | -| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌍 | | πŸ”§ | | | | -| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌍 | | πŸ”§ | | | | -| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | 🌍 | | πŸ”§ | | | | -| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌍 | | | | | | -| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | 🌍 | | | πŸ’‘ | | | -| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | 🌍 | | | πŸ’‘ | | | -| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | 🌍 | | πŸ”§ | | | | -| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌍 | | | | | | -| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌍 | | | | | | -| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌍 | | πŸ”§ | | | | -| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌍 | | πŸ”§ | | | | -| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌍 | | πŸ”§ | | | | -| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | 🌍 | | | | | | -| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | 🌍 | | πŸ”§ | | | | -| [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 | | 🌍 | | πŸ”§ | | | | -| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | 🌍 | | | πŸ’‘ | | | -| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | 🌍 | | πŸ”§ | | | | -| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | 🌍 | πŸ”§ | | | | -| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | 🌍 | | πŸ”§ | | | | -| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | 🌍 | πŸ”§ | | | | -| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | 🌍 | | πŸ”§ | | | | -| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | 🌍 | | πŸ”§ | | | | -| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | 🌍 | | πŸ”§ | | | | -| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | 🌍 | | πŸ”§ | | πŸ’­ | | -| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | 🌍 | | | | | | -| [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 | β˜‘οΈ | 🌍 | | | | | | -| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | 🌍 | | πŸ”§ | | | | -| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | 🌍 | | | | | | -| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | 🌍 | | | | | | -| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | β˜‘οΈ | 🌍 | | | | | | -| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | β˜‘οΈ | 🌍 | | πŸ”§ | | | | -| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | 🌍 | | | | | | -| [valid-title](docs/rules/valid-title.md) | enforce valid titles | β˜‘οΈ | 🌍 | | πŸ”§ | | | | +| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | πŸ”΅ | | | | | | +| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | πŸ”΅ | | πŸ”§ | | | | +| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | πŸ”΅ | | πŸ”§ | | | | +| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | β˜‘οΈ | πŸ”΅ | | | | | | +| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | πŸ”΅ | | | | | | +| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | πŸ”΅ | | | | | | +| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | πŸ”΅ | | πŸ”§ | | | | +| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | β˜‘οΈ | πŸ”΅ | | | | | | +| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | πŸ”΅ | | | | | | +| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | πŸ”΅ | | | | | | +| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | πŸ”΅ | | | | | | +| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | πŸ”΅ | | | | | | +| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | πŸ”΅ | | | πŸ’‘ | | ❌ | +| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | πŸ”΅ | | | | | | +| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | πŸ”΅ | | πŸ”§ | | | | +| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | πŸ”΅ | | | | | | +| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | β˜‘οΈ | πŸ”΅ | | πŸ”§ | | | | +| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | β˜‘οΈ | πŸ”΅ | | πŸ”§ | | | | +| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | πŸ”΅ | πŸ”§ | | | | +| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | πŸ”΅ | | πŸ”§ | | | | +| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | πŸ”΅ | | | | | | +| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from **mocks** directory | | πŸ”΅ | | | | | | +| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | πŸ”΅ | | | | | | +| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | πŸ”΅ | | | | | | +| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | πŸ”΅ | | | | | | +| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | πŸ”΅ | | πŸ”§ | | | | +| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | πŸ”΅ | | | | | | +| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | πŸ”΅ | | πŸ”§ | | | | +| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | πŸ”΅ | | πŸ”§ | | | | +| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | πŸ”΅ | | πŸ”§ | | | | +| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | πŸ”΅ | | πŸ”§ | | | | +| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | πŸ”΅ | | πŸ”§ | | | | +| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | πŸ”΅ | | πŸ”§ | | | | +| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | πŸ”΅ | | πŸ”§ | | | | +| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | πŸ”΅ | | | | | | +| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | πŸ”΅ | | | πŸ’‘ | | | +| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | πŸ”΅ | | | πŸ’‘ | | | +| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | πŸ”΅ | | | | | | +| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | πŸ”΅ | | | | | | +| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | πŸ”΅ | | | | | | +| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | πŸ”΅ | | πŸ”§ | | | | +| [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 | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | πŸ”΅ | | | πŸ’‘ | | | +| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | πŸ”΅ | πŸ”§ | | | | +| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | πŸ”΅ | πŸ”§ | | | | +| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | πŸ”΅ | | πŸ”§ | | πŸ’­ | | +| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | πŸ”΅ | | | | | | +| [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 | β˜‘οΈ | πŸ”΅ | | | | | | +| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | πŸ”΅ | | πŸ”§ | | | | +| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | πŸ”΅ | | | | | | +| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | πŸ”΅ | | | | | | +| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | β˜‘οΈ | πŸ”΅ | | | | | | +| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | β˜‘οΈ | πŸ”΅ | | πŸ”§ | | | | +| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | πŸ”΅ | | | | | | +| [valid-title](docs/rules/valid-title.md) | enforce valid titles | β˜‘οΈ | πŸ”΅ | | πŸ”§ | | | | diff --git a/docs/rules/consistent-test-filename.md b/docs/rules/consistent-test-filename.md index e8fc10b0..8a2b42a9 100644 --- a/docs/rules/consistent-test-filename.md +++ b/docs/rules/consistent-test-filename.md @@ -1,6 +1,6 @@ # consistent-test-filename -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index 9355e7d3..0534d763 100644 --- a/docs/rules/consistent-test-it.md +++ b/docs/rules/consistent-test-it.md @@ -1,6 +1,6 @@ # consistent-test-it -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/consistent-vitest-vi.md b/docs/rules/consistent-vitest-vi.md index dfdd8936..92a83aa4 100644 --- a/docs/rules/consistent-vitest-vi.md +++ b/docs/rules/consistent-vitest-vi.md @@ -1,6 +1,6 @@ # consistent-vitest-vi -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index 3a612fae..4ba3852e 100644 --- a/docs/rules/expect-expect.md +++ b/docs/rules/expect-expect.md @@ -1,6 +1,6 @@ # expect-expect -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/max-expects.md b/docs/rules/max-expects.md index f921469b..ba9749ab 100644 --- a/docs/rules/max-expects.md +++ b/docs/rules/max-expects.md @@ -1,6 +1,6 @@ # max-expects -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/max-nested-describe.md b/docs/rules/max-nested-describe.md index e0b9dba6..42b47127 100644 --- a/docs/rules/max-nested-describe.md +++ b/docs/rules/max-nested-describe.md @@ -1,6 +1,6 @@ # max-nested-describe -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index 6476b0ef..28c8bbf2 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -1,6 +1,6 @@ # no-alias-methods -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-commented-out-tests.md b/docs/rules/no-commented-out-tests.md index 0d3e3042..30cc0254 100644 --- a/docs/rules/no-commented-out-tests.md +++ b/docs/rules/no-commented-out-tests.md @@ -1,6 +1,6 @@ # no-commented-out-tests -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-conditional-expect.md b/docs/rules/no-conditional-expect.md index 7ace0bba..9775bed5 100644 --- a/docs/rules/no-conditional-expect.md +++ b/docs/rules/no-conditional-expect.md @@ -1,6 +1,6 @@ # no-conditional-expect -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-conditional-in-test.md b/docs/rules/no-conditional-in-test.md index 62558677..91e771f7 100644 --- a/docs/rules/no-conditional-in-test.md +++ b/docs/rules/no-conditional-in-test.md @@ -1,6 +1,6 @@ # no-conditional-in-test -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-conditional-tests.md b/docs/rules/no-conditional-tests.md index 9b4eec6b..5d087454 100644 --- a/docs/rules/no-conditional-tests.md +++ b/docs/rules/no-conditional-tests.md @@ -1,6 +1,6 @@ # no-conditional-tests -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-disabled-tests.md b/docs/rules/no-disabled-tests.md index 7a86ed5b..52ad001c 100644 --- a/docs/rules/no-disabled-tests.md +++ b/docs/rules/no-disabled-tests.md @@ -1,6 +1,6 @@ # no-disabled-tests -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-done-callback.md b/docs/rules/no-done-callback.md index 732c55ad..888f96dd 100644 --- a/docs/rules/no-done-callback.md +++ b/docs/rules/no-done-callback.md @@ -2,7 +2,7 @@ ❌ This rule is deprecated. -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index 01624e01..b321d26e 100644 --- a/docs/rules/no-duplicate-hooks.md +++ b/docs/rules/no-duplicate-hooks.md @@ -1,6 +1,6 @@ # no-duplicate-hooks -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index e0f5552f..5de60b32 100644 --- a/docs/rules/no-focused-tests.md +++ b/docs/rules/no-focused-tests.md @@ -1,6 +1,6 @@ # no-focused-tests -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index c94a808d..9ed280c4 100644 --- a/docs/rules/no-hooks.md +++ b/docs/rules/no-hooks.md @@ -1,6 +1,6 @@ # no-hooks -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index f9a58ae2..ee00521e 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -1,6 +1,6 @@ # no-identical-title -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-import-node-test.md b/docs/rules/no-import-node-test.md index 480baab7..c6ac32db 100644 --- a/docs/rules/no-import-node-test.md +++ b/docs/rules/no-import-node-test.md @@ -1,6 +1,6 @@ # no-import-node-test -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-importing-vitest-globals.md b/docs/rules/no-importing-vitest-globals.md index 7c86ac8b..f4c481c6 100644 --- a/docs/rules/no-importing-vitest-globals.md +++ b/docs/rules/no-importing-vitest-globals.md @@ -1,6 +1,6 @@ # no-importing-vitest-globals -🚫 This rule is _disabled_ in the 🌍 `legacy-all` config. +🚫 This rule is _disabled_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-interpolation-in-snapshots.md b/docs/rules/no-interpolation-in-snapshots.md index 214d276f..4ebe665a 100644 --- a/docs/rules/no-interpolation-in-snapshots.md +++ b/docs/rules/no-interpolation-in-snapshots.md @@ -1,6 +1,6 @@ # no-interpolation-in-snapshots -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index efb0fe89..8f4feae7 100644 --- a/docs/rules/no-large-snapshots.md +++ b/docs/rules/no-large-snapshots.md @@ -1,6 +1,6 @@ # no-large-snapshots -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-mocks-import.md b/docs/rules/no-mocks-import.md index e9aa1f58..db9d2d93 100644 --- a/docs/rules/no-mocks-import.md +++ b/docs/rules/no-mocks-import.md @@ -1,6 +1,6 @@ # no-mocks-import -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-restricted-matchers.md b/docs/rules/no-restricted-matchers.md index 9d226fe4..578950ba 100644 --- a/docs/rules/no-restricted-matchers.md +++ b/docs/rules/no-restricted-matchers.md @@ -1,6 +1,6 @@ # no-restricted-matchers -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-restricted-vi-methods.md b/docs/rules/no-restricted-vi-methods.md index 814f4a69..2d809aa3 100644 --- a/docs/rules/no-restricted-vi-methods.md +++ b/docs/rules/no-restricted-vi-methods.md @@ -1,6 +1,6 @@ # no-restricted-vi-methods -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-standalone-expect.md b/docs/rules/no-standalone-expect.md index e1d4b828..a29337fa 100644 --- a/docs/rules/no-standalone-expect.md +++ b/docs/rules/no-standalone-expect.md @@ -1,6 +1,6 @@ # no-standalone-expect -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index c7aabca2..235d06c6 100644 --- a/docs/rules/no-test-prefixes.md +++ b/docs/rules/no-test-prefixes.md @@ -1,6 +1,6 @@ # no-test-prefixes -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-test-return-statement.md b/docs/rules/no-test-return-statement.md index 706701b7..e22bcc79 100644 --- a/docs/rules/no-test-return-statement.md +++ b/docs/rules/no-test-return-statement.md @@ -1,6 +1,6 @@ # no-test-return-statement -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/padding-around-after-all-blocks.md b/docs/rules/padding-around-after-all-blocks.md index a82e7b8c..c695ee6c 100644 --- a/docs/rules/padding-around-after-all-blocks.md +++ b/docs/rules/padding-around-after-all-blocks.md @@ -1,6 +1,6 @@ # padding-around-after-all-blocks -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-after-each-blocks.md b/docs/rules/padding-around-after-each-blocks.md index 77dab636..2aa820c3 100644 --- a/docs/rules/padding-around-after-each-blocks.md +++ b/docs/rules/padding-around-after-each-blocks.md @@ -1,6 +1,6 @@ # padding-around-after-each-blocks -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-all.md b/docs/rules/padding-around-all.md index 0a9cc2b6..0f9b7224 100644 --- a/docs/rules/padding-around-all.md +++ b/docs/rules/padding-around-all.md @@ -1,6 +1,6 @@ # padding-around-all -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-all-blocks.md b/docs/rules/padding-around-before-all-blocks.md index 5fc6b292..7df640ba 100644 --- a/docs/rules/padding-around-before-all-blocks.md +++ b/docs/rules/padding-around-before-all-blocks.md @@ -1,6 +1,6 @@ # padding-around-before-all-blocks -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-each-blocks.md b/docs/rules/padding-around-before-each-blocks.md index 7dbc2fe5..3ef4a828 100644 --- a/docs/rules/padding-around-before-each-blocks.md +++ b/docs/rules/padding-around-before-each-blocks.md @@ -1,6 +1,6 @@ # padding-around-before-each-blocks -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-describe-blocks.md b/docs/rules/padding-around-describe-blocks.md index 5a20f8c0..5125d33f 100644 --- a/docs/rules/padding-around-describe-blocks.md +++ b/docs/rules/padding-around-describe-blocks.md @@ -1,6 +1,6 @@ # padding-around-describe-blocks -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-expect-groups.md b/docs/rules/padding-around-expect-groups.md index d3143f8b..cab62ebd 100644 --- a/docs/rules/padding-around-expect-groups.md +++ b/docs/rules/padding-around-expect-groups.md @@ -1,6 +1,6 @@ # padding-around-expect-groups -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-test-blocks.md b/docs/rules/padding-around-test-blocks.md index e9bf26de..ee84172d 100644 --- a/docs/rules/padding-around-test-blocks.md +++ b/docs/rules/padding-around-test-blocks.md @@ -1,6 +1,6 @@ # padding-around-test-blocks -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index db708405..95c2d179 100644 --- a/docs/rules/prefer-called-times.md +++ b/docs/rules/prefer-called-times.md @@ -1,6 +1,6 @@ # prefer-called-times -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-with.md b/docs/rules/prefer-called-with.md index 334d746a..39e33d30 100644 --- a/docs/rules/prefer-called-with.md +++ b/docs/rules/prefer-called-with.md @@ -1,6 +1,6 @@ # prefer-called-with -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-comparison-matcher.md b/docs/rules/prefer-comparison-matcher.md index 731ddf45..5c4b6e0f 100644 --- a/docs/rules/prefer-comparison-matcher.md +++ b/docs/rules/prefer-comparison-matcher.md @@ -1,6 +1,6 @@ # prefer-comparison-matcher -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-describe-function-title.md b/docs/rules/prefer-describe-function-title.md index 81f8ad39..c7bf985f 100644 --- a/docs/rules/prefer-describe-function-title.md +++ b/docs/rules/prefer-describe-function-title.md @@ -1,6 +1,6 @@ # prefer-describe-function-title -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-each.md b/docs/rules/prefer-each.md index 7252dbfe..12eee457 100644 --- a/docs/rules/prefer-each.md +++ b/docs/rules/prefer-each.md @@ -1,6 +1,6 @@ # prefer-each -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/prefer-equality-matcher.md b/docs/rules/prefer-equality-matcher.md index cff2470c..723e577f 100644 --- a/docs/rules/prefer-equality-matcher.md +++ b/docs/rules/prefer-equality-matcher.md @@ -1,6 +1,6 @@ # prefer-equality-matcher -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index 8b90de7e..7c9ea062 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -1,6 +1,6 @@ # prefer-expect-assertions -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-resolves.md b/docs/rules/prefer-expect-resolves.md index 2247cd92..e7574913 100644 --- a/docs/rules/prefer-expect-resolves.md +++ b/docs/rules/prefer-expect-resolves.md @@ -1,6 +1,6 @@ # prefer-expect-resolves -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-hooks-in-order.md b/docs/rules/prefer-hooks-in-order.md index ceee0488..7ce31c24 100644 --- a/docs/rules/prefer-hooks-in-order.md +++ b/docs/rules/prefer-hooks-in-order.md @@ -1,6 +1,6 @@ # prefer-hooks-in-order -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index d54b2e7d..3f7873cb 100644 --- a/docs/rules/prefer-hooks-on-top.md +++ b/docs/rules/prefer-hooks-on-top.md @@ -1,6 +1,6 @@ # prefer-hooks-on-top -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/prefer-importing-vitest-globals.md b/docs/rules/prefer-importing-vitest-globals.md index 69823c99..d60a77c0 100644 --- a/docs/rules/prefer-importing-vitest-globals.md +++ b/docs/rules/prefer-importing-vitest-globals.md @@ -1,6 +1,6 @@ # prefer-importing-vitest-globals -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-lowercase-title.md b/docs/rules/prefer-lowercase-title.md index 8cf308dc..5b474a87 100644 --- a/docs/rules/prefer-lowercase-title.md +++ b/docs/rules/prefer-lowercase-title.md @@ -1,6 +1,6 @@ # prefer-lowercase-title -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-mock-promise-shorthand.md b/docs/rules/prefer-mock-promise-shorthand.md index 11c423bc..55dd00a7 100644 --- a/docs/rules/prefer-mock-promise-shorthand.md +++ b/docs/rules/prefer-mock-promise-shorthand.md @@ -1,6 +1,6 @@ # prefer-mock-promise-shorthand -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-snapshot-hint.md b/docs/rules/prefer-snapshot-hint.md index a3a6e112..7236025b 100644 --- a/docs/rules/prefer-snapshot-hint.md +++ b/docs/rules/prefer-snapshot-hint.md @@ -1,6 +1,6 @@ # prefer-snapshot-hint -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index 51a38da3..5e4d0fb8 100644 --- a/docs/rules/prefer-spy-on.md +++ b/docs/rules/prefer-spy-on.md @@ -1,6 +1,6 @@ # prefer-spy-on -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-boolean-matchers.md b/docs/rules/prefer-strict-boolean-matchers.md index feb6a2f8..d334721f 100644 --- a/docs/rules/prefer-strict-boolean-matchers.md +++ b/docs/rules/prefer-strict-boolean-matchers.md @@ -1,6 +1,6 @@ # prefer-strict-boolean-matchers -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index 1f8d34db..2e57004c 100644 --- a/docs/rules/prefer-strict-equal.md +++ b/docs/rules/prefer-strict-equal.md @@ -1,6 +1,6 @@ # prefer-strict-equal -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-to-be-falsy.md b/docs/rules/prefer-to-be-falsy.md index e047d8a9..9efaf648 100644 --- a/docs/rules/prefer-to-be-falsy.md +++ b/docs/rules/prefer-to-be-falsy.md @@ -1,6 +1,6 @@ # prefer-to-be-falsy -🚫 This rule is _disabled_ in the 🌍 `legacy-all` config. +🚫 This rule is _disabled_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-object.md b/docs/rules/prefer-to-be-object.md index 4ad41b79..c3f352f8 100644 --- a/docs/rules/prefer-to-be-object.md +++ b/docs/rules/prefer-to-be-object.md @@ -1,6 +1,6 @@ # prefer-to-be-object -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-truthy.md b/docs/rules/prefer-to-be-truthy.md index 14ef7d5b..acf7797e 100644 --- a/docs/rules/prefer-to-be-truthy.md +++ b/docs/rules/prefer-to-be-truthy.md @@ -1,6 +1,6 @@ # prefer-to-be-truthy -🚫 This rule is _disabled_ in the 🌍 `legacy-all` config. +🚫 This rule is _disabled_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be.md b/docs/rules/prefer-to-be.md index 9861ccac..2bf66e6e 100644 --- a/docs/rules/prefer-to-be.md +++ b/docs/rules/prefer-to-be.md @@ -1,6 +1,6 @@ # prefer-to-be -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index 1a5374f5..3b17595b 100644 --- a/docs/rules/prefer-to-contain.md +++ b/docs/rules/prefer-to-contain.md @@ -1,6 +1,6 @@ # prefer-to-contain -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index f96a5f14..2c05adca 100644 --- a/docs/rules/prefer-to-have-length.md +++ b/docs/rules/prefer-to-have-length.md @@ -1,6 +1,6 @@ # prefer-to-have-length -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index faba15a8..a9758dd7 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -1,6 +1,6 @@ # prefer-todo -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-vi-mocked.md b/docs/rules/prefer-vi-mocked.md index 434c1385..89dc379a 100644 --- a/docs/rules/prefer-vi-mocked.md +++ b/docs/rules/prefer-vi-mocked.md @@ -1,6 +1,6 @@ # prefer-vi-mocked -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-hook.md b/docs/rules/require-hook.md index 0c14a5c1..17141998 100644 --- a/docs/rules/require-hook.md +++ b/docs/rules/require-hook.md @@ -1,6 +1,6 @@ # require-hook -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/require-local-test-context-for-concurrent-snapshots.md b/docs/rules/require-local-test-context-for-concurrent-snapshots.md index 5907606e..67234202 100644 --- a/docs/rules/require-local-test-context-for-concurrent-snapshots.md +++ b/docs/rules/require-local-test-context-for-concurrent-snapshots.md @@ -1,6 +1,6 @@ # require-local-test-context-for-concurrent-snapshots -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/require-mock-type-parameters.md b/docs/rules/require-mock-type-parameters.md index 6af175c3..40bcd6be 100644 --- a/docs/rules/require-mock-type-parameters.md +++ b/docs/rules/require-mock-type-parameters.md @@ -1,6 +1,6 @@ # require-mock-type-parameters -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index ed385152..1c51cb6e 100644 --- a/docs/rules/require-to-throw-message.md +++ b/docs/rules/require-to-throw-message.md @@ -1,6 +1,6 @@ # require-to-throw-message -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index 2cc8a15a..30b56f0f 100644 --- a/docs/rules/require-top-level-describe.md +++ b/docs/rules/require-top-level-describe.md @@ -1,6 +1,6 @@ # require-top-level-describe -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/valid-describe-callback.md b/docs/rules/valid-describe-callback.md index c36d9099..b043759f 100644 --- a/docs/rules/valid-describe-callback.md +++ b/docs/rules/valid-describe-callback.md @@ -1,6 +1,6 @@ # valid-describe-callback -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index c3df3f3f..54008eae 100644 --- a/docs/rules/valid-expect-in-promise.md +++ b/docs/rules/valid-expect-in-promise.md @@ -1,6 +1,6 @@ # valid-expect-in-promise -⚠️ This rule _warns_ in the 🌍 `legacy-all` config. +⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index edd9a101..902df9ce 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -1,6 +1,6 @@ # valid-expect -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index aec2b1fc..ba1432ff 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -1,6 +1,6 @@ # valid-title -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the 🌍 `legacy-all` config. +πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). From 8d79120286b554244f96da2fd39f6459ac142550 Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Mon, 23 Jun 2025 01:10:30 -0400 Subject: [PATCH 10/11] chore: update eslint rule docs configs --- README.md | 2 +- docs/rules/prefer-called-times.md | 2 ++ package.json | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6831afad..51e1a6a8 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ export default [ | [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | πŸ”΅ | | πŸ”§ | | | | | [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | πŸ”΅ | | πŸ”§ | | | | | [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | πŸ”΅ | | πŸ”§ | | | | +| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | πŸ”΅ | | πŸ”§ | | πŸ’­ | | | [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | πŸ”΅ | | πŸ”§ | | | | | [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | πŸ”΅ | | πŸ”§ | | | | | [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | πŸ”΅ | | πŸ”§ | | | | diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index 95c2d179..8d7fdf17 100644 --- a/docs/rules/prefer-called-times.md +++ b/docs/rules/prefer-called-times.md @@ -4,6 +4,8 @@ πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). +πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting). + ## Rule Details diff --git a/package.json b/package.json index 0610e41b..f80facbe 100644 --- a/package.json +++ b/package.json @@ -39,17 +39,17 @@ ], "scripts": { "build": "unbuild --config unbuild.config.ts", - "lint:eslint-docs": "pnpm build && eslint-doc-generator --check", + "lint:eslint-docs": "eslint-doc-generator --check", "lint:js": "eslint .", "lint": "concurrently --prefixColors auto \"pnpm:lint:*\"", "release": "bumpp package.json --commit --push --tag && pnpm build && pnpm publish", "stub": "unbuild --stub", "test:ci": "npm run format:check && vitest run", - "format:check": "npx prettier 'src/**/*.ts' --check", - "format:fix": "npx prettier '**/*.{ts,js}' --write", + "format:check": "prettier 'src/**/*.ts' --check", + "format:fix": "prettier '**/*.{ts,js}' --write", "test": "vitest", "generate": "tsx scripts/generate.ts", - "update:eslint-docs": "pnpm build && eslint-doc-generator", + "build:docs": "pnpm build && eslint-doc-generator", "tsc": "tsc --noEmit" }, "dependencies": { From 6aa9f12e1543ef5ccdad63bf9120e7b27c4fd583 Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Mon, 23 Jun 2025 02:19:28 -0400 Subject: [PATCH 11/11] chore: remove docs overhead --- .eslint-doc-generatorrc.js | 7 +- .github/workflows/ci.yml | 3 + README.md | 147 +++++++++--------- docs/rules/consistent-test-filename.md | 2 - docs/rules/consistent-test-it.md | 2 - docs/rules/consistent-vitest-vi.md | 2 - docs/rules/expect-expect.md | 2 - docs/rules/max-expects.md | 2 - docs/rules/max-nested-describe.md | 2 - docs/rules/no-alias-methods.md | 2 - docs/rules/no-commented-out-tests.md | 2 - docs/rules/no-conditional-expect.md | 2 - docs/rules/no-conditional-in-test.md | 2 - docs/rules/no-conditional-tests.md | 2 - docs/rules/no-disabled-tests.md | 2 - docs/rules/no-done-callback.md | 2 - docs/rules/no-duplicate-hooks.md | 2 - docs/rules/no-focused-tests.md | 2 - docs/rules/no-hooks.md | 2 - docs/rules/no-identical-title.md | 2 - docs/rules/no-import-node-test.md | 2 - docs/rules/no-importing-vitest-globals.md | 2 - docs/rules/no-interpolation-in-snapshots.md | 2 - docs/rules/no-large-snapshots.md | 2 - docs/rules/no-mocks-import.md | 2 - docs/rules/no-restricted-matchers.md | 2 - docs/rules/no-restricted-vi-methods.md | 2 - docs/rules/no-standalone-expect.md | 2 - docs/rules/no-test-prefixes.md | 2 - docs/rules/no-test-return-statement.md | 2 - docs/rules/padding-around-after-all-blocks.md | 2 - .../rules/padding-around-after-each-blocks.md | 2 - docs/rules/padding-around-all.md | 2 - .../rules/padding-around-before-all-blocks.md | 2 - .../padding-around-before-each-blocks.md | 2 - docs/rules/padding-around-describe-blocks.md | 2 - docs/rules/padding-around-expect-groups.md | 2 - docs/rules/padding-around-test-blocks.md | 2 - docs/rules/prefer-called-times.md | 4 - docs/rules/prefer-called-with.md | 2 - docs/rules/prefer-comparison-matcher.md | 2 - docs/rules/prefer-describe-function-title.md | 2 - docs/rules/prefer-each.md | 2 - docs/rules/prefer-equality-matcher.md | 2 - docs/rules/prefer-expect-assertions.md | 2 - docs/rules/prefer-expect-resolves.md | 2 - docs/rules/prefer-hooks-in-order.md | 2 - docs/rules/prefer-hooks-on-top.md | 2 - docs/rules/prefer-importing-vitest-globals.md | 2 - docs/rules/prefer-lowercase-title.md | 2 - docs/rules/prefer-mock-promise-shorthand.md | 2 - docs/rules/prefer-snapshot-hint.md | 2 - docs/rules/prefer-spy-on.md | 2 - docs/rules/prefer-strict-boolean-matchers.md | 2 - docs/rules/prefer-strict-equal.md | 2 - docs/rules/prefer-to-be-falsy.md | 2 - docs/rules/prefer-to-be-object.md | 2 - docs/rules/prefer-to-be-truthy.md | 2 - docs/rules/prefer-to-be.md | 2 - docs/rules/prefer-to-contain.md | 2 - docs/rules/prefer-to-have-length.md | 2 - docs/rules/prefer-todo.md | 2 - docs/rules/prefer-vi-mocked.md | 2 - docs/rules/require-hook.md | 2 - ...l-test-context-for-concurrent-snapshots.md | 2 - docs/rules/require-mock-type-parameters.md | 2 - docs/rules/require-to-throw-message.md | 2 - docs/rules/require-top-level-describe.md | 2 - docs/rules/valid-describe-callback.md | 2 - docs/rules/valid-expect-in-promise.md | 2 - docs/rules/valid-expect.md | 2 - docs/rules/valid-title.md | 2 - eslint.config.js | 2 +- package.json | 2 +- pnpm-lock.yaml | 10 +- src/index.ts | 4 +- 76 files changed, 84 insertions(+), 231 deletions(-) diff --git a/.eslint-doc-generatorrc.js b/.eslint-doc-generatorrc.js index bfa9be88..64cb4b97 100644 --- a/.eslint-doc-generatorrc.js +++ b/.eslint-doc-generatorrc.js @@ -2,12 +2,7 @@ import prettier from 'prettier' /** @type {import('eslint-doc-generator').GenerateOptions} */ const config = { - configEmoji: [ - ['all', '🟒'], - ['recommended', 'βœ…'], - ['legacy-recommended', 'β˜‘οΈ'], - ['legacy-all', 'πŸ”΅'], - ], + ignoreConfig: ['legacy-all', 'legacy-recommended'], postprocess: async (content, path) => prettier.format(content, { ...(await prettier.resolveConfig(path)), diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 861df51b..789aac75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,5 +51,8 @@ jobs: - name: lint code run: pnpm lint:js + - name: lint docs + run: pnpm lint:eslint-docs + - name: test run: pnpm test:ci diff --git a/README.md b/README.md index 51e1a6a8..5a42aa92 100644 --- a/README.md +++ b/README.md @@ -143,87 +143,82 @@ export default [ -πŸ’Ό Configurations enabled in.\ -⚠️ Configurations set to warn in.\ -🚫 Configurations disabled in.\ -πŸ”΅ Set in the `legacy-all` configuration.\ -β˜‘οΈ Set in the `legacy-recommended` configuration.\ πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\ πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).\ ❌ Deprecated. -| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ⚠️ | 🚫 | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | -| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | :-- | :-- | -| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | πŸ”΅ | | | | | | -| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | πŸ”΅ | | πŸ”§ | | | | -| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | πŸ”΅ | | πŸ”§ | | | | -| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | β˜‘οΈ | πŸ”΅ | | | | | | -| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | πŸ”΅ | | | | | | -| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | πŸ”΅ | | | | | | -| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | | πŸ”΅ | | πŸ”§ | | | | -| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | β˜‘οΈ | πŸ”΅ | | | | | | -| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | πŸ”΅ | | | | | | -| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | πŸ”΅ | | | | | | -| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | πŸ”΅ | | | | | | -| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | πŸ”΅ | | | | | | -| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | πŸ”΅ | | | πŸ’‘ | | ❌ | -| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | πŸ”΅ | | | | | | -| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | | πŸ”΅ | | πŸ”§ | | | | -| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | πŸ”΅ | | | | | | -| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | β˜‘οΈ | πŸ”΅ | | πŸ”§ | | | | -| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | β˜‘οΈ | πŸ”΅ | | πŸ”§ | | | | -| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | | | πŸ”΅ | πŸ”§ | | | | -| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | | πŸ”΅ | | πŸ”§ | | | | -| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | πŸ”΅ | | | | | | -| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from **mocks** directory | | πŸ”΅ | | | | | | -| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | πŸ”΅ | | | | | | -| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | πŸ”΅ | | | | | | -| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | πŸ”΅ | | | | | | -| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | | πŸ”΅ | | πŸ”§ | | | | -| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | πŸ”΅ | | | | | | -| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | πŸ”΅ | | πŸ”§ | | | | -| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | πŸ”΅ | | πŸ”§ | | | | -| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | | πŸ”΅ | | πŸ”§ | | | | -| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | | πŸ”΅ | | πŸ”§ | | | | -| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | | πŸ”΅ | | πŸ”§ | | | | -| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | | πŸ”΅ | | πŸ”§ | | | | -| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | | πŸ”΅ | | πŸ”§ | | | | -| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | | πŸ”΅ | | πŸ”§ | | πŸ’­ | | -| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | πŸ”΅ | | | | | | -| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | πŸ”΅ | | | πŸ’‘ | | | -| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | πŸ”΅ | | | πŸ’‘ | | | -| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | πŸ”΅ | | | | | | -| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | πŸ”΅ | | | | | | -| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | πŸ”΅ | | | | | | -| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | | πŸ”΅ | | πŸ”§ | | | | -| [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 | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | πŸ”΅ | | | πŸ’‘ | | | -| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | | | πŸ”΅ | πŸ”§ | | | | -| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | | | πŸ”΅ | πŸ”§ | | | | -| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | | πŸ”΅ | | πŸ”§ | | | | -| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | | πŸ”΅ | | πŸ”§ | | πŸ’­ | | -| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | πŸ”΅ | | | | | | -| [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 | β˜‘οΈ | πŸ”΅ | | | | | | -| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | | πŸ”΅ | | πŸ”§ | | | | -| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | πŸ”΅ | | | | | | -| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | πŸ”΅ | | | | | | -| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | β˜‘οΈ | πŸ”΅ | | | | | | -| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | β˜‘οΈ | πŸ”΅ | | πŸ”§ | | | | -| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | πŸ”΅ | | | | | | -| [valid-title](docs/rules/valid-title.md) | enforce valid titles | β˜‘οΈ | πŸ”΅ | | πŸ”§ | | | | +| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | +| :----------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | +| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | | | | +| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | πŸ”§ | | | | +| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | πŸ”§ | | | | +| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body | | | | | +| [max-expects](docs/rules/max-expects.md) | enforce a maximum number of expect per test | | | | | +| [max-nested-describe](docs/rules/max-nested-describe.md) | require describe block to be less than set max value or default value | | | | | +| [no-alias-methods](docs/rules/no-alias-methods.md) | disallow alias methods | πŸ”§ | | | | +| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | disallow commented out tests | | | | | +| [no-conditional-expect](docs/rules/no-conditional-expect.md) | disallow conditional expects | | | | | +| [no-conditional-in-test](docs/rules/no-conditional-in-test.md) | disallow conditional tests | | | | | +| [no-conditional-tests](docs/rules/no-conditional-tests.md) | disallow conditional tests | | | | | +| [no-disabled-tests](docs/rules/no-disabled-tests.md) | disallow disabled tests | | | | | +| [no-done-callback](docs/rules/no-done-callback.md) | disallow using a callback in asynchronous tests and hooks | | πŸ’‘ | | ❌ | +| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | disallow duplicate hooks and teardown hooks | | | | | +| [no-focused-tests](docs/rules/no-focused-tests.md) | disallow focused tests | πŸ”§ | | | | +| [no-hooks](docs/rules/no-hooks.md) | disallow setup and teardown hooks | | | | | +| [no-identical-title](docs/rules/no-identical-title.md) | disallow identical titles | πŸ”§ | | | | +| [no-import-node-test](docs/rules/no-import-node-test.md) | disallow importing `node:test` | πŸ”§ | | | | +| [no-importing-vitest-globals](docs/rules/no-importing-vitest-globals.md) | disallow importing Vitest globals | πŸ”§ | | | | +| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md) | disallow string interpolation in snapshots | πŸ”§ | | | | +| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | | | | +| [no-mocks-import](docs/rules/no-mocks-import.md) | disallow importing from **mocks** directory | | | | | +| [no-restricted-matchers](docs/rules/no-restricted-matchers.md) | disallow the use of certain matchers | | | | | +| [no-restricted-vi-methods](docs/rules/no-restricted-vi-methods.md) | disallow specific `vi.` methods | | | | | +| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | | | | +| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` | πŸ”§ | | | | +| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | | | | +| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | πŸ”§ | | | | +| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | πŸ”§ | | | | +| [padding-around-all](docs/rules/padding-around-all.md) | Enforce padding around vitest functions | πŸ”§ | | | | +| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | Enforce padding around `beforeAll` blocks | πŸ”§ | | | | +| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks | πŸ”§ | | | | +| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | Enforce padding around `describe` blocks | πŸ”§ | | | | +| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | Enforce padding around `expect` groups | πŸ”§ | | | | +| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md) | Enforce padding around `test` blocks | πŸ”§ | | | | +| [prefer-called-times](docs/rules/prefer-called-times.md) | enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` | πŸ”§ | | | | +| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | πŸ”§ | | | | +| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | πŸ”§ | | | | +| [prefer-describe-function-title](docs/rules/prefer-describe-function-title.md) | enforce using a function as a describe title over an equivalent string | πŸ”§ | | | | +| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | | | | +| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md) | enforce using the built-in quality matchers | | πŸ’‘ | | | +| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | enforce using expect assertions instead of callbacks | | πŸ’‘ | | | +| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md) | enforce using `expect().resolves` over `expect(await ...)` syntax | πŸ”§ | | | | +| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | | | | +| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | | | | +| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | πŸ”§ | | | | +| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | πŸ”§ | | | | +| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | πŸ”§ | | | | +| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md) | enforce including a hint with external snapshots | | | | | +| [prefer-spy-on](docs/rules/prefer-spy-on.md) | enforce using `vi.spyOn` | πŸ”§ | | | | +| [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 | πŸ”§ | | | | +| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | enforce strict equal over equal | | πŸ’‘ | | | +| [prefer-to-be](docs/rules/prefer-to-be.md) | enforce using toBe() | πŸ”§ | | | | +| [prefer-to-be-falsy](docs/rules/prefer-to-be-falsy.md) | enforce using toBeFalsy() | πŸ”§ | | | | +| [prefer-to-be-object](docs/rules/prefer-to-be-object.md) | enforce using toBeObject() | πŸ”§ | | | | +| [prefer-to-be-truthy](docs/rules/prefer-to-be-truthy.md) | enforce using `toBeTruthy` | πŸ”§ | | | | +| [prefer-to-contain](docs/rules/prefer-to-contain.md) | enforce using toContain() | πŸ”§ | | | | +| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | enforce using toHaveLength() | πŸ”§ | | | | +| [prefer-todo](docs/rules/prefer-todo.md) | enforce using `test.todo` | πŸ”§ | | | | +| [prefer-vi-mocked](docs/rules/prefer-vi-mocked.md) | require `vi.mocked()` over `fn as Mock` | πŸ”§ | | πŸ’­ | | +| [require-hook](docs/rules/require-hook.md) | require setup and teardown to be within a hook | | | | | +| [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 | | | | | +| [require-mock-type-parameters](docs/rules/require-mock-type-parameters.md) | enforce using type parameters with vitest mock functions | πŸ”§ | | | | +| [require-to-throw-message](docs/rules/require-to-throw-message.md) | require toThrow() to be called with an error message | | | | | +| [require-top-level-describe](docs/rules/require-top-level-describe.md) | enforce that all tests are in a top-level describe | | | | | +| [valid-describe-callback](docs/rules/valid-describe-callback.md) | enforce valid describe callback | | | | | +| [valid-expect](docs/rules/valid-expect.md) | enforce valid `expect()` usage | πŸ”§ | | | | +| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | | | | +| [valid-title](docs/rules/valid-title.md) | enforce valid titles | πŸ”§ | | | | diff --git a/docs/rules/consistent-test-filename.md b/docs/rules/consistent-test-filename.md index 8a2b42a9..1c9fda5b 100644 --- a/docs/rules/consistent-test-filename.md +++ b/docs/rules/consistent-test-filename.md @@ -1,7 +1,5 @@ # consistent-test-filename -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ### Rule Details diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index 0534d763..b66dd7ed 100644 --- a/docs/rules/consistent-test-it.md +++ b/docs/rules/consistent-test-it.md @@ -1,7 +1,5 @@ # consistent-test-it -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/consistent-vitest-vi.md b/docs/rules/consistent-vitest-vi.md index 92a83aa4..cc460a84 100644 --- a/docs/rules/consistent-vitest-vi.md +++ b/docs/rules/consistent-vitest-vi.md @@ -1,7 +1,5 @@ # consistent-vitest-vi -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index 4ba3852e..6b4e4d5d 100644 --- a/docs/rules/expect-expect.md +++ b/docs/rules/expect-expect.md @@ -1,7 +1,5 @@ # expect-expect -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/max-expects.md b/docs/rules/max-expects.md index ba9749ab..5d36ef47 100644 --- a/docs/rules/max-expects.md +++ b/docs/rules/max-expects.md @@ -1,7 +1,5 @@ # max-expects -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ### Rule Details diff --git a/docs/rules/max-nested-describe.md b/docs/rules/max-nested-describe.md index 42b47127..9bd19b6e 100644 --- a/docs/rules/max-nested-describe.md +++ b/docs/rules/max-nested-describe.md @@ -1,7 +1,5 @@ # max-nested-describe -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index 28c8bbf2..a84ed79d 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -1,7 +1,5 @@ # no-alias-methods -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-commented-out-tests.md b/docs/rules/no-commented-out-tests.md index 30cc0254..1a6f4dea 100644 --- a/docs/rules/no-commented-out-tests.md +++ b/docs/rules/no-commented-out-tests.md @@ -1,7 +1,5 @@ # no-commented-out-tests -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-conditional-expect.md b/docs/rules/no-conditional-expect.md index 9775bed5..f9454ec3 100644 --- a/docs/rules/no-conditional-expect.md +++ b/docs/rules/no-conditional-expect.md @@ -1,7 +1,5 @@ # no-conditional-expect -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-conditional-in-test.md b/docs/rules/no-conditional-in-test.md index 91e771f7..b096e049 100644 --- a/docs/rules/no-conditional-in-test.md +++ b/docs/rules/no-conditional-in-test.md @@ -1,7 +1,5 @@ # no-conditional-in-test -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ### Rule Details diff --git a/docs/rules/no-conditional-tests.md b/docs/rules/no-conditional-tests.md index 5d087454..21414054 100644 --- a/docs/rules/no-conditional-tests.md +++ b/docs/rules/no-conditional-tests.md @@ -1,7 +1,5 @@ # no-conditional-tests -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-disabled-tests.md b/docs/rules/no-disabled-tests.md index 52ad001c..517738c1 100644 --- a/docs/rules/no-disabled-tests.md +++ b/docs/rules/no-disabled-tests.md @@ -1,7 +1,5 @@ # no-disabled-tests -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-done-callback.md b/docs/rules/no-done-callback.md index 888f96dd..d3e99e54 100644 --- a/docs/rules/no-done-callback.md +++ b/docs/rules/no-done-callback.md @@ -2,8 +2,6 @@ ❌ This rule is deprecated. -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index b321d26e..4013f2ff 100644 --- a/docs/rules/no-duplicate-hooks.md +++ b/docs/rules/no-duplicate-hooks.md @@ -1,7 +1,5 @@ # no-duplicate-hooks -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index 5de60b32..405d4164 100644 --- a/docs/rules/no-focused-tests.md +++ b/docs/rules/no-focused-tests.md @@ -1,7 +1,5 @@ # no-focused-tests -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index 9ed280c4..06632859 100644 --- a/docs/rules/no-hooks.md +++ b/docs/rules/no-hooks.md @@ -1,7 +1,5 @@ # no-hooks -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule details diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index ee00521e..0fa6e86c 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -1,7 +1,5 @@ # no-identical-title -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-import-node-test.md b/docs/rules/no-import-node-test.md index c6ac32db..355c6c57 100644 --- a/docs/rules/no-import-node-test.md +++ b/docs/rules/no-import-node-test.md @@ -1,7 +1,5 @@ # no-import-node-test -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-importing-vitest-globals.md b/docs/rules/no-importing-vitest-globals.md index f4c481c6..6dd640ef 100644 --- a/docs/rules/no-importing-vitest-globals.md +++ b/docs/rules/no-importing-vitest-globals.md @@ -1,7 +1,5 @@ # no-importing-vitest-globals -🚫 This rule is _disabled_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-interpolation-in-snapshots.md b/docs/rules/no-interpolation-in-snapshots.md index 4ebe665a..027c4b0b 100644 --- a/docs/rules/no-interpolation-in-snapshots.md +++ b/docs/rules/no-interpolation-in-snapshots.md @@ -1,7 +1,5 @@ # no-interpolation-in-snapshots -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index 8f4feae7..1dfae02d 100644 --- a/docs/rules/no-large-snapshots.md +++ b/docs/rules/no-large-snapshots.md @@ -1,7 +1,5 @@ # no-large-snapshots -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-mocks-import.md b/docs/rules/no-mocks-import.md index db9d2d93..de478381 100644 --- a/docs/rules/no-mocks-import.md +++ b/docs/rules/no-mocks-import.md @@ -1,7 +1,5 @@ # no-mocks-import -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-restricted-matchers.md b/docs/rules/no-restricted-matchers.md index 578950ba..3bf4b4cf 100644 --- a/docs/rules/no-restricted-matchers.md +++ b/docs/rules/no-restricted-matchers.md @@ -1,7 +1,5 @@ # no-restricted-matchers -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ### Rule Details diff --git a/docs/rules/no-restricted-vi-methods.md b/docs/rules/no-restricted-vi-methods.md index 2d809aa3..5f485c48 100644 --- a/docs/rules/no-restricted-vi-methods.md +++ b/docs/rules/no-restricted-vi-methods.md @@ -1,7 +1,5 @@ # no-restricted-vi-methods -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - You may wish to restrict the use of specific `vi` methods. diff --git a/docs/rules/no-standalone-expect.md b/docs/rules/no-standalone-expect.md index a29337fa..e123c93f 100644 --- a/docs/rules/no-standalone-expect.md +++ b/docs/rules/no-standalone-expect.md @@ -1,7 +1,5 @@ # no-standalone-expect -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule Details diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index 235d06c6..358c3de8 100644 --- a/docs/rules/no-test-prefixes.md +++ b/docs/rules/no-test-prefixes.md @@ -1,7 +1,5 @@ # no-test-prefixes -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/no-test-return-statement.md b/docs/rules/no-test-return-statement.md index e22bcc79..33150082 100644 --- a/docs/rules/no-test-return-statement.md +++ b/docs/rules/no-test-return-statement.md @@ -1,7 +1,5 @@ # no-test-return-statement -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ### Rule Details diff --git a/docs/rules/padding-around-after-all-blocks.md b/docs/rules/padding-around-after-all-blocks.md index c695ee6c..f2d75d7b 100644 --- a/docs/rules/padding-around-after-all-blocks.md +++ b/docs/rules/padding-around-after-all-blocks.md @@ -1,7 +1,5 @@ # padding-around-after-all-blocks -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-after-each-blocks.md b/docs/rules/padding-around-after-each-blocks.md index 2aa820c3..5d868b03 100644 --- a/docs/rules/padding-around-after-each-blocks.md +++ b/docs/rules/padding-around-after-each-blocks.md @@ -1,7 +1,5 @@ # padding-around-after-each-blocks -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-all.md b/docs/rules/padding-around-all.md index 0f9b7224..8021cf24 100644 --- a/docs/rules/padding-around-all.md +++ b/docs/rules/padding-around-all.md @@ -1,7 +1,5 @@ # padding-around-all -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-all-blocks.md b/docs/rules/padding-around-before-all-blocks.md index 7df640ba..eb3d17c1 100644 --- a/docs/rules/padding-around-before-all-blocks.md +++ b/docs/rules/padding-around-before-all-blocks.md @@ -1,7 +1,5 @@ # padding-around-before-all-blocks -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-before-each-blocks.md b/docs/rules/padding-around-before-each-blocks.md index 3ef4a828..72f0a9e4 100644 --- a/docs/rules/padding-around-before-each-blocks.md +++ b/docs/rules/padding-around-before-each-blocks.md @@ -1,7 +1,5 @@ # padding-around-before-each-blocks -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-describe-blocks.md b/docs/rules/padding-around-describe-blocks.md index 5125d33f..5030dea1 100644 --- a/docs/rules/padding-around-describe-blocks.md +++ b/docs/rules/padding-around-describe-blocks.md @@ -1,7 +1,5 @@ # padding-around-describe-blocks -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-expect-groups.md b/docs/rules/padding-around-expect-groups.md index cab62ebd..ff2a20a8 100644 --- a/docs/rules/padding-around-expect-groups.md +++ b/docs/rules/padding-around-expect-groups.md @@ -1,7 +1,5 @@ # padding-around-expect-groups -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/padding-around-test-blocks.md b/docs/rules/padding-around-test-blocks.md index ee84172d..20453fa9 100644 --- a/docs/rules/padding-around-test-blocks.md +++ b/docs/rules/padding-around-test-blocks.md @@ -1,7 +1,5 @@ # padding-around-test-blocks -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index 8d7fdf17..432d431b 100644 --- a/docs/rules/prefer-called-times.md +++ b/docs/rules/prefer-called-times.md @@ -1,11 +1,7 @@ # prefer-called-times -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). -πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting). - ## Rule Details diff --git a/docs/rules/prefer-called-with.md b/docs/rules/prefer-called-with.md index 39e33d30..952389e0 100644 --- a/docs/rules/prefer-called-with.md +++ b/docs/rules/prefer-called-with.md @@ -1,7 +1,5 @@ # prefer-called-with -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-comparison-matcher.md b/docs/rules/prefer-comparison-matcher.md index 5c4b6e0f..d3592cd3 100644 --- a/docs/rules/prefer-comparison-matcher.md +++ b/docs/rules/prefer-comparison-matcher.md @@ -1,7 +1,5 @@ # prefer-comparison-matcher -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-describe-function-title.md b/docs/rules/prefer-describe-function-title.md index c7bf985f..061b8210 100644 --- a/docs/rules/prefer-describe-function-title.md +++ b/docs/rules/prefer-describe-function-title.md @@ -1,7 +1,5 @@ # prefer-describe-function-title -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-each.md b/docs/rules/prefer-each.md index 12eee457..0105794a 100644 --- a/docs/rules/prefer-each.md +++ b/docs/rules/prefer-each.md @@ -1,7 +1,5 @@ # prefer-each -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ```js diff --git a/docs/rules/prefer-equality-matcher.md b/docs/rules/prefer-equality-matcher.md index 723e577f..78230c5f 100644 --- a/docs/rules/prefer-equality-matcher.md +++ b/docs/rules/prefer-equality-matcher.md @@ -1,7 +1,5 @@ # prefer-equality-matcher -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index 7c9ea062..31e4217a 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -1,7 +1,5 @@ # prefer-expect-assertions -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-expect-resolves.md b/docs/rules/prefer-expect-resolves.md index e7574913..15fe886a 100644 --- a/docs/rules/prefer-expect-resolves.md +++ b/docs/rules/prefer-expect-resolves.md @@ -1,7 +1,5 @@ # prefer-expect-resolves -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-hooks-in-order.md b/docs/rules/prefer-hooks-in-order.md index 7ce31c24..f94860e4 100644 --- a/docs/rules/prefer-hooks-in-order.md +++ b/docs/rules/prefer-hooks-in-order.md @@ -1,7 +1,5 @@ # prefer-hooks-in-order -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ```js diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index 3f7873cb..5d66e76f 100644 --- a/docs/rules/prefer-hooks-on-top.md +++ b/docs/rules/prefer-hooks-on-top.md @@ -1,7 +1,5 @@ # prefer-hooks-on-top -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - ```ts diff --git a/docs/rules/prefer-importing-vitest-globals.md b/docs/rules/prefer-importing-vitest-globals.md index d60a77c0..ba36c2b0 100644 --- a/docs/rules/prefer-importing-vitest-globals.md +++ b/docs/rules/prefer-importing-vitest-globals.md @@ -1,7 +1,5 @@ # prefer-importing-vitest-globals -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-lowercase-title.md b/docs/rules/prefer-lowercase-title.md index 5b474a87..46264058 100644 --- a/docs/rules/prefer-lowercase-title.md +++ b/docs/rules/prefer-lowercase-title.md @@ -1,7 +1,5 @@ # prefer-lowercase-title -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-mock-promise-shorthand.md b/docs/rules/prefer-mock-promise-shorthand.md index 55dd00a7..5dcbea79 100644 --- a/docs/rules/prefer-mock-promise-shorthand.md +++ b/docs/rules/prefer-mock-promise-shorthand.md @@ -1,7 +1,5 @@ # prefer-mock-promise-shorthand -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-snapshot-hint.md b/docs/rules/prefer-snapshot-hint.md index 7236025b..a059fb71 100644 --- a/docs/rules/prefer-snapshot-hint.md +++ b/docs/rules/prefer-snapshot-hint.md @@ -1,7 +1,5 @@ # prefer-snapshot-hint -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - When working with external snapshot matchers it's considered best practice to diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index 5e4d0fb8..54fce5f8 100644 --- a/docs/rules/prefer-spy-on.md +++ b/docs/rules/prefer-spy-on.md @@ -1,7 +1,5 @@ # prefer-spy-on -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-boolean-matchers.md b/docs/rules/prefer-strict-boolean-matchers.md index d334721f..547513b1 100644 --- a/docs/rules/prefer-strict-boolean-matchers.md +++ b/docs/rules/prefer-strict-boolean-matchers.md @@ -1,7 +1,5 @@ # prefer-strict-boolean-matchers -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index 2e57004c..cbf152dc 100644 --- a/docs/rules/prefer-strict-equal.md +++ b/docs/rules/prefer-strict-equal.md @@ -1,7 +1,5 @@ # prefer-strict-equal -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-to-be-falsy.md b/docs/rules/prefer-to-be-falsy.md index 9efaf648..724412a0 100644 --- a/docs/rules/prefer-to-be-falsy.md +++ b/docs/rules/prefer-to-be-falsy.md @@ -1,7 +1,5 @@ # prefer-to-be-falsy -🚫 This rule is _disabled_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-object.md b/docs/rules/prefer-to-be-object.md index c3f352f8..c4482ca1 100644 --- a/docs/rules/prefer-to-be-object.md +++ b/docs/rules/prefer-to-be-object.md @@ -1,7 +1,5 @@ # prefer-to-be-object -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be-truthy.md b/docs/rules/prefer-to-be-truthy.md index acf7797e..83a5ef27 100644 --- a/docs/rules/prefer-to-be-truthy.md +++ b/docs/rules/prefer-to-be-truthy.md @@ -1,7 +1,5 @@ # prefer-to-be-truthy -🚫 This rule is _disabled_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-be.md b/docs/rules/prefer-to-be.md index 2bf66e6e..98a94f9f 100644 --- a/docs/rules/prefer-to-be.md +++ b/docs/rules/prefer-to-be.md @@ -1,7 +1,5 @@ # prefer-to-be -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index 3b17595b..c1206b5c 100644 --- a/docs/rules/prefer-to-contain.md +++ b/docs/rules/prefer-to-contain.md @@ -1,7 +1,5 @@ # prefer-to-contain -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index 2c05adca..8e50495e 100644 --- a/docs/rules/prefer-to-have-length.md +++ b/docs/rules/prefer-to-have-length.md @@ -1,7 +1,5 @@ # prefer-to-have-length -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index a9758dd7..09484f5d 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -1,7 +1,5 @@ # prefer-todo -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/prefer-vi-mocked.md b/docs/rules/prefer-vi-mocked.md index 89dc379a..a2b5f82e 100644 --- a/docs/rules/prefer-vi-mocked.md +++ b/docs/rules/prefer-vi-mocked.md @@ -1,7 +1,5 @@ # prefer-vi-mocked -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting). diff --git a/docs/rules/require-hook.md b/docs/rules/require-hook.md index 17141998..be70f634 100644 --- a/docs/rules/require-hook.md +++ b/docs/rules/require-hook.md @@ -1,7 +1,5 @@ # require-hook -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - It's common when writing tests to need to perform a particular setup work before and after a test suite run. Because Vitest executes all `describe` handlers in a test file _before_ it executes any of the actual tests, it's important to ensure setup and teardown work is done inside `before*` and `after*` handlers respectively, rather than inside the `describe` blocks. diff --git a/docs/rules/require-local-test-context-for-concurrent-snapshots.md b/docs/rules/require-local-test-context-for-concurrent-snapshots.md index 67234202..6bf695de 100644 --- a/docs/rules/require-local-test-context-for-concurrent-snapshots.md +++ b/docs/rules/require-local-test-context-for-concurrent-snapshots.md @@ -1,7 +1,5 @@ # require-local-test-context-for-concurrent-snapshots -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. - ## Rule details diff --git a/docs/rules/require-mock-type-parameters.md b/docs/rules/require-mock-type-parameters.md index 40bcd6be..d9708b42 100644 --- a/docs/rules/require-mock-type-parameters.md +++ b/docs/rules/require-mock-type-parameters.md @@ -1,7 +1,5 @@ # require-mock-type-parameters -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index 1c51cb6e..d5828586 100644 --- a/docs/rules/require-to-throw-message.md +++ b/docs/rules/require-to-throw-message.md @@ -1,7 +1,5 @@ # require-to-throw-message -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - This rule triggers a warning if `toThrow()` or `toThrowError()` is used without diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index 30b56f0f..0d77f634 100644 --- a/docs/rules/require-top-level-describe.md +++ b/docs/rules/require-top-level-describe.md @@ -1,7 +1,5 @@ # require-top-level-describe -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - This rule triggers warning if a test case (`test` and `it`) or a hook (`beforeAll`, `beforeEach`, `afterEach`, `afterAll`) is not located in a top-level `describe` block. diff --git a/docs/rules/valid-describe-callback.md b/docs/rules/valid-describe-callback.md index b043759f..6090eedb 100644 --- a/docs/rules/valid-describe-callback.md +++ b/docs/rules/valid-describe-callback.md @@ -1,7 +1,5 @@ # valid-describe-callback -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. - This rule validates the second parameter of a `describe()` function is a callback. diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index 54008eae..ddfcb5bb 100644 --- a/docs/rules/valid-expect-in-promise.md +++ b/docs/rules/valid-expect-in-promise.md @@ -1,7 +1,5 @@ # valid-expect-in-promise -⚠️ This rule _warns_ in the πŸ”΅ `legacy-all` config. - This rule flags any promises within the body of a test that include expectations that have either not been returned or awaited. diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index 902df9ce..9dca26bd 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -1,7 +1,5 @@ # valid-expect -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index ba1432ff..9a0cab80 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -1,7 +1,5 @@ # valid-title -πŸ’Όβš οΈ This rule is enabled in the β˜‘οΈ `legacy-recommended` config. This rule _warns_ in the πŸ”΅ `legacy-all` config. - πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). diff --git a/eslint.config.js b/eslint.config.js index 83b88675..c917a01c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -15,7 +15,7 @@ export default [ }, }, { - ignores: ['dist/**/*', '**/*.md'], + files: ['**/*.test.*'], plugins: { vitest, }, diff --git a/package.json b/package.json index f80facbe..32ee7e35 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "eslint": "^9.20.0", "eslint-config-prettier": "^10.1.5", "eslint-doc-generator": "^2.2.2", - "eslint-plugin-eslint-plugin": "^6.4.0", + "eslint-plugin-eslint-plugin": "^6.5.0", "eslint-remote-tester": "^4.0.1", "eslint-remote-tester-repositories": "^2.0.0", "prettier": "^3.5.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d0b7fbb4..2eaf9956 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,8 +52,8 @@ importers: specifier: ^2.2.2 version: 2.2.2(eslint@9.20.0(jiti@2.4.2))(typescript@5.7.3) eslint-plugin-eslint-plugin: - specifier: ^6.4.0 - version: 6.4.0(eslint@9.20.0(jiti@2.4.2)) + specifier: ^6.5.0 + version: 6.5.0(eslint@9.20.0(jiti@2.4.2)) eslint-remote-tester: specifier: ^4.0.1 version: 4.0.1(eslint@9.20.0(jiti@2.4.2))(importx@0.3.11)(jiti@2.4.2) @@ -1529,8 +1529,8 @@ packages: peerDependencies: eslint: '>= 8.57.1' - eslint-plugin-eslint-plugin@6.4.0: - resolution: {integrity: sha512-X94/hr7DnckX68wE6Qqeo3DsZndZSclfoewjwD249yG5z2EAOl3UGUohLIgOpmbUjcFv6AlfW3wxBnOiWkS1Iw==} + eslint-plugin-eslint-plugin@6.5.0: + resolution: {integrity: sha512-DT8YpcXDtMBcBZN39JlkHGurHKU8eYFLavTrnowQLeNwqe/diRUsllsftgD/7dZ2/ItabNLLF2/EYapE1H+G7Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: '>=8.23.0' @@ -4048,7 +4048,7 @@ snapshots: - supports-color - typescript - eslint-plugin-eslint-plugin@6.4.0(eslint@9.20.0(jiti@2.4.2)): + eslint-plugin-eslint-plugin@6.5.0(eslint@9.20.0(jiti@2.4.2)): dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.20.0(jiti@2.4.2)) eslint: 9.20.0(jiti@2.4.2) diff --git a/src/index.ts b/src/index.ts index b8870318..4df35266 100644 --- a/src/index.ts +++ b/src/index.ts @@ -277,7 +277,7 @@ const plugin = { }, configs: { recommended: { - name: '@vitest/recommended', + name: 'vitest/recommended', plugins: { get vitest() { return plugin @@ -286,7 +286,7 @@ const plugin = { rules: createConfig(recommended), }, all: { - name: '@vitest/all', + name: 'vitest/all', plugins: { get vitest() { return plugin