no-empty-vitest-exclude
Disallow empty root-level test.exclude arrays in Vitest config.
Rule catalog ID: R027
Targeted pattern scopeβ
vitest.config.*vite.config.*when a root Vitesttestblock is used- root-level
test.excludeonly
What this rule reportsβ
This rule reports explicit root-level test.exclude: [] assignments.
Why this rule existsβ
An empty root exclude list is usually a no-op artifact left from config refactors. Flagging it keeps shared config intentional and avoids misleading βconfigured but ineffectiveβ filtering.
β Incorrectβ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
exclude: [],
},
});
β Correctβ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
exclude: ["dist/**"],
},
});
Behavior and migration notesβ
- this rule checks only static empty arrays
- it intentionally targets root
test.exclude; useno-empty-vitest-project-excludefor project-level entries
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 you intentionally keep a root empty exclude array in committed config as a style placeholder.