no-disabled-vitest-typecheck
Disallow Vitest test.typecheck options that disable or hide static typecheck failures.
Rule catalog ID: R016
Targeted pattern scopeโ
vitest.config.*vitest.workspace.*vite.config.*when a Vitesttestblock is used- root
test.typecheckoptions - inline project
test.typecheckoptions insidedefineWorkspace([...]) - inline project
test.typecheckoptions insidetest.projects: [...]
What this rule reportsโ
This rule reports unsafe test.typecheck settings:
test.typecheck.enabled: falsetest.typecheck.ignoreSourceErrors: true
Why this rule existsโ
Vitest exposes typecheck as an optional test-time static safety pass.
Disabling it explicitly, or ignoring non-test source errors, can hide regressions that only appear in CI or production builds.
This plugin targets configuration correctness for Vite/Vitest projects, so enforcing safer typecheck defaults at config-authoring time fits its scope better than generic JavaScript style rules.
โ Incorrectโ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
typecheck: {
enabled: false,
ignoreSourceErrors: true,
},
},
});
โ Correctโ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
typecheck: {
enabled: true,
ignoreSourceErrors: false,
tsconfig: "./tsconfig.vitest-typecheck.json",
},
},
});
Behavior and migration notesโ
- this rule does not require enabling typecheck when
test.typecheckis absent - it only reports explicit unsafe toggles that disable or suppress errors
- if a repository must temporarily suppress source errors during migrations, scope-disable this rule with a comment and track removal explicitly
ESLint flat config exampleโ
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.strict, vite.configs.vitest];
When not to use itโ
Disable this rule only if your team intentionally relies on typecheck.enabled: false or typecheck.ignoreSourceErrors: true for temporary migration workflows and accepts the reduced static safety signal.