From fae2f9150c4c40cf38ef467c5abd0465d62f9605 Mon Sep 17 00:00:00 2001 From: Hamir Date: Fri, 2 Jan 2026 15:19:01 -0800 Subject: [PATCH 1/5] feat: add require-test-timeout rule --- README.md | 1 + docs/rules/require-test-timeout.md | 29 ++++++ src/rules/index.ts | 2 + src/rules/require-test-timeout.ts | 152 +++++++++++++++++++++++++++++ tests/require-test-timeout.test.ts | 113 +++++++++++++++++++++ 5 files changed, 297 insertions(+) create mode 100644 docs/rules/require-test-timeout.md create mode 100644 src/rules/require-test-timeout.ts create mode 100644 tests/require-test-timeout.test.ts diff --git a/README.md b/README.md index 13625b3e..7d6c7da3 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,7 @@ export default defineConfig({ | [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-test-timeout](docs/rules/require-test-timeout.md) | require tests to declare a timeout | | | | | | | | | [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 | ✅ | 🌐 | | | | | | diff --git a/docs/rules/require-test-timeout.md b/docs/rules/require-test-timeout.md new file mode 100644 index 00000000..1992a392 --- /dev/null +++ b/docs/rules/require-test-timeout.md @@ -0,0 +1,29 @@ +# Require tests to declare a timeout (`vitest/require-test-timeout`) + + + +This rule ensures tests explicitly declare a timeout so long-running tests don't hang silently. + +```ts +// bad +it('slow test', async () => { + await doSomethingSlow() +}) + +// good (numeric timeout) +test('slow test', async () => { + await doSomethingSlow() +}, 1000) + +// good (options object) +test('slow test', { timeout: 1000 }, async () => { + await doSomethingSlow() +}) + +// good (file-level) +vi.setConfig({ testTimeout: 1000 }) + +test('slow test', async () => { + await doSomethingSlow() +}) +``` diff --git a/src/rules/index.ts b/src/rules/index.ts index 04afc505..0dc180c9 100644 --- a/src/rules/index.ts +++ b/src/rules/index.ts @@ -68,6 +68,7 @@ import preferTodo from './prefer-todo' import preferViMocked from './prefer-vi-mocked' import requireAwaitedExpectPoll from './require-awaited-expect-poll' import requireHook from './require-hook' +import requireTestTimeout from './require-test-timeout' import requireLocalTestContextForConcurrentSnapshots from './require-local-test-context-for-concurrent-snapshots' import requireMockTypeParameters from './require-mock-type-parameters' import requireToThrowMessage from './require-to-throw-message' @@ -152,6 +153,7 @@ export const rules = { 'prefer-vi-mocked': preferViMocked, 'require-awaited-expect-poll': requireAwaitedExpectPoll, 'require-hook': requireHook, + 'require-test-timeout': requireTestTimeout, 'require-local-test-context-for-concurrent-snapshots': requireLocalTestContextForConcurrentSnapshots, 'require-mock-type-parameters': requireMockTypeParameters, diff --git a/src/rules/require-test-timeout.ts b/src/rules/require-test-timeout.ts new file mode 100644 index 00000000..7b6f5dee --- /dev/null +++ b/src/rules/require-test-timeout.ts @@ -0,0 +1,152 @@ +import { createEslintRule, getAccessorValue } from '../utils' +import { parseVitestFnCall } from '../utils/parse-vitest-fn-call' +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils' +export const RULE_NAME = 'require-test-timeout' +export type MESSAGE_ID = 'missingTimeout' +export type Options = [] +export default createEslintRule({ + name: RULE_NAME, + meta: { + type: 'suggestion', + docs: { + description: 'require tests to declare a timeout', + recommended: false, + }, + messages: { + missingTimeout: 'Test is missing a timeout. Add an explicit timeout.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + /** + * Track positions (character offsets) of vi.setConfig({ testTimeout }) + * calls so we only exempt tests that appear _after_ the call. We use the + * call's end offset and the test's start offset so that a setConfig on the + * same line but before the test still exempts it. + */ + const setConfigPositions: number[] = [] + + return { + CallExpression(node: TSESTree.CallExpression) { + const vitestFnCall = parseVitestFnCall(node, context) + + // detect vi.setConfig({ testTimeout: ... }) + if (vitestFnCall && vitestFnCall.type === 'vi') { + const firstMember = vitestFnCall.members[0] + + if (firstMember && getAccessorValue(firstMember) === 'setConfig') { + const arg = node.arguments[0] + + if (arg && arg.type === AST_NODE_TYPES.ObjectExpression) { + for (const prop of arg.properties) { + if (prop.type === AST_NODE_TYPES.Property) { + const key = prop.key + + // Only accept a numeric literal >= 0 for testTimeout + if ( + ((key.type === AST_NODE_TYPES.Identifier && + key.name === 'testTimeout') || + (key.type === AST_NODE_TYPES.Literal && + key.value === 'testTimeout')) && + prop.value.type === AST_NODE_TYPES.Literal && + typeof prop.value.value === 'number' && + prop.value.value >= 0 + ) { + const endOffset = node.range ? node.range[1] : 0 + + setConfigPositions.push(endOffset) + + break + } + } + } + } + } + } + + if (!vitestFnCall) return + if (vitestFnCall.type !== 'test' && vitestFnCall.type !== 'it') return + if ( + // skip todo/skip/xit/etc. + vitestFnCall.members.some((m) => { + const v = getAccessorValue(m) + return v === 'todo' || v === 'skip' + }) || + vitestFnCall.name.startsWith('x') + ) + return + + // check if test has a function callback + const args = node.arguments + const hasFunctionArg = args.some( + (a) => + a.type === AST_NODE_TYPES.FunctionExpression || + a.type === AST_NODE_TYPES.ArrowFunctionExpression, + ) + + if (!hasFunctionArg) return + + /** + * If there is a setConfig call *before* this test that sets testTimeout, + * exempt this test. Note: we compare source positions (character offsets) + * so that a later setConfig call does not affect earlier tests. + */ + const testPos = node.range ? node.range[0] : 0 + + if (setConfigPositions.some((p) => p <= testPos)) return + + let foundNumericTimeout = false + let foundObjectTimeout = false + + // numeric literal timeout as argument (third-arg style) + for (const a of args) { + if ( + a.type === AST_NODE_TYPES.Literal && + typeof a.value === 'number' + ) { + if (a.value >= 0) { + foundNumericTimeout = true + } else { + // negative numeric timeouts are explicitly invalid + context.report({ node, messageId: 'missingTimeout' }) + return + } + } + + // object literal with timeout property + if (a.type === AST_NODE_TYPES.ObjectExpression) { + for (const prop of a.properties) { + if (prop.type !== AST_NODE_TYPES.Property) continue + + const key = prop.key + + if ( + (key.type === AST_NODE_TYPES.Identifier && + key.name === 'timeout') || + (key.type === AST_NODE_TYPES.Literal && key.value === 'timeout') + ) { + if ( + prop.value.type === AST_NODE_TYPES.Literal && + typeof prop.value.value === 'number' && + prop.value.value >= 0 + ) { + foundObjectTimeout = true + } else { + // any explicitly provided non-numeric or negative timeout is invalid + context.report({ node, messageId: 'missingTimeout' }) + + return + } + } + } + } + } + + if (foundNumericTimeout || foundObjectTimeout) return + + context.report({ node, messageId: 'missingTimeout' }) + }, + } + }, +}) diff --git a/tests/require-test-timeout.test.ts b/tests/require-test-timeout.test.ts new file mode 100644 index 00000000..6ffda232 --- /dev/null +++ b/tests/require-test-timeout.test.ts @@ -0,0 +1,113 @@ +import rule, { RULE_NAME } from '../src/rules/require-test-timeout' +import { ruleTester } from './ruleTester' + +ruleTester.run(RULE_NAME, rule, { + valid: [ + 'test.todo("a")', + 'xit("a", () => {})', + 'test("a", () => {}, 0)', + 'it("a", () => {}, 500)', + 'it.skip("a", () => {})', + 'test.skip("a", () => {})', + 'test("a", () => {}, 1000)', + 'it.only("a", () => {}, 1234)', + 'test.only("a", () => {}, 1234)', + 'it.concurrent("a", () => {}, 400)', + 'test("a", () => {}, { timeout: 0 })', + 'test.concurrent("a", () => {}, 400)', + 'test("a", () => {}, { timeout: 500 })', + 'test("a", { timeout: 500 }, () => {})', + 'vi.setConfig({ testTimeout: 1000 }); test("a", () => {})', + // multiple object args where one contains timeout + 'test("a", { foo: 1 }, { timeout: 500 }, () => {})', + // both object and numeric timeout present + 'test("a", { timeout: 500 }, 1000, () => {})', + 'test("a", () => {}, 1000, { extra: true })', + ], + invalid: [ + { + code: 'test("a", () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'it("a", () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'test.only("a", () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'test.concurrent("a", () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'it.concurrent("a", () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'vi.setConfig({}); test("a", () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'const t = 500; test("a", { timeout: t }, () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + // null/undefined/identifier/negative cases + { + code: 'test("a", () => {}, { timeout: null })', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'test("a", () => {}, { timeout: undefined })', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'test("a", () => {}, -100)', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'test("a", () => {}, { timeout: -1 })', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'vi.setConfig({ testTimeout: null }); test("a", () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'vi.setConfig({ testTimeout: undefined }); test("a", () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + { + // setConfig after test should NOT exempt the earlier test + code: 'test("a", () => {}); vi.setConfig({ testTimeout: 1000 })', + errors: [{ messageId: 'missingTimeout' }], + }, + // spread/complex object cases (spread should not be treated as literal timeout) + { + code: 'const opts = { timeout: 1000 }; test("a", { ...opts }, () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'const opts = { timeout: 1000 }; test("a", { ...opts }, { foo: 1 }, () => {})', + errors: [{ messageId: 'missingTimeout' }], + }, + // mixed valid/invalid timeout specs: any explicit invalid timeout should fail + { + code: 'test("a", () => {}, { timeout: -1 }, { timeout: 500 })', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'test("a", () => {}, { timeout: 500 }, { timeout: -1 })', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'test("a", () => {}, { timeout: -1 }, 1000)', + errors: [{ messageId: 'missingTimeout' }], + }, + { + code: 'test("a", () => {}, 1000, { timeout: -1 })', + errors: [{ messageId: 'missingTimeout' }], + }, + ], +}) From 78ca08a851eb4c6633da41427b8ba2688e9092cf Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Wed, 7 Jan 2026 10:12:53 +0200 Subject: [PATCH 2/5] apply formatter --- README.md | 2 +- docs/rules/consistent-each-for.md | 4 +--- 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/hoisted-apis-on-top.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/no-unneeded-async-expect-function.md | 4 +--- docs/rules/padding-around-after-all-blocks.md | 4 +--- docs/rules/padding-around-after-each-blocks.md | 4 +--- docs/rules/padding-around-all.md | 4 +--- docs/rules/padding-around-before-all-blocks.md | 4 +--- docs/rules/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-exactly-once-with.md | 4 +--- docs/rules/prefer-called-once.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-expect-type-of.md | 4 +--- docs/rules/prefer-hooks-in-order.md | 4 +--- docs/rules/prefer-hooks-on-top.md | 4 +--- docs/rules/prefer-import-in-mock.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-mock-return-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-been-called-times.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-awaited-expect-poll.md | 4 +--- docs/rules/require-hook.md | 4 +--- .../require-local-test-context-for-concurrent-snapshots.md | 4 +--- docs/rules/require-mock-type-parameters.md | 4 +--- docs/rules/require-test-timeout.md | 2 ++ 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 +--- docs/rules/warn-todo.md | 4 +--- src/index.ts | 1 + src/rules/consistent-test-filename.ts | 2 +- src/rules/consistent-test-it.ts | 2 +- src/rules/consistent-vitest-vi.ts | 2 +- src/rules/expect-expect.ts | 2 +- src/rules/max-expects.ts | 2 +- src/rules/max-nested-describe.ts | 2 +- src/rules/no-conditional-expect.ts | 2 +- src/rules/no-focused-tests.ts | 2 +- src/rules/no-hooks.ts | 2 +- src/rules/no-large-snapshots.ts | 2 +- src/rules/no-restricted-matchers.ts | 2 +- src/rules/no-restricted-vi-methods.ts | 2 +- src/rules/no-standalone-expect.ts | 2 +- src/rules/prefer-expect-assertions.ts | 2 +- src/rules/prefer-import-in-mock.ts | 1 + src/rules/prefer-lowercase-title.ts | 2 +- src/rules/prefer-snapshot-hint.ts | 2 +- src/rules/require-hook.ts | 2 +- src/rules/require-mock-type-parameters.ts | 2 +- src/rules/require-top-level-describe.ts | 2 +- src/rules/valid-expect.ts | 2 +- src/rules/valid-title.ts | 2 +- 105 files changed, 106 insertions(+), 262 deletions(-) diff --git a/README.md b/README.md index 7d6c7da3..9621c3d3 100644 --- a/README.md +++ b/README.md @@ -260,7 +260,7 @@ export default defineConfig({ | [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-test-timeout](docs/rules/require-test-timeout.md) | require tests to declare a timeout | | | | | | | | +| [require-test-timeout](docs/rules/require-test-timeout.md) | require tests to declare a timeout | | | 🌐 | | | | | | [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 | ✅ | 🌐 | | | | | | diff --git a/docs/rules/consistent-each-for.md b/docs/rules/consistent-each-for.md index 6e62ea85..89fb5193 100644 --- a/docs/rules/consistent-each-for.md +++ b/docs/rules/consistent-each-for.md @@ -1,6 +1,4 @@ -# vitest/consistent-each-for - -📝 Enforce using `.each` or `.for` consistently. +# Enforce using `.each` or `.for` consistently (`vitest/consistent-each-for`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/consistent-test-filename.md b/docs/rules/consistent-test-filename.md index ff55eb4d..fecdec64 100644 --- a/docs/rules/consistent-test-filename.md +++ b/docs/rules/consistent-test-filename.md @@ -1,6 +1,4 @@ -# vitest/consistent-test-filename - -📝 Require test file pattern. +# Require test file pattern (`vitest/consistent-test-filename`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index f64db3b8..28131be7 100644 --- a/docs/rules/consistent-test-it.md +++ b/docs/rules/consistent-test-it.md @@ -1,6 +1,4 @@ -# vitest/consistent-test-it - -📝 Enforce using test or it but not both. +# Enforce using test or it but not both (`vitest/consistent-test-it`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/consistent-vitest-vi.md b/docs/rules/consistent-vitest-vi.md index ad856b41..ad741803 100644 --- a/docs/rules/consistent-vitest-vi.md +++ b/docs/rules/consistent-vitest-vi.md @@ -1,6 +1,4 @@ -# vitest/consistent-vitest-vi - -📝 Enforce using vitest or vi but not both. +# Enforce using vitest or vi but not both (`vitest/consistent-vitest-vi`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index feb9588b..da8593e7 100644 --- a/docs/rules/expect-expect.md +++ b/docs/rules/expect-expect.md @@ -1,6 +1,4 @@ -# vitest/expect-expect - -📝 Enforce having expectation in test body. +# Enforce having expectation in test body (`vitest/expect-expect`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/hoisted-apis-on-top.md b/docs/rules/hoisted-apis-on-top.md index 4e8773ff..918164bc 100644 --- a/docs/rules/hoisted-apis-on-top.md +++ b/docs/rules/hoisted-apis-on-top.md @@ -1,6 +1,4 @@ -# vitest/hoisted-apis-on-top - -📝 Enforce hoisted APIs to be on top of the file. +# Enforce hoisted APIs to be on top of the file (`vitest/hoisted-apis-on-top`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/max-expects.md b/docs/rules/max-expects.md index 04a0f4b1..8c4f97e0 100644 --- a/docs/rules/max-expects.md +++ b/docs/rules/max-expects.md @@ -1,6 +1,4 @@ -# vitest/max-expects - -📝 Enforce a maximum number of expect per test. +# Enforce a maximum number of expect per test (`vitest/max-expects`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/max-nested-describe.md b/docs/rules/max-nested-describe.md index eed25868..48be6ff4 100644 --- a/docs/rules/max-nested-describe.md +++ b/docs/rules/max-nested-describe.md @@ -1,6 +1,4 @@ -# vitest/max-nested-describe - -📝 Require describe block to be less than set max value or default value. +# Require describe block to be less than set max value or default value (`vitest/max-nested-describe`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index 788e38f4..d4ca5a39 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -1,6 +1,4 @@ -# vitest/no-alias-methods - -📝 Disallow alias methods. +# Disallow alias methods (`vitest/no-alias-methods`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-commented-out-tests.md b/docs/rules/no-commented-out-tests.md index 31591aa3..225f8a86 100644 --- a/docs/rules/no-commented-out-tests.md +++ b/docs/rules/no-commented-out-tests.md @@ -1,6 +1,4 @@ -# vitest/no-commented-out-tests - -📝 Disallow 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. diff --git a/docs/rules/no-conditional-expect.md b/docs/rules/no-conditional-expect.md index c0ed4812..1a268f46 100644 --- a/docs/rules/no-conditional-expect.md +++ b/docs/rules/no-conditional-expect.md @@ -1,6 +1,4 @@ -# vitest/no-conditional-expect - -📝 Disallow conditional expects. +# Disallow conditional expects (`vitest/no-conditional-expect`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-conditional-in-test.md b/docs/rules/no-conditional-in-test.md index 42a5d1d6..033398dd 100644 --- a/docs/rules/no-conditional-in-test.md +++ b/docs/rules/no-conditional-in-test.md @@ -1,6 +1,4 @@ -# vitest/no-conditional-in-test - -📝 Disallow conditional tests. +# Disallow conditional tests (`vitest/no-conditional-in-test`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-conditional-tests.md b/docs/rules/no-conditional-tests.md index 8ab51b63..a6ad8e05 100644 --- a/docs/rules/no-conditional-tests.md +++ b/docs/rules/no-conditional-tests.md @@ -1,6 +1,4 @@ -# vitest/no-conditional-tests - -📝 Disallow conditional tests. +# Disallow conditional tests (`vitest/no-conditional-tests`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-disabled-tests.md b/docs/rules/no-disabled-tests.md index 744f8945..eff61236 100644 --- a/docs/rules/no-disabled-tests.md +++ b/docs/rules/no-disabled-tests.md @@ -1,6 +1,4 @@ -# vitest/no-disabled-tests - -📝 Disallow disabled tests. +# Disallow disabled tests (`vitest/no-disabled-tests`) ⚠️ This rule _warns_ in the following configs: 🌐 `all`, ✅ `recommended`. diff --git a/docs/rules/no-done-callback.md b/docs/rules/no-done-callback.md index 0810a922..8e99f7ed 100644 --- a/docs/rules/no-done-callback.md +++ b/docs/rules/no-done-callback.md @@ -1,6 +1,4 @@ -# vitest/no-done-callback - -📝 Disallow using a callback in asynchronous tests and hooks. +# Disallow using a callback in asynchronous tests and hooks (`vitest/no-done-callback`) ❌ This rule is deprecated. diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index effc1c3f..ef758673 100644 --- a/docs/rules/no-duplicate-hooks.md +++ b/docs/rules/no-duplicate-hooks.md @@ -1,6 +1,4 @@ -# vitest/no-duplicate-hooks - -📝 Disallow duplicate hooks and teardown hooks. +# Disallow duplicate hooks and teardown hooks (`vitest/no-duplicate-hooks`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index b47301e8..8a2e6010 100644 --- a/docs/rules/no-focused-tests.md +++ b/docs/rules/no-focused-tests.md @@ -1,6 +1,4 @@ -# vitest/no-focused-tests - -📝 Disallow focused tests. +# Disallow focused tests (`vitest/no-focused-tests`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index bb305116..274422cf 100644 --- a/docs/rules/no-hooks.md +++ b/docs/rules/no-hooks.md @@ -1,6 +1,4 @@ -# vitest/no-hooks - -📝 Disallow setup and teardown hooks. +# Disallow setup and teardown hooks (`vitest/no-hooks`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index 457bfc0d..a0ede1b3 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -1,6 +1,4 @@ -# vitest/no-identical-title - -📝 Disallow identical titles. +# Disallow identical titles (`vitest/no-identical-title`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-import-node-test.md b/docs/rules/no-import-node-test.md index 9e637578..de690ec0 100644 --- a/docs/rules/no-import-node-test.md +++ b/docs/rules/no-import-node-test.md @@ -1,6 +1,4 @@ -# vitest/no-import-node-test - -📝 Disallow importing `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. diff --git a/docs/rules/no-importing-vitest-globals.md b/docs/rules/no-importing-vitest-globals.md index 0fc1f0e1..2ba2b943 100644 --- a/docs/rules/no-importing-vitest-globals.md +++ b/docs/rules/no-importing-vitest-globals.md @@ -1,6 +1,4 @@ -# vitest/no-importing-vitest-globals - -📝 Disallow importing Vitest globals. +# Disallow importing Vitest globals (`vitest/no-importing-vitest-globals`) 🚫 This rule is _disabled_ in the 🌐 `all` config. diff --git a/docs/rules/no-interpolation-in-snapshots.md b/docs/rules/no-interpolation-in-snapshots.md index 1ca4750c..b532c8ed 100644 --- a/docs/rules/no-interpolation-in-snapshots.md +++ b/docs/rules/no-interpolation-in-snapshots.md @@ -1,6 +1,4 @@ -# vitest/no-interpolation-in-snapshots - -📝 Disallow string interpolation in snapshots. +# Disallow string interpolation in snapshots (`vitest/no-interpolation-in-snapshots`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index cfa9ca79..6f06b238 100644 --- a/docs/rules/no-large-snapshots.md +++ b/docs/rules/no-large-snapshots.md @@ -1,6 +1,4 @@ -# vitest/no-large-snapshots - -📝 Disallow large snapshots. +# Disallow large snapshots (`vitest/no-large-snapshots`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-mocks-import.md b/docs/rules/no-mocks-import.md index 5fc58669..528644eb 100644 --- a/docs/rules/no-mocks-import.md +++ b/docs/rules/no-mocks-import.md @@ -1,6 +1,4 @@ -# vitest/no-mocks-import - -📝 Disallow importing from **mocks** directory. +# Disallow importing from **mocks** directory (`vitest/no-mocks-import`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-restricted-matchers.md b/docs/rules/no-restricted-matchers.md index fc222d80..67edb0ac 100644 --- a/docs/rules/no-restricted-matchers.md +++ b/docs/rules/no-restricted-matchers.md @@ -1,6 +1,4 @@ -# vitest/no-restricted-matchers - -📝 Disallow the use of certain matchers. +# Disallow the use of certain matchers (`vitest/no-restricted-matchers`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-restricted-vi-methods.md b/docs/rules/no-restricted-vi-methods.md index 5091cd1f..af1a7da7 100644 --- a/docs/rules/no-restricted-vi-methods.md +++ b/docs/rules/no-restricted-vi-methods.md @@ -1,6 +1,4 @@ -# vitest/no-restricted-vi-methods - -📝 Disallow specific `vi.` methods. +# Disallow specific `vi.` methods (`vitest/no-restricted-vi-methods`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-standalone-expect.md b/docs/rules/no-standalone-expect.md index 60caa8c5..30f58651 100644 --- a/docs/rules/no-standalone-expect.md +++ b/docs/rules/no-standalone-expect.md @@ -1,6 +1,4 @@ -# vitest/no-standalone-expect - -📝 Disallow using `expect` outside of `it` or `test` blocks. +# Disallow using `expect` outside of `it` or `test` blocks (`vitest/no-standalone-expect`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index 64002af3..02f99948 100644 --- a/docs/rules/no-test-prefixes.md +++ b/docs/rules/no-test-prefixes.md @@ -1,6 +1,4 @@ -# vitest/no-test-prefixes - -📝 Disallow using the `f` and `x` prefixes in favour of `.only` and `.skip`. +# Disallow using the `f` and `x` prefixes in favour of `.only` and `.skip` (`vitest/no-test-prefixes`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-test-return-statement.md b/docs/rules/no-test-return-statement.md index 6cc023ee..db137ab8 100644 --- a/docs/rules/no-test-return-statement.md +++ b/docs/rules/no-test-return-statement.md @@ -1,6 +1,4 @@ -# vitest/no-test-return-statement - -📝 Disallow return statements in tests. +# Disallow return statements in tests (`vitest/no-test-return-statement`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-unneeded-async-expect-function.md b/docs/rules/no-unneeded-async-expect-function.md index 1376c4e1..c3cabacf 100644 --- a/docs/rules/no-unneeded-async-expect-function.md +++ b/docs/rules/no-unneeded-async-expect-function.md @@ -1,6 +1,4 @@ -# vitest/no-unneeded-async-expect-function - -📝 Disallow unnecessary async function wrapper for expected promises. +# Disallow unnecessary async function wrapper for expected promises (`vitest/no-unneeded-async-expect-function`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-after-all-blocks.md b/docs/rules/padding-around-after-all-blocks.md index cf518dc1..1e681c07 100644 --- a/docs/rules/padding-around-after-all-blocks.md +++ b/docs/rules/padding-around-after-all-blocks.md @@ -1,6 +1,4 @@ -# vitest/padding-around-after-all-blocks - -📝 Enforce padding around `afterAll` blocks. +# Enforce padding around `afterAll` blocks (`vitest/padding-around-after-all-blocks`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-after-each-blocks.md b/docs/rules/padding-around-after-each-blocks.md index 453645dd..a41bec9d 100644 --- a/docs/rules/padding-around-after-each-blocks.md +++ b/docs/rules/padding-around-after-each-blocks.md @@ -1,6 +1,4 @@ -# vitest/padding-around-after-each-blocks - -📝 Enforce padding around `afterEach` blocks. +# Enforce padding around `afterEach` blocks (`vitest/padding-around-after-each-blocks`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-all.md b/docs/rules/padding-around-all.md index 48479a84..b44c129f 100644 --- a/docs/rules/padding-around-all.md +++ b/docs/rules/padding-around-all.md @@ -1,6 +1,4 @@ -# vitest/padding-around-all - -📝 Enforce padding around vitest functions. +# Enforce padding around vitest functions (`vitest/padding-around-all`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-before-all-blocks.md b/docs/rules/padding-around-before-all-blocks.md index 143f06e9..a4fd1d10 100644 --- a/docs/rules/padding-around-before-all-blocks.md +++ b/docs/rules/padding-around-before-all-blocks.md @@ -1,6 +1,4 @@ -# vitest/padding-around-before-all-blocks - -📝 Enforce padding around `beforeAll` blocks. +# Enforce padding around `beforeAll` blocks (`vitest/padding-around-before-all-blocks`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-before-each-blocks.md b/docs/rules/padding-around-before-each-blocks.md index ee601222..43137841 100644 --- a/docs/rules/padding-around-before-each-blocks.md +++ b/docs/rules/padding-around-before-each-blocks.md @@ -1,6 +1,4 @@ -# vitest/padding-around-before-each-blocks - -📝 Enforce padding around `beforeEach` blocks. +# Enforce padding around `beforeEach` blocks (`vitest/padding-around-before-each-blocks`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-describe-blocks.md b/docs/rules/padding-around-describe-blocks.md index 9b2dc46c..b354cab9 100644 --- a/docs/rules/padding-around-describe-blocks.md +++ b/docs/rules/padding-around-describe-blocks.md @@ -1,6 +1,4 @@ -# vitest/padding-around-describe-blocks - -📝 Enforce padding around `describe` blocks. +# Enforce padding around `describe` blocks (`vitest/padding-around-describe-blocks`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-expect-groups.md b/docs/rules/padding-around-expect-groups.md index 30d3b0b9..a5ea8a14 100644 --- a/docs/rules/padding-around-expect-groups.md +++ b/docs/rules/padding-around-expect-groups.md @@ -1,6 +1,4 @@ -# vitest/padding-around-expect-groups - -📝 Enforce padding around `expect` groups. +# Enforce padding around `expect` groups (`vitest/padding-around-expect-groups`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-test-blocks.md b/docs/rules/padding-around-test-blocks.md index f9ea33d5..cb317f2a 100644 --- a/docs/rules/padding-around-test-blocks.md +++ b/docs/rules/padding-around-test-blocks.md @@ -1,6 +1,4 @@ -# vitest/padding-around-test-blocks - -📝 Enforce padding around `test` blocks. +# Enforce padding around `test` blocks (`vitest/padding-around-test-blocks`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-called-exactly-once-with.md b/docs/rules/prefer-called-exactly-once-with.md index 5f209fd0..b12718f3 100644 --- a/docs/rules/prefer-called-exactly-once-with.md +++ b/docs/rules/prefer-called-exactly-once-with.md @@ -1,6 +1,4 @@ -# vitest/prefer-called-exactly-once-with - -📝 Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith`. +# Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith` (`vitest/prefer-called-exactly-once-with`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-called-once.md b/docs/rules/prefer-called-once.md index 46238c18..ff28e860 100644 --- a/docs/rules/prefer-called-once.md +++ b/docs/rules/prefer-called-once.md @@ -1,6 +1,4 @@ -# vitest/prefer-called-once - -📝 Enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()`. +# Enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()` (`vitest/prefer-called-once`) 🚫 This rule is _disabled_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index 20e8a354..05dfb6b2 100644 --- a/docs/rules/prefer-called-times.md +++ b/docs/rules/prefer-called-times.md @@ -1,6 +1,4 @@ -# vitest/prefer-called-times - -📝 Enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)`. +# Enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)` (`vitest/prefer-called-times`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-called-with.md b/docs/rules/prefer-called-with.md index 53c01dbc..cc26bf5c 100644 --- a/docs/rules/prefer-called-with.md +++ b/docs/rules/prefer-called-with.md @@ -1,6 +1,4 @@ -# vitest/prefer-called-with - -📝 Enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`. +# Enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` (`vitest/prefer-called-with`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-comparison-matcher.md b/docs/rules/prefer-comparison-matcher.md index 9b276ae4..775a169d 100644 --- a/docs/rules/prefer-comparison-matcher.md +++ b/docs/rules/prefer-comparison-matcher.md @@ -1,6 +1,4 @@ -# vitest/prefer-comparison-matcher - -📝 Enforce using the built-in comparison matchers. +# Enforce using the built-in comparison matchers (`vitest/prefer-comparison-matcher`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-describe-function-title.md b/docs/rules/prefer-describe-function-title.md index 4cad016c..f7f747c3 100644 --- a/docs/rules/prefer-describe-function-title.md +++ b/docs/rules/prefer-describe-function-title.md @@ -1,6 +1,4 @@ -# vitest/prefer-describe-function-title - -📝 Enforce using a function as a describe title over an equivalent string. +# Enforce using a function as a describe title over an equivalent string (`vitest/prefer-describe-function-title`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-each.md b/docs/rules/prefer-each.md index a2207233..f11acf58 100644 --- a/docs/rules/prefer-each.md +++ b/docs/rules/prefer-each.md @@ -1,6 +1,4 @@ -# vitest/prefer-each - -📝 Enforce using `each` rather than manual loops. +# Enforce using `each` rather than manual loops (`vitest/prefer-each`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-equality-matcher.md b/docs/rules/prefer-equality-matcher.md index 48e523d6..af69ffc5 100644 --- a/docs/rules/prefer-equality-matcher.md +++ b/docs/rules/prefer-equality-matcher.md @@ -1,6 +1,4 @@ -# vitest/prefer-equality-matcher - -📝 Enforce using the built-in equality matchers. +# Enforce using the built-in equality matchers (`vitest/prefer-equality-matcher`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index 0cf09c7a..01a19f98 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -1,6 +1,4 @@ -# vitest/prefer-expect-assertions - -📝 Enforce using expect assertions instead of callbacks. +# Enforce using expect assertions instead of callbacks (`vitest/prefer-expect-assertions`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-expect-resolves.md b/docs/rules/prefer-expect-resolves.md index a4d0a7b0..d52feae7 100644 --- a/docs/rules/prefer-expect-resolves.md +++ b/docs/rules/prefer-expect-resolves.md @@ -1,6 +1,4 @@ -# vitest/prefer-expect-resolves - -📝 Enforce using `expect().resolves` over `expect(await ...)` syntax. +# Enforce using `expect().resolves` over `expect(await ...)` syntax (`vitest/prefer-expect-resolves`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-expect-type-of.md b/docs/rules/prefer-expect-type-of.md index a77ee5cf..802a5be8 100644 --- a/docs/rules/prefer-expect-type-of.md +++ b/docs/rules/prefer-expect-type-of.md @@ -1,6 +1,4 @@ -# vitest/prefer-expect-type-of - -📝 Enforce using `expectTypeOf` instead of `expect(typeof ...)`. +# Enforce using `expectTypeOf` instead of `expect(typeof ...)` (`vitest/prefer-expect-type-of`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-hooks-in-order.md b/docs/rules/prefer-hooks-in-order.md index e5f9b77d..8945d3c0 100644 --- a/docs/rules/prefer-hooks-in-order.md +++ b/docs/rules/prefer-hooks-in-order.md @@ -1,6 +1,4 @@ -# vitest/prefer-hooks-in-order - -📝 Enforce having hooks in consistent order. +# Enforce having hooks in consistent order (`vitest/prefer-hooks-in-order`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index 67bf3576..12db126c 100644 --- a/docs/rules/prefer-hooks-on-top.md +++ b/docs/rules/prefer-hooks-on-top.md @@ -1,6 +1,4 @@ -# vitest/prefer-hooks-on-top - -📝 Enforce having hooks before any test cases. +# Enforce having hooks before any test cases (`vitest/prefer-hooks-on-top`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-import-in-mock.md b/docs/rules/prefer-import-in-mock.md index 917cc9bc..ee19816a 100644 --- a/docs/rules/prefer-import-in-mock.md +++ b/docs/rules/prefer-import-in-mock.md @@ -1,6 +1,4 @@ -# vitest/prefer-import-in-mock - -📝 Prefer dynamic import in mock. +# Prefer dynamic import in mock (`vitest/prefer-import-in-mock`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-importing-vitest-globals.md b/docs/rules/prefer-importing-vitest-globals.md index d114a7bc..db859b08 100644 --- a/docs/rules/prefer-importing-vitest-globals.md +++ b/docs/rules/prefer-importing-vitest-globals.md @@ -1,6 +1,4 @@ -# vitest/prefer-importing-vitest-globals - -📝 Enforce importing Vitest globals. +# Enforce importing Vitest globals (`vitest/prefer-importing-vitest-globals`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-lowercase-title.md b/docs/rules/prefer-lowercase-title.md index b865cae0..61671cf8 100644 --- a/docs/rules/prefer-lowercase-title.md +++ b/docs/rules/prefer-lowercase-title.md @@ -1,6 +1,4 @@ -# vitest/prefer-lowercase-title - -📝 Enforce lowercase titles. +# Enforce lowercase titles (`vitest/prefer-lowercase-title`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-mock-promise-shorthand.md b/docs/rules/prefer-mock-promise-shorthand.md index a3fc9671..eb7f00a7 100644 --- a/docs/rules/prefer-mock-promise-shorthand.md +++ b/docs/rules/prefer-mock-promise-shorthand.md @@ -1,6 +1,4 @@ -# vitest/prefer-mock-promise-shorthand - -📝 Enforce mock resolved/rejected shorthands for promises. +# Enforce mock resolved/rejected shorthands for promises (`vitest/prefer-mock-promise-shorthand`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-mock-return-shorthand.md b/docs/rules/prefer-mock-return-shorthand.md index 78db8721..02c0529d 100644 --- a/docs/rules/prefer-mock-return-shorthand.md +++ b/docs/rules/prefer-mock-return-shorthand.md @@ -1,6 +1,4 @@ -# vitest/prefer-mock-return-shorthand - -📝 Prefer mock return shorthands. +# Prefer mock return shorthands (`vitest/prefer-mock-return-shorthand`) 🔧 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 fec6b718..a09db10d 100644 --- a/docs/rules/prefer-snapshot-hint.md +++ b/docs/rules/prefer-snapshot-hint.md @@ -1,6 +1,4 @@ -# vitest/prefer-snapshot-hint - -📝 Enforce including a hint with external snapshots. +# Enforce including a hint with external snapshots (`vitest/prefer-snapshot-hint`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index 3d0fe65a..2e044966 100644 --- a/docs/rules/prefer-spy-on.md +++ b/docs/rules/prefer-spy-on.md @@ -1,6 +1,4 @@ -# vitest/prefer-spy-on - -📝 Enforce using `vi.spyOn`. +# Enforce using `vi.spyOn` (`vitest/prefer-spy-on`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-strict-boolean-matchers.md b/docs/rules/prefer-strict-boolean-matchers.md index ca63cc2b..0ed77fc0 100644 --- a/docs/rules/prefer-strict-boolean-matchers.md +++ b/docs/rules/prefer-strict-boolean-matchers.md @@ -1,6 +1,4 @@ -# vitest/prefer-strict-boolean-matchers - -📝 Enforce using `toBe(true)` and `toBe(false)` over matchers that coerce types to boolean. +# 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. diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index f0a67960..f5ad6ccb 100644 --- a/docs/rules/prefer-strict-equal.md +++ b/docs/rules/prefer-strict-equal.md @@ -1,6 +1,4 @@ -# vitest/prefer-strict-equal - -📝 Enforce strict equal over equal. +# Enforce strict equal over equal (`vitest/prefer-strict-equal`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-be-falsy.md b/docs/rules/prefer-to-be-falsy.md index 5d8beb25..dfcfde4a 100644 --- a/docs/rules/prefer-to-be-falsy.md +++ b/docs/rules/prefer-to-be-falsy.md @@ -1,6 +1,4 @@ -# vitest/prefer-to-be-falsy - -📝 Enforce using toBeFalsy(). +# Enforce using toBeFalsy() (`vitest/prefer-to-be-falsy`) 🚫 This rule is _disabled_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-be-object.md b/docs/rules/prefer-to-be-object.md index 16028a4a..349d4d86 100644 --- a/docs/rules/prefer-to-be-object.md +++ b/docs/rules/prefer-to-be-object.md @@ -1,6 +1,4 @@ -# vitest/prefer-to-be-object - -📝 Enforce using toBeObject(). +# Enforce using toBeObject() (`vitest/prefer-to-be-object`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-be-truthy.md b/docs/rules/prefer-to-be-truthy.md index 2ec07edb..50b2ee0e 100644 --- a/docs/rules/prefer-to-be-truthy.md +++ b/docs/rules/prefer-to-be-truthy.md @@ -1,6 +1,4 @@ -# vitest/prefer-to-be-truthy - -📝 Enforce using `toBeTruthy`. +# Enforce using `toBeTruthy` (`vitest/prefer-to-be-truthy`) 🚫 This rule is _disabled_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-be.md b/docs/rules/prefer-to-be.md index ad8a0ce1..380f4109 100644 --- a/docs/rules/prefer-to-be.md +++ b/docs/rules/prefer-to-be.md @@ -1,6 +1,4 @@ -# vitest/prefer-to-be - -📝 Enforce using toBe(). +# Enforce using toBe() (`vitest/prefer-to-be`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index b177c42a..c0f6bcdd 100644 --- a/docs/rules/prefer-to-contain.md +++ b/docs/rules/prefer-to-contain.md @@ -1,6 +1,4 @@ -# vitest/prefer-to-contain - -📝 Enforce using toContain(). +# Enforce using toContain() (`vitest/prefer-to-contain`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-have-been-called-times.md b/docs/rules/prefer-to-have-been-called-times.md index bfa77edc..ee8e73fb 100644 --- a/docs/rules/prefer-to-have-been-called-times.md +++ b/docs/rules/prefer-to-have-been-called-times.md @@ -1,6 +1,4 @@ -# vitest/prefer-to-have-been-called-times - -📝 Suggest using `toHaveBeenCalledTimes()`. +# Suggest using `toHaveBeenCalledTimes()` (`vitest/prefer-to-have-been-called-times`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index d11c4a86..29d2d498 100644 --- a/docs/rules/prefer-to-have-length.md +++ b/docs/rules/prefer-to-have-length.md @@ -1,6 +1,4 @@ -# vitest/prefer-to-have-length - -📝 Enforce using toHaveLength(). +# Enforce using toHaveLength() (`vitest/prefer-to-have-length`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index 6cd34652..bced1184 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -1,6 +1,4 @@ -# vitest/prefer-todo - -📝 Enforce using `test.todo`. +# Enforce using `test.todo` (`vitest/prefer-todo`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-vi-mocked.md b/docs/rules/prefer-vi-mocked.md index 817581cf..07f97452 100644 --- a/docs/rules/prefer-vi-mocked.md +++ b/docs/rules/prefer-vi-mocked.md @@ -1,6 +1,4 @@ -# vitest/prefer-vi-mocked - -📝 Require `vi.mocked()` over `fn as Mock`. +# Require `vi.mocked()` over `fn as Mock` (`vitest/prefer-vi-mocked`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/require-awaited-expect-poll.md b/docs/rules/require-awaited-expect-poll.md index 27585055..59582a31 100644 --- a/docs/rules/require-awaited-expect-poll.md +++ b/docs/rules/require-awaited-expect-poll.md @@ -1,6 +1,4 @@ -# vitest/require-awaited-expect-poll - -📝 Ensure that every `expect.poll` call is awaited. +# Ensure that every `expect.poll` call is awaited (`vitest/require-awaited-expect-poll`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/require-hook.md b/docs/rules/require-hook.md index 81b8ab8e..f410f6d4 100644 --- a/docs/rules/require-hook.md +++ b/docs/rules/require-hook.md @@ -1,6 +1,4 @@ -# vitest/require-hook - -📝 Require setup and teardown to be within a hook. +# Require setup and teardown to be within a hook (`vitest/require-hook`) ⚠️ This rule _warns_ in the 🌐 `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 7310b795..38443e64 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,4 @@ -# vitest/require-local-test-context-for-concurrent-snapshots - -📝 Require local Test Context for concurrent snapshot tests. +# 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. diff --git a/docs/rules/require-mock-type-parameters.md b/docs/rules/require-mock-type-parameters.md index 36644673..2ead38c4 100644 --- a/docs/rules/require-mock-type-parameters.md +++ b/docs/rules/require-mock-type-parameters.md @@ -1,6 +1,4 @@ -# vitest/require-mock-type-parameters - -📝 Enforce using type parameters with vitest mock functions. +# Enforce using type parameters with vitest mock functions (`vitest/require-mock-type-parameters`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/require-test-timeout.md b/docs/rules/require-test-timeout.md index 1992a392..5441876f 100644 --- a/docs/rules/require-test-timeout.md +++ b/docs/rules/require-test-timeout.md @@ -1,5 +1,7 @@ # Require tests to declare a timeout (`vitest/require-test-timeout`) +🚫 This rule is _disabled_ in the 🌐 `all` config. + This rule ensures tests explicitly declare a timeout so long-running tests don't hang silently. diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index 88a44316..34c6326a 100644 --- a/docs/rules/require-to-throw-message.md +++ b/docs/rules/require-to-throw-message.md @@ -1,6 +1,4 @@ -# vitest/require-to-throw-message - -📝 Require toThrow() to be called with an error message. +# Require toThrow() to be called with an error message (`vitest/require-to-throw-message`) ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index 5df7ddcd..2fd78a05 100644 --- a/docs/rules/require-top-level-describe.md +++ b/docs/rules/require-top-level-describe.md @@ -1,6 +1,4 @@ -# vitest/require-top-level-describe - -📝 Enforce that all tests are in a 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. diff --git a/docs/rules/valid-describe-callback.md b/docs/rules/valid-describe-callback.md index 60eca0f3..513310ee 100644 --- a/docs/rules/valid-describe-callback.md +++ b/docs/rules/valid-describe-callback.md @@ -1,6 +1,4 @@ -# vitest/valid-describe-callback - -📝 Enforce 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. diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index 1753fa66..a9d9dcb0 100644 --- a/docs/rules/valid-expect-in-promise.md +++ b/docs/rules/valid-expect-in-promise.md @@ -1,6 +1,4 @@ -# vitest/valid-expect-in-promise - -📝 Require promises that have expectations in their chain to be valid. +# Require promises that have expectations in their chain to be valid (`vitest/valid-expect-in-promise`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index acac1a64..7656ae86 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -1,6 +1,4 @@ -# vitest/valid-expect - -📝 Enforce valid `expect()` usage. +# Enforce valid `expect()` usage (`vitest/valid-expect`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index 6254693c..baa48b4b 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -1,6 +1,4 @@ -# vitest/valid-title - -📝 Enforce valid titles. +# Enforce valid titles (`vitest/valid-title`) 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/warn-todo.md b/docs/rules/warn-todo.md index 23f84dcb..f0dc1c7c 100644 --- a/docs/rules/warn-todo.md +++ b/docs/rules/warn-todo.md @@ -1,6 +1,4 @@ -# vitest/warn-todo - -📝 Disallow `.todo` usage. +# Disallow `.todo` usage (`vitest/warn-todo`) diff --git a/src/index.ts b/src/index.ts index e4c8a5aa..c39eb721 100644 --- a/src/index.ts +++ b/src/index.ts @@ -100,6 +100,7 @@ const allRules = { 'valid-expect': 'warn', 'valid-title': 'warn', 'require-awaited-expect-poll': 'warn', + 'require-test-timeout': 'off', } as const satisfies RuleList const recommendedRules = { diff --git a/src/rules/consistent-test-filename.ts b/src/rules/consistent-test-filename.ts index bc08a063..4bc03634 100644 --- a/src/rules/consistent-test-filename.ts +++ b/src/rules/consistent-test-filename.ts @@ -42,7 +42,7 @@ export default createEslintRule< }, }, }, - ], + ], defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/consistent-test-it.ts b/src/rules/consistent-test-it.ts index 33aec114..e7d3efa8 100644 --- a/src/rules/consistent-test-it.ts +++ b/src/rules/consistent-test-it.ts @@ -77,7 +77,7 @@ export default createEslintRule< }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [{}], create(context, options) { diff --git a/src/rules/consistent-vitest-vi.ts b/src/rules/consistent-vitest-vi.ts index 4cec1903..7b80ecf9 100644 --- a/src/rules/consistent-vitest-vi.ts +++ b/src/rules/consistent-vitest-vi.ts @@ -34,7 +34,7 @@ export default createEslintRule<[Partial<{ fn: UtilName }>], MESSAGE_ID>({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [{ fn: UtilName.vi }], create(context, options) { diff --git a/src/rules/expect-expect.ts b/src/rules/expect-expect.ts index 4e67e589..7df1f200 100644 --- a/src/rules/expect-expect.ts +++ b/src/rules/expect-expect.ts @@ -38,7 +38,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], messages: { noAssertions: 'Test has no assertions', }, diff --git a/src/rules/max-expects.ts b/src/rules/max-expects.ts index 61f7f6ce..882496f1 100644 --- a/src/rules/max-expects.ts +++ b/src/rules/max-expects.ts @@ -36,7 +36,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [{ max: 5 }], create(context, [{ max }]) { diff --git a/src/rules/max-nested-describe.ts b/src/rules/max-nested-describe.ts index 4cbe10bd..ccb3004e 100644 --- a/src/rules/max-nested-describe.ts +++ b/src/rules/max-nested-describe.ts @@ -28,7 +28,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], messages: { maxNestedDescribe: 'Nested describe block should be less than set max value', diff --git a/src/rules/no-conditional-expect.ts b/src/rules/no-conditional-expect.ts index 8a2c9386..d6f79a7a 100644 --- a/src/rules/no-conditional-expect.ts +++ b/src/rules/no-conditional-expect.ts @@ -45,7 +45,7 @@ export default createEslintRule({ }, }, }, - ], + ], defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/no-focused-tests.ts b/src/rules/no-focused-tests.ts index a1c5d1d1..915a2f0a 100644 --- a/src/rules/no-focused-tests.ts +++ b/src/rules/no-focused-tests.ts @@ -39,7 +39,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], messages: { noFocusedTests: 'Focused tests are not allowed', }, diff --git a/src/rules/no-hooks.ts b/src/rules/no-hooks.ts index dd4d78c3..f8189d6e 100644 --- a/src/rules/no-hooks.ts +++ b/src/rules/no-hooks.ts @@ -40,7 +40,7 @@ export default createEslintRule< }, additionalProperties: false, }, - ], + ], defaultOptions: [], messages: { unexpectedHook: "Unexpected '{{ hookName }}' hook", }, diff --git a/src/rules/no-large-snapshots.ts b/src/rules/no-large-snapshots.ts index ba1a1762..08c81f53 100644 --- a/src/rules/no-large-snapshots.ts +++ b/src/rules/no-large-snapshots.ts @@ -97,7 +97,7 @@ export default createEslintRule<[RuleOptions], MESSAGE_IDS>({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [{}], create(context, [options]) { diff --git a/src/rules/no-restricted-matchers.ts b/src/rules/no-restricted-matchers.ts index 81ab23c2..54b0111a 100644 --- a/src/rules/no-restricted-matchers.ts +++ b/src/rules/no-restricted-matchers.ts @@ -31,7 +31,7 @@ export default createEslintRule({ type: ['string', 'null'], }, }, - ], + ], defaultOptions: [], messages: { restrictedChain: 'use of {{ restriction }} is disallowed', restrictedChainWithMessage: '{{ message }}', diff --git a/src/rules/no-restricted-vi-methods.ts b/src/rules/no-restricted-vi-methods.ts index 7024009c..5e34a24b 100644 --- a/src/rules/no-restricted-vi-methods.ts +++ b/src/rules/no-restricted-vi-methods.ts @@ -18,7 +18,7 @@ export default createEslintRule({ type: 'object', additionalProperties: { type: ['string', 'null'] }, }, - ], + ], defaultOptions: [], messages: { restrictedViMethod: 'Use of `{{ restriction }}` is disallowed', restrictedViMethodWithMessage: '{{ message }}', diff --git a/src/rules/no-standalone-expect.ts b/src/rules/no-standalone-expect.ts index db01efa6..49778574 100644 --- a/src/rules/no-standalone-expect.ts +++ b/src/rules/no-standalone-expect.ts @@ -68,7 +68,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [{ additionalTestBlockFunctions: [] }], create(context, [{ additionalTestBlockFunctions = [] }]) { diff --git a/src/rules/prefer-expect-assertions.ts b/src/rules/prefer-expect-assertions.ts index 2b42ebac..a014836e 100644 --- a/src/rules/prefer-expect-assertions.ts +++ b/src/rules/prefer-expect-assertions.ts @@ -89,7 +89,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/prefer-import-in-mock.ts b/src/rules/prefer-import-in-mock.ts index 5fb0f7b2..e7666820 100644 --- a/src/rules/prefer-import-in-mock.ts +++ b/src/rules/prefer-import-in-mock.ts @@ -34,6 +34,7 @@ export default createEslintRule({ additionalProperties: false, }, ], + defaultOptions: [], }, defaultOptions: [{ fixable: true }], create(context, options) { diff --git a/src/rules/prefer-lowercase-title.ts b/src/rules/prefer-lowercase-title.ts index 1f2c5a79..b1fd903f 100644 --- a/src/rules/prefer-lowercase-title.ts +++ b/src/rules/prefer-lowercase-title.ts @@ -103,7 +103,7 @@ export default createEslintRule< }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/prefer-snapshot-hint.ts b/src/rules/prefer-snapshot-hint.ts index 16e63fce..1bbf6bb3 100644 --- a/src/rules/prefer-snapshot-hint.ts +++ b/src/rules/prefer-snapshot-hint.ts @@ -48,7 +48,7 @@ export default createEslintRule({ type: 'string', enum: ['always', 'multi'], }, - ], + ], defaultOptions: [], }, defaultOptions: ['multi'], create(context, [mode]) { diff --git a/src/rules/require-hook.ts b/src/rules/require-hook.ts index c942a1ec..60097aa0 100644 --- a/src/rules/require-hook.ts +++ b/src/rules/require-hook.ts @@ -77,7 +77,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/require-mock-type-parameters.ts b/src/rules/require-mock-type-parameters.ts index e3ce8104..f16290a7 100644 --- a/src/rules/require-mock-type-parameters.ts +++ b/src/rules/require-mock-type-parameters.ts @@ -29,7 +29,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/require-top-level-describe.ts b/src/rules/require-top-level-describe.ts index 7a254a6a..0557ed27 100644 --- a/src/rules/require-top-level-describe.ts +++ b/src/rules/require-top-level-describe.ts @@ -36,7 +36,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [{ maxNumberOfTopLevelDescribes: Infinity }], create(context, options) { diff --git a/src/rules/valid-expect.ts b/src/rules/valid-expect.ts index 420baab4..d32ac820 100644 --- a/src/rules/valid-expect.ts +++ b/src/rules/valid-expect.ts @@ -171,7 +171,7 @@ export default createEslintRule< }, additionalProperties: false, }, - ], + ], defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/valid-title.ts b/src/rules/valid-title.ts index 9cffb9bf..c0609f1d 100644 --- a/src/rules/valid-title.ts +++ b/src/rules/valid-title.ts @@ -181,7 +181,7 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], + ], defaultOptions: [], fixable: 'code', }, defaultOptions: [ From 61e9276cdf9667e2fe572827b76732dd75d620bc Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Wed, 7 Jan 2026 10:16:47 +0200 Subject: [PATCH 3/5] run prettier --- src/rules/consistent-test-filename.ts | 3 ++- src/rules/consistent-test-it.ts | 3 ++- src/rules/consistent-vitest-vi.ts | 3 ++- src/rules/expect-expect.ts | 3 ++- src/rules/max-expects.ts | 3 ++- src/rules/max-nested-describe.ts | 3 ++- src/rules/no-conditional-expect.ts | 3 ++- src/rules/no-focused-tests.ts | 3 ++- src/rules/no-hooks.ts | 3 ++- src/rules/no-large-snapshots.ts | 3 ++- src/rules/no-restricted-matchers.ts | 3 ++- src/rules/no-restricted-vi-methods.ts | 3 ++- src/rules/no-standalone-expect.ts | 3 ++- src/rules/prefer-expect-assertions.ts | 3 ++- src/rules/prefer-lowercase-title.ts | 3 ++- src/rules/prefer-snapshot-hint.ts | 3 ++- src/rules/require-hook.ts | 3 ++- src/rules/require-mock-type-parameters.ts | 3 ++- src/rules/require-top-level-describe.ts | 3 ++- src/rules/valid-expect.ts | 3 ++- src/rules/valid-title.ts | 3 ++- 21 files changed, 42 insertions(+), 21 deletions(-) diff --git a/src/rules/consistent-test-filename.ts b/src/rules/consistent-test-filename.ts index 4bc03634..8f60352d 100644 --- a/src/rules/consistent-test-filename.ts +++ b/src/rules/consistent-test-filename.ts @@ -42,7 +42,8 @@ export default createEslintRule< }, }, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/consistent-test-it.ts b/src/rules/consistent-test-it.ts index e7d3efa8..25fb77fc 100644 --- a/src/rules/consistent-test-it.ts +++ b/src/rules/consistent-test-it.ts @@ -77,7 +77,8 @@ export default createEslintRule< }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [{}], create(context, options) { diff --git a/src/rules/consistent-vitest-vi.ts b/src/rules/consistent-vitest-vi.ts index 7b80ecf9..1e54da04 100644 --- a/src/rules/consistent-vitest-vi.ts +++ b/src/rules/consistent-vitest-vi.ts @@ -34,7 +34,8 @@ export default createEslintRule<[Partial<{ fn: UtilName }>], MESSAGE_ID>({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [{ fn: UtilName.vi }], create(context, options) { diff --git a/src/rules/expect-expect.ts b/src/rules/expect-expect.ts index 7df1f200..771d2cf0 100644 --- a/src/rules/expect-expect.ts +++ b/src/rules/expect-expect.ts @@ -38,7 +38,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], messages: { noAssertions: 'Test has no assertions', }, diff --git a/src/rules/max-expects.ts b/src/rules/max-expects.ts index 882496f1..7ea1d6bb 100644 --- a/src/rules/max-expects.ts +++ b/src/rules/max-expects.ts @@ -36,7 +36,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [{ max: 5 }], create(context, [{ max }]) { diff --git a/src/rules/max-nested-describe.ts b/src/rules/max-nested-describe.ts index ccb3004e..051566ab 100644 --- a/src/rules/max-nested-describe.ts +++ b/src/rules/max-nested-describe.ts @@ -28,7 +28,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], messages: { maxNestedDescribe: 'Nested describe block should be less than set max value', diff --git a/src/rules/no-conditional-expect.ts b/src/rules/no-conditional-expect.ts index d6f79a7a..640c3f2a 100644 --- a/src/rules/no-conditional-expect.ts +++ b/src/rules/no-conditional-expect.ts @@ -45,7 +45,8 @@ export default createEslintRule({ }, }, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/no-focused-tests.ts b/src/rules/no-focused-tests.ts index 915a2f0a..95db2e10 100644 --- a/src/rules/no-focused-tests.ts +++ b/src/rules/no-focused-tests.ts @@ -39,7 +39,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], messages: { noFocusedTests: 'Focused tests are not allowed', }, diff --git a/src/rules/no-hooks.ts b/src/rules/no-hooks.ts index f8189d6e..878368f5 100644 --- a/src/rules/no-hooks.ts +++ b/src/rules/no-hooks.ts @@ -40,7 +40,8 @@ export default createEslintRule< }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], messages: { unexpectedHook: "Unexpected '{{ hookName }}' hook", }, diff --git a/src/rules/no-large-snapshots.ts b/src/rules/no-large-snapshots.ts index 08c81f53..11269ae1 100644 --- a/src/rules/no-large-snapshots.ts +++ b/src/rules/no-large-snapshots.ts @@ -97,7 +97,8 @@ export default createEslintRule<[RuleOptions], MESSAGE_IDS>({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [{}], create(context, [options]) { diff --git a/src/rules/no-restricted-matchers.ts b/src/rules/no-restricted-matchers.ts index 54b0111a..b66b7689 100644 --- a/src/rules/no-restricted-matchers.ts +++ b/src/rules/no-restricted-matchers.ts @@ -31,7 +31,8 @@ export default createEslintRule({ type: ['string', 'null'], }, }, - ], defaultOptions: [], + ], + defaultOptions: [], messages: { restrictedChain: 'use of {{ restriction }} is disallowed', restrictedChainWithMessage: '{{ message }}', diff --git a/src/rules/no-restricted-vi-methods.ts b/src/rules/no-restricted-vi-methods.ts index 5e34a24b..eefa7fe3 100644 --- a/src/rules/no-restricted-vi-methods.ts +++ b/src/rules/no-restricted-vi-methods.ts @@ -18,7 +18,8 @@ export default createEslintRule({ type: 'object', additionalProperties: { type: ['string', 'null'] }, }, - ], defaultOptions: [], + ], + defaultOptions: [], messages: { restrictedViMethod: 'Use of `{{ restriction }}` is disallowed', restrictedViMethodWithMessage: '{{ message }}', diff --git a/src/rules/no-standalone-expect.ts b/src/rules/no-standalone-expect.ts index 49778574..6f31b430 100644 --- a/src/rules/no-standalone-expect.ts +++ b/src/rules/no-standalone-expect.ts @@ -68,7 +68,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [{ additionalTestBlockFunctions: [] }], create(context, [{ additionalTestBlockFunctions = [] }]) { diff --git a/src/rules/prefer-expect-assertions.ts b/src/rules/prefer-expect-assertions.ts index a014836e..6d725cb2 100644 --- a/src/rules/prefer-expect-assertions.ts +++ b/src/rules/prefer-expect-assertions.ts @@ -89,7 +89,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/prefer-lowercase-title.ts b/src/rules/prefer-lowercase-title.ts index b1fd903f..e411400a 100644 --- a/src/rules/prefer-lowercase-title.ts +++ b/src/rules/prefer-lowercase-title.ts @@ -103,7 +103,8 @@ export default createEslintRule< }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/prefer-snapshot-hint.ts b/src/rules/prefer-snapshot-hint.ts index 1bbf6bb3..636402f1 100644 --- a/src/rules/prefer-snapshot-hint.ts +++ b/src/rules/prefer-snapshot-hint.ts @@ -48,7 +48,8 @@ export default createEslintRule({ type: 'string', enum: ['always', 'multi'], }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: ['multi'], create(context, [mode]) { diff --git a/src/rules/require-hook.ts b/src/rules/require-hook.ts index 60097aa0..7ebd9a3f 100644 --- a/src/rules/require-hook.ts +++ b/src/rules/require-hook.ts @@ -77,7 +77,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/require-mock-type-parameters.ts b/src/rules/require-mock-type-parameters.ts index f16290a7..83609cb3 100644 --- a/src/rules/require-mock-type-parameters.ts +++ b/src/rules/require-mock-type-parameters.ts @@ -29,7 +29,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/require-top-level-describe.ts b/src/rules/require-top-level-describe.ts index 0557ed27..7cbec9a3 100644 --- a/src/rules/require-top-level-describe.ts +++ b/src/rules/require-top-level-describe.ts @@ -36,7 +36,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [{ maxNumberOfTopLevelDescribes: Infinity }], create(context, options) { diff --git a/src/rules/valid-expect.ts b/src/rules/valid-expect.ts index d32ac820..9f07c9ef 100644 --- a/src/rules/valid-expect.ts +++ b/src/rules/valid-expect.ts @@ -171,7 +171,8 @@ export default createEslintRule< }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/valid-title.ts b/src/rules/valid-title.ts index c0609f1d..875a64a8 100644 --- a/src/rules/valid-title.ts +++ b/src/rules/valid-title.ts @@ -181,7 +181,8 @@ export default createEslintRule({ }, additionalProperties: false, }, - ], defaultOptions: [], + ], + defaultOptions: [], fixable: 'code', }, defaultOptions: [ From 6a20e83bbffcba1596fd74e5b01bc5813c05bdfc Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Wed, 7 Jan 2026 10:28:08 +0200 Subject: [PATCH 4/5] fix type errors --- src/rules/consistent-test-filename.ts | 1 - src/rules/consistent-test-it.ts | 1 - src/rules/consistent-vitest-vi.ts | 1 - src/rules/expect-expect.ts | 7 ++++++- src/rules/max-expects.ts | 1 - src/rules/max-nested-describe.ts | 1 - src/rules/no-conditional-expect.ts | 1 - src/rules/no-focused-tests.ts | 1 - src/rules/no-hooks.ts | 1 - src/rules/no-large-snapshots.ts | 1 - src/rules/no-restricted-vi-methods.ts | 1 - src/rules/prefer-import-in-mock.ts | 1 - src/rules/prefer-lowercase-title.ts | 1 - src/rules/require-hook.ts | 1 - src/rules/require-top-level-describe.ts | 1 - src/rules/valid-expect.ts | 1 - 16 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/rules/consistent-test-filename.ts b/src/rules/consistent-test-filename.ts index 8f60352d..bc08a063 100644 --- a/src/rules/consistent-test-filename.ts +++ b/src/rules/consistent-test-filename.ts @@ -43,7 +43,6 @@ export default createEslintRule< }, }, ], - defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/consistent-test-it.ts b/src/rules/consistent-test-it.ts index 25fb77fc..33aec114 100644 --- a/src/rules/consistent-test-it.ts +++ b/src/rules/consistent-test-it.ts @@ -78,7 +78,6 @@ export default createEslintRule< additionalProperties: false, }, ], - defaultOptions: [], }, defaultOptions: [{}], create(context, options) { diff --git a/src/rules/consistent-vitest-vi.ts b/src/rules/consistent-vitest-vi.ts index 1e54da04..4cec1903 100644 --- a/src/rules/consistent-vitest-vi.ts +++ b/src/rules/consistent-vitest-vi.ts @@ -35,7 +35,6 @@ export default createEslintRule<[Partial<{ fn: UtilName }>], MESSAGE_ID>({ additionalProperties: false, }, ], - defaultOptions: [], }, defaultOptions: [{ fn: UtilName.vi }], create(context, options) { diff --git a/src/rules/expect-expect.ts b/src/rules/expect-expect.ts index 771d2cf0..467b13bc 100644 --- a/src/rules/expect-expect.ts +++ b/src/rules/expect-expect.ts @@ -39,7 +39,12 @@ export default createEslintRule({ additionalProperties: false, }, ], - defaultOptions: [], + defaultOptions: [ + { + assertFunctionNames: ['expect', 'assert'], + additionalTestBlockFunctions: [], + }, + ], messages: { noAssertions: 'Test has no assertions', }, diff --git a/src/rules/max-expects.ts b/src/rules/max-expects.ts index 7ea1d6bb..61f7f6ce 100644 --- a/src/rules/max-expects.ts +++ b/src/rules/max-expects.ts @@ -37,7 +37,6 @@ export default createEslintRule({ additionalProperties: false, }, ], - defaultOptions: [], }, defaultOptions: [{ max: 5 }], create(context, [{ max }]) { diff --git a/src/rules/max-nested-describe.ts b/src/rules/max-nested-describe.ts index 051566ab..4cbe10bd 100644 --- a/src/rules/max-nested-describe.ts +++ b/src/rules/max-nested-describe.ts @@ -29,7 +29,6 @@ export default createEslintRule({ additionalProperties: false, }, ], - defaultOptions: [], messages: { maxNestedDescribe: 'Nested describe block should be less than set max value', diff --git a/src/rules/no-conditional-expect.ts b/src/rules/no-conditional-expect.ts index 640c3f2a..8a2c9386 100644 --- a/src/rules/no-conditional-expect.ts +++ b/src/rules/no-conditional-expect.ts @@ -46,7 +46,6 @@ export default createEslintRule({ }, }, ], - defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/no-focused-tests.ts b/src/rules/no-focused-tests.ts index 95db2e10..a1c5d1d1 100644 --- a/src/rules/no-focused-tests.ts +++ b/src/rules/no-focused-tests.ts @@ -40,7 +40,6 @@ export default createEslintRule({ additionalProperties: false, }, ], - defaultOptions: [], messages: { noFocusedTests: 'Focused tests are not allowed', }, diff --git a/src/rules/no-hooks.ts b/src/rules/no-hooks.ts index 878368f5..dd4d78c3 100644 --- a/src/rules/no-hooks.ts +++ b/src/rules/no-hooks.ts @@ -41,7 +41,6 @@ export default createEslintRule< additionalProperties: false, }, ], - defaultOptions: [], messages: { unexpectedHook: "Unexpected '{{ hookName }}' hook", }, diff --git a/src/rules/no-large-snapshots.ts b/src/rules/no-large-snapshots.ts index 11269ae1..ba1a1762 100644 --- a/src/rules/no-large-snapshots.ts +++ b/src/rules/no-large-snapshots.ts @@ -98,7 +98,6 @@ export default createEslintRule<[RuleOptions], MESSAGE_IDS>({ additionalProperties: false, }, ], - defaultOptions: [], }, defaultOptions: [{}], create(context, [options]) { diff --git a/src/rules/no-restricted-vi-methods.ts b/src/rules/no-restricted-vi-methods.ts index eefa7fe3..7024009c 100644 --- a/src/rules/no-restricted-vi-methods.ts +++ b/src/rules/no-restricted-vi-methods.ts @@ -19,7 +19,6 @@ export default createEslintRule({ additionalProperties: { type: ['string', 'null'] }, }, ], - defaultOptions: [], messages: { restrictedViMethod: 'Use of `{{ restriction }}` is disallowed', restrictedViMethodWithMessage: '{{ message }}', diff --git a/src/rules/prefer-import-in-mock.ts b/src/rules/prefer-import-in-mock.ts index e7666820..5fb0f7b2 100644 --- a/src/rules/prefer-import-in-mock.ts +++ b/src/rules/prefer-import-in-mock.ts @@ -34,7 +34,6 @@ export default createEslintRule({ additionalProperties: false, }, ], - defaultOptions: [], }, defaultOptions: [{ fixable: true }], create(context, options) { diff --git a/src/rules/prefer-lowercase-title.ts b/src/rules/prefer-lowercase-title.ts index e411400a..1f2c5a79 100644 --- a/src/rules/prefer-lowercase-title.ts +++ b/src/rules/prefer-lowercase-title.ts @@ -104,7 +104,6 @@ export default createEslintRule< additionalProperties: false, }, ], - defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/require-hook.ts b/src/rules/require-hook.ts index 7ebd9a3f..c942a1ec 100644 --- a/src/rules/require-hook.ts +++ b/src/rules/require-hook.ts @@ -78,7 +78,6 @@ export default createEslintRule({ additionalProperties: false, }, ], - defaultOptions: [], }, defaultOptions: [ { diff --git a/src/rules/require-top-level-describe.ts b/src/rules/require-top-level-describe.ts index 7cbec9a3..7a254a6a 100644 --- a/src/rules/require-top-level-describe.ts +++ b/src/rules/require-top-level-describe.ts @@ -37,7 +37,6 @@ export default createEslintRule({ additionalProperties: false, }, ], - defaultOptions: [], }, defaultOptions: [{ maxNumberOfTopLevelDescribes: Infinity }], create(context, options) { diff --git a/src/rules/valid-expect.ts b/src/rules/valid-expect.ts index 9f07c9ef..420baab4 100644 --- a/src/rules/valid-expect.ts +++ b/src/rules/valid-expect.ts @@ -172,7 +172,6 @@ export default createEslintRule< additionalProperties: false, }, ], - defaultOptions: [], }, defaultOptions: [ { From 13dc7bdd866da6ec33e2529edc1de91f26067838 Mon Sep 17 00:00:00 2001 From: Verite Mugabo Date: Wed, 7 Jan 2026 10:31:47 +0200 Subject: [PATCH 5/5] update docs --- docs/rules/consistent-each-for.md | 4 +++- 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/hoisted-apis-on-top.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/no-unneeded-async-expect-function.md | 4 +++- docs/rules/padding-around-after-all-blocks.md | 4 +++- docs/rules/padding-around-after-each-blocks.md | 4 +++- docs/rules/padding-around-all.md | 4 +++- docs/rules/padding-around-before-all-blocks.md | 4 +++- docs/rules/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-exactly-once-with.md | 4 +++- docs/rules/prefer-called-once.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-expect-type-of.md | 4 +++- docs/rules/prefer-hooks-in-order.md | 4 +++- docs/rules/prefer-hooks-on-top.md | 4 +++- docs/rules/prefer-import-in-mock.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-mock-return-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-been-called-times.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-awaited-expect-poll.md | 4 +++- docs/rules/require-hook.md | 4 +++- .../require-local-test-context-for-concurrent-snapshots.md | 4 +++- docs/rules/require-mock-type-parameters.md | 4 +++- docs/rules/require-test-timeout.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 +++- docs/rules/warn-todo.md | 4 +++- 81 files changed, 243 insertions(+), 81 deletions(-) diff --git a/docs/rules/consistent-each-for.md b/docs/rules/consistent-each-for.md index 89fb5193..6e62ea85 100644 --- a/docs/rules/consistent-each-for.md +++ b/docs/rules/consistent-each-for.md @@ -1,4 +1,6 @@ -# Enforce using `.each` or `.for` consistently (`vitest/consistent-each-for`) +# vitest/consistent-each-for + +📝 Enforce using `.each` or `.for` consistently. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/consistent-test-filename.md b/docs/rules/consistent-test-filename.md index fecdec64..ff55eb4d 100644 --- a/docs/rules/consistent-test-filename.md +++ b/docs/rules/consistent-test-filename.md @@ -1,4 +1,6 @@ -# Require test file pattern (`vitest/consistent-test-filename`) +# vitest/consistent-test-filename + +📝 Require test file pattern. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index 28131be7..f64db3b8 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`) +# vitest/consistent-test-it + +📝 Enforce using test or it but not both. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/consistent-vitest-vi.md b/docs/rules/consistent-vitest-vi.md index ad741803..ad856b41 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`) +# vitest/consistent-vitest-vi + +📝 Enforce using vitest or vi but not both. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index da8593e7..feb9588b 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`) +# vitest/expect-expect + +📝 Enforce having expectation in test body. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/hoisted-apis-on-top.md b/docs/rules/hoisted-apis-on-top.md index 918164bc..4e8773ff 100644 --- a/docs/rules/hoisted-apis-on-top.md +++ b/docs/rules/hoisted-apis-on-top.md @@ -1,4 +1,6 @@ -# Enforce hoisted APIs to be on top of the file (`vitest/hoisted-apis-on-top`) +# vitest/hoisted-apis-on-top + +📝 Enforce hoisted APIs to be on top of the file. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/max-expects.md b/docs/rules/max-expects.md index 8c4f97e0..04a0f4b1 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`) +# vitest/max-expects + +📝 Enforce a maximum number of expect per test. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/max-nested-describe.md b/docs/rules/max-nested-describe.md index 48be6ff4..eed25868 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`) +# vitest/max-nested-describe + +📝 Require describe block to be less than set max value or default value. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index d4ca5a39..788e38f4 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`) +# vitest/no-alias-methods + +📝 Disallow alias methods. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-commented-out-tests.md b/docs/rules/no-commented-out-tests.md index 225f8a86..31591aa3 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`) +# vitest/no-commented-out-tests + +📝 Disallow commented out tests. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-conditional-expect.md b/docs/rules/no-conditional-expect.md index 1a268f46..c0ed4812 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`) +# vitest/no-conditional-expect + +📝 Disallow conditional expects. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-conditional-in-test.md b/docs/rules/no-conditional-in-test.md index 033398dd..42a5d1d6 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`) +# vitest/no-conditional-in-test + +📝 Disallow conditional tests. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-conditional-tests.md b/docs/rules/no-conditional-tests.md index a6ad8e05..8ab51b63 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`) +# vitest/no-conditional-tests + +📝 Disallow conditional tests. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-disabled-tests.md b/docs/rules/no-disabled-tests.md index eff61236..744f8945 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`) +# vitest/no-disabled-tests + +📝 Disallow disabled tests. ⚠️ This rule _warns_ in the following configs: 🌐 `all`, ✅ `recommended`. diff --git a/docs/rules/no-done-callback.md b/docs/rules/no-done-callback.md index 8e99f7ed..0810a922 100644 --- a/docs/rules/no-done-callback.md +++ b/docs/rules/no-done-callback.md @@ -1,4 +1,6 @@ -# Disallow using a callback in asynchronous tests and hooks (`vitest/no-done-callback`) +# vitest/no-done-callback + +📝 Disallow using a callback in asynchronous tests and hooks. ❌ This rule is deprecated. diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index ef758673..effc1c3f 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`) +# vitest/no-duplicate-hooks + +📝 Disallow duplicate hooks and teardown hooks. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index 8a2e6010..b47301e8 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`) +# vitest/no-focused-tests + +📝 Disallow focused tests. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index 274422cf..bb305116 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`) +# vitest/no-hooks + +📝 Disallow setup and teardown hooks. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index a0ede1b3..457bfc0d 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`) +# vitest/no-identical-title + +📝 Disallow identical titles. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-import-node-test.md b/docs/rules/no-import-node-test.md index de690ec0..9e637578 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`) +# vitest/no-import-node-test + +📝 Disallow importing `node:test`. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-importing-vitest-globals.md b/docs/rules/no-importing-vitest-globals.md index 2ba2b943..0fc1f0e1 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`) +# vitest/no-importing-vitest-globals + +📝 Disallow importing Vitest globals. 🚫 This rule is _disabled_ in the 🌐 `all` config. diff --git a/docs/rules/no-interpolation-in-snapshots.md b/docs/rules/no-interpolation-in-snapshots.md index b532c8ed..1ca4750c 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`) +# vitest/no-interpolation-in-snapshots + +📝 Disallow string interpolation in snapshots. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index 6f06b238..cfa9ca79 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`) +# vitest/no-large-snapshots + +📝 Disallow large snapshots. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-mocks-import.md b/docs/rules/no-mocks-import.md index 528644eb..5fc58669 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`) +# vitest/no-mocks-import + +📝 Disallow importing from **mocks** directory. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-restricted-matchers.md b/docs/rules/no-restricted-matchers.md index 67edb0ac..fc222d80 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`) +# vitest/no-restricted-matchers + +📝 Disallow the use of certain matchers. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-restricted-vi-methods.md b/docs/rules/no-restricted-vi-methods.md index af1a7da7..5091cd1f 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`) +# vitest/no-restricted-vi-methods + +📝 Disallow specific `vi.` methods. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-standalone-expect.md b/docs/rules/no-standalone-expect.md index 30f58651..60caa8c5 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`) +# vitest/no-standalone-expect + +📝 Disallow using `expect` outside of `it` or `test` blocks. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index 02f99948..64002af3 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`) +# vitest/no-test-prefixes + +📝 Disallow using the `f` and `x` prefixes in favour of `.only` and `.skip`. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-test-return-statement.md b/docs/rules/no-test-return-statement.md index db137ab8..6cc023ee 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`) +# vitest/no-test-return-statement + +📝 Disallow return statements in tests. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/no-unneeded-async-expect-function.md b/docs/rules/no-unneeded-async-expect-function.md index c3cabacf..1376c4e1 100644 --- a/docs/rules/no-unneeded-async-expect-function.md +++ b/docs/rules/no-unneeded-async-expect-function.md @@ -1,4 +1,6 @@ -# Disallow unnecessary async function wrapper for expected promises (`vitest/no-unneeded-async-expect-function`) +# vitest/no-unneeded-async-expect-function + +📝 Disallow unnecessary async function wrapper for expected promises. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-after-all-blocks.md b/docs/rules/padding-around-after-all-blocks.md index 1e681c07..cf518dc1 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`) +# vitest/padding-around-after-all-blocks + +📝 Enforce padding around `afterAll` blocks. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-after-each-blocks.md b/docs/rules/padding-around-after-each-blocks.md index a41bec9d..453645dd 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`) +# vitest/padding-around-after-each-blocks + +📝 Enforce padding around `afterEach` blocks. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-all.md b/docs/rules/padding-around-all.md index b44c129f..48479a84 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`) +# vitest/padding-around-all + +📝 Enforce padding around vitest functions. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-before-all-blocks.md b/docs/rules/padding-around-before-all-blocks.md index a4fd1d10..143f06e9 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`) +# vitest/padding-around-before-all-blocks + +📝 Enforce padding around `beforeAll` blocks. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-before-each-blocks.md b/docs/rules/padding-around-before-each-blocks.md index 43137841..ee601222 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`) +# vitest/padding-around-before-each-blocks + +📝 Enforce padding around `beforeEach` blocks. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-describe-blocks.md b/docs/rules/padding-around-describe-blocks.md index b354cab9..9b2dc46c 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`) +# vitest/padding-around-describe-blocks + +📝 Enforce padding around `describe` blocks. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-expect-groups.md b/docs/rules/padding-around-expect-groups.md index a5ea8a14..30d3b0b9 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`) +# vitest/padding-around-expect-groups + +📝 Enforce padding around `expect` groups. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/padding-around-test-blocks.md b/docs/rules/padding-around-test-blocks.md index cb317f2a..f9ea33d5 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`) +# vitest/padding-around-test-blocks + +📝 Enforce padding around `test` blocks. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-called-exactly-once-with.md b/docs/rules/prefer-called-exactly-once-with.md index b12718f3..5f209fd0 100644 --- a/docs/rules/prefer-called-exactly-once-with.md +++ b/docs/rules/prefer-called-exactly-once-with.md @@ -1,4 +1,6 @@ -# Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith` (`vitest/prefer-called-exactly-once-with`) +# vitest/prefer-called-exactly-once-with + +📝 Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith`. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-called-once.md b/docs/rules/prefer-called-once.md index ff28e860..46238c18 100644 --- a/docs/rules/prefer-called-once.md +++ b/docs/rules/prefer-called-once.md @@ -1,4 +1,6 @@ -# Enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()` (`vitest/prefer-called-once`) +# vitest/prefer-called-once + +📝 Enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()`. 🚫 This rule is _disabled_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-called-times.md b/docs/rules/prefer-called-times.md index 05dfb6b2..20e8a354 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`) +# vitest/prefer-called-times + +📝 Enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)`. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-called-with.md b/docs/rules/prefer-called-with.md index cc26bf5c..53c01dbc 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`) +# vitest/prefer-called-with + +📝 Enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-comparison-matcher.md b/docs/rules/prefer-comparison-matcher.md index 775a169d..9b276ae4 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`) +# vitest/prefer-comparison-matcher + +📝 Enforce using the built-in comparison matchers. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-describe-function-title.md b/docs/rules/prefer-describe-function-title.md index f7f747c3..4cad016c 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`) +# vitest/prefer-describe-function-title + +📝 Enforce using a function as a describe title over an equivalent string. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-each.md b/docs/rules/prefer-each.md index f11acf58..a2207233 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`) +# vitest/prefer-each + +📝 Enforce using `each` rather than manual loops. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-equality-matcher.md b/docs/rules/prefer-equality-matcher.md index af69ffc5..48e523d6 100644 --- a/docs/rules/prefer-equality-matcher.md +++ b/docs/rules/prefer-equality-matcher.md @@ -1,4 +1,6 @@ -# Enforce using the built-in equality matchers (`vitest/prefer-equality-matcher`) +# vitest/prefer-equality-matcher + +📝 Enforce using the built-in equality matchers. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index 01a19f98..0cf09c7a 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`) +# vitest/prefer-expect-assertions + +📝 Enforce using expect assertions instead of callbacks. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-expect-resolves.md b/docs/rules/prefer-expect-resolves.md index d52feae7..a4d0a7b0 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`) +# vitest/prefer-expect-resolves + +📝 Enforce using `expect().resolves` over `expect(await ...)` syntax. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-expect-type-of.md b/docs/rules/prefer-expect-type-of.md index 802a5be8..a77ee5cf 100644 --- a/docs/rules/prefer-expect-type-of.md +++ b/docs/rules/prefer-expect-type-of.md @@ -1,4 +1,6 @@ -# Enforce using `expectTypeOf` instead of `expect(typeof ...)` (`vitest/prefer-expect-type-of`) +# vitest/prefer-expect-type-of + +📝 Enforce using `expectTypeOf` instead of `expect(typeof ...)`. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-hooks-in-order.md b/docs/rules/prefer-hooks-in-order.md index 8945d3c0..e5f9b77d 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`) +# vitest/prefer-hooks-in-order + +📝 Enforce having hooks in consistent order. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index 12db126c..67bf3576 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`) +# vitest/prefer-hooks-on-top + +📝 Enforce having hooks before any test cases. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-import-in-mock.md b/docs/rules/prefer-import-in-mock.md index ee19816a..917cc9bc 100644 --- a/docs/rules/prefer-import-in-mock.md +++ b/docs/rules/prefer-import-in-mock.md @@ -1,4 +1,6 @@ -# Prefer dynamic import in mock (`vitest/prefer-import-in-mock`) +# vitest/prefer-import-in-mock + +📝 Prefer dynamic import in mock. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-importing-vitest-globals.md b/docs/rules/prefer-importing-vitest-globals.md index db859b08..d114a7bc 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`) +# vitest/prefer-importing-vitest-globals + +📝 Enforce importing Vitest globals. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-lowercase-title.md b/docs/rules/prefer-lowercase-title.md index 61671cf8..b865cae0 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`) +# vitest/prefer-lowercase-title + +📝 Enforce lowercase titles. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-mock-promise-shorthand.md b/docs/rules/prefer-mock-promise-shorthand.md index eb7f00a7..a3fc9671 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`) +# vitest/prefer-mock-promise-shorthand + +📝 Enforce mock resolved/rejected shorthands for promises. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-mock-return-shorthand.md b/docs/rules/prefer-mock-return-shorthand.md index 02c0529d..78db8721 100644 --- a/docs/rules/prefer-mock-return-shorthand.md +++ b/docs/rules/prefer-mock-return-shorthand.md @@ -1,4 +1,6 @@ -# Prefer mock return shorthands (`vitest/prefer-mock-return-shorthand`) +# vitest/prefer-mock-return-shorthand + +📝 Prefer mock return shorthands. 🔧 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 a09db10d..fec6b718 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`) +# vitest/prefer-snapshot-hint + +📝 Enforce including a hint with external snapshots. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index 2e044966..3d0fe65a 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`) +# vitest/prefer-spy-on + +📝 Enforce using `vi.spyOn`. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-strict-boolean-matchers.md b/docs/rules/prefer-strict-boolean-matchers.md index 0ed77fc0..ca63cc2b 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`) +# vitest/prefer-strict-boolean-matchers + +📝 Enforce using `toBe(true)` and `toBe(false)` over matchers that coerce types to boolean. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index f5ad6ccb..f0a67960 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`) +# vitest/prefer-strict-equal + +📝 Enforce strict equal over equal. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-be-falsy.md b/docs/rules/prefer-to-be-falsy.md index dfcfde4a..5d8beb25 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`) +# vitest/prefer-to-be-falsy + +📝 Enforce using toBeFalsy(). 🚫 This rule is _disabled_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-be-object.md b/docs/rules/prefer-to-be-object.md index 349d4d86..16028a4a 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`) +# vitest/prefer-to-be-object + +📝 Enforce using toBeObject(). ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-be-truthy.md b/docs/rules/prefer-to-be-truthy.md index 50b2ee0e..2ec07edb 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`) +# vitest/prefer-to-be-truthy + +📝 Enforce using `toBeTruthy`. 🚫 This rule is _disabled_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-be.md b/docs/rules/prefer-to-be.md index 380f4109..ad8a0ce1 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`) +# vitest/prefer-to-be + +📝 Enforce using toBe(). ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index c0f6bcdd..b177c42a 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`) +# vitest/prefer-to-contain + +📝 Enforce using toContain(). ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-have-been-called-times.md b/docs/rules/prefer-to-have-been-called-times.md index ee8e73fb..bfa77edc 100644 --- a/docs/rules/prefer-to-have-been-called-times.md +++ b/docs/rules/prefer-to-have-been-called-times.md @@ -1,4 +1,6 @@ -# Suggest using `toHaveBeenCalledTimes()` (`vitest/prefer-to-have-been-called-times`) +# vitest/prefer-to-have-been-called-times + +📝 Suggest using `toHaveBeenCalledTimes()`. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index 29d2d498..d11c4a86 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`) +# vitest/prefer-to-have-length + +📝 Enforce using toHaveLength(). ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index bced1184..6cd34652 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -1,4 +1,6 @@ -# Enforce using `test.todo` (`vitest/prefer-todo`) +# vitest/prefer-todo + +📝 Enforce using `test.todo`. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/prefer-vi-mocked.md b/docs/rules/prefer-vi-mocked.md index 07f97452..817581cf 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`) +# vitest/prefer-vi-mocked + +📝 Require `vi.mocked()` over `fn as Mock`. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/require-awaited-expect-poll.md b/docs/rules/require-awaited-expect-poll.md index 59582a31..27585055 100644 --- a/docs/rules/require-awaited-expect-poll.md +++ b/docs/rules/require-awaited-expect-poll.md @@ -1,4 +1,6 @@ -# Ensure that every `expect.poll` call is awaited (`vitest/require-awaited-expect-poll`) +# vitest/require-awaited-expect-poll + +📝 Ensure that every `expect.poll` call is awaited. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/require-hook.md b/docs/rules/require-hook.md index f410f6d4..81b8ab8e 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`) +# vitest/require-hook + +📝 Require setup and teardown to be within a hook. ⚠️ This rule _warns_ in the 🌐 `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 38443e64..7310b795 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`) +# vitest/require-local-test-context-for-concurrent-snapshots + +📝 Require local Test Context for concurrent snapshot tests. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/require-mock-type-parameters.md b/docs/rules/require-mock-type-parameters.md index 2ead38c4..36644673 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`) +# vitest/require-mock-type-parameters + +📝 Enforce using type parameters with vitest mock functions. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/require-test-timeout.md b/docs/rules/require-test-timeout.md index 5441876f..f6614829 100644 --- a/docs/rules/require-test-timeout.md +++ b/docs/rules/require-test-timeout.md @@ -1,4 +1,6 @@ -# Require tests to declare a timeout (`vitest/require-test-timeout`) +# vitest/require-test-timeout + +📝 Require tests to declare a timeout. 🚫 This rule is _disabled_ in the 🌐 `all` config. diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index 34c6326a..88a44316 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`) +# vitest/require-to-throw-message + +📝 Require toThrow() to be called with an error message. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index 2fd78a05..5df7ddcd 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`) +# vitest/require-top-level-describe + +📝 Enforce that all tests are in a top-level describe. ⚠️ This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/valid-describe-callback.md b/docs/rules/valid-describe-callback.md index 513310ee..60eca0f3 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`) +# vitest/valid-describe-callback + +📝 Enforce valid describe callback. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index a9d9dcb0..1753fa66 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`) +# vitest/valid-expect-in-promise + +📝 Require promises that have expectations in their chain to be valid. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index 7656ae86..acac1a64 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -1,4 +1,6 @@ -# Enforce valid `expect()` usage (`vitest/valid-expect`) +# vitest/valid-expect + +📝 Enforce valid `expect()` usage. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index baa48b4b..6254693c 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -1,4 +1,6 @@ -# Enforce valid titles (`vitest/valid-title`) +# vitest/valid-title + +📝 Enforce valid titles. 💼⚠️ This rule is enabled in the ✅ `recommended` config. This rule _warns_ in the 🌐 `all` config. diff --git a/docs/rules/warn-todo.md b/docs/rules/warn-todo.md index f0dc1c7c..23f84dcb 100644 --- a/docs/rules/warn-todo.md +++ b/docs/rules/warn-todo.md @@ -1,4 +1,6 @@ -# Disallow `.todo` usage (`vitest/warn-todo`) +# vitest/warn-todo + +📝 Disallow `.todo` usage.