docs/config/typecheck.md
Options for configuring typechecking test environment.
booleanfalse--typecheck, --typecheck.enabledEnable typechecking alongside your regular tests.
booleanfalse--typecheck.onlyRun only typecheck tests, when typechecking is enabled. When using CLI, this option will automatically enable typechecking.
'tsc' | 'vue-tsc' | stringtscWhat tools to use for type checking. Vitest will spawn a process with certain parameters for easier parsing, depending on the type. Checker should implement the same output format as tsc.
You need to have a package installed to use typechecker:
tsc requires typescript packagevue-tsc requires vue-tsc packageYou can also pass down a path to custom binary or command name that produces the same output as tsc --noEmit --pretty false.
string[]['**/*.{test,spec}-d.?(c|m)[jt]s?(x)']Glob pattern for files that should be treated as test files.
string[]['**/node_modules/**', '**/dist/**', '**/cypress/**', '**/.{idea,git,cache,output,temp}/**']Glob pattern for files that should not be treated as test files.
booleanfalseCheck JS files that have @ts-check comment. If you have it enabled in tsconfig, this will not overwrite it.
booleanfalseDo not fail, if Vitest found errors outside the test files. This will not show you non-test errors at all.
By default, if Vitest finds source error, it will fail test suite.
stringPath to custom tsconfig, relative to the project root.
number10_000Minimum time in milliseconds it takes to spawn the typechecker.