no-empty-vitest-project-exclude
Disallow empty project-level test.exclude arrays in workspace/project entries.
Rule catalog ID: R033
Targeted pattern scopeโ
vitest.workspace.*- inline project entries in
test.projects - nested project
test.excludevalues only
What this rule reportsโ
This rule reports empty project-level test.exclude: [] arrays.
Why this rule existsโ
Project-level empty excludes are often leftover placeholders that imply filtering but do nothing. Keeping these entries explicit and non-empty improves project topology clarity.
โ Incorrectโ
import { defineWorkspace } from "vitest/config";
export default defineWorkspace([
{
test: {
name: "unit",
exclude: [],
},
},
]);
โ Correctโ
import { defineWorkspace } from "vitest/config";
export default defineWorkspace([
{
test: {
name: "unit",
exclude: ["dist/**"],
},
},
]);
Behavior and migration notesโ
- this rule checks nested project excludes only
- use
no-empty-vitest-excludefor root-leveltest.exclude
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 project generator intentionally emits empty nested exclude arrays as templates.