no-empty-vitest-coverage-include
July 3, 2026 · View on GitHub
Disallow empty test.coverage.include arrays in Vitest config.
Rule catalog ID: R014
Targeted pattern scope
vitest.config.*vitest.workspace.*vite.config.*when Vitest coverage options are usedtest.coverage.include
What this rule reports
This rule reports test.coverage.include: [].
Why this rule exists
An empty coverage include list usually means intended targeting is effectively disabled. Catching this helps keep coverage settings intentional and useful.
❌ Incorrect
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
coverage: {
include: [],
},
},
});
✅ Correct
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
coverage: {
include: ["src/**/*.ts"],
},
},
});
Behavior and migration notes
- this rule checks static empty arrays only
- it does not validate include glob quality
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 coverage include patterns are generated dynamically and empty committed arrays are intentional placeholders.