no-disabled-vitest-isolation
Disallow test.isolate: false in Vitest configuration.
Rule catalog ID: R020
Targeted pattern scopeโ
vitest.config.*vitest.workspace.*vite.config.*when a Vitesttestblock is used- root and inline project
test.isolate
What this rule reportsโ
This rule reports explicit test.isolate: false assignments.
Why this rule existsโ
Vitest defaults isolate to true to keep test files separated.
Turning isolation off can leak runtime state between files and make failures order-dependent.
This plugin targets robust Vite/Vitest configuration guardrails, so flagging committed disabled-isolation config is a high-signal safety check.
โ Incorrectโ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
isolate: false,
},
});
โ Correctโ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
isolate: true,
},
});
Behavior and migration notesโ
- this rule only reports explicit
falseassignments - it does not require setting
isolatewhen omitted - if you intentionally disable isolation for a specific local workflow, prefer temporary CLI or local-only overrides instead of committing the setting globally
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 suite intentionally relies on shared global state between files and you accept increased flake risk.