Skip to main content

no-vitest-coverage-all-false

Disallow test.coverage.all: false in shared Vitest config.

Rule catalog ID: R047

Targeted pattern scopeโ€‹

  • vitest.config.*
  • vitest.workspace.*
  • vite.config.* when Vitest coverage options are configured
  • test.coverage.all

What this rule reportsโ€‹

This rule reports explicit test.coverage.all: false assignments in supported config files.

Why this rule existsโ€‹

Setting coverage.all to false can hide untested files from aggregate coverage expectations. For shared CI-facing config, this often weakens coverage signal unintentionally.

โŒ Incorrectโ€‹

import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
coverage: {
all: false,
},
},
});

โœ… Correctโ€‹

import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
coverage: {
all: true,
},
},
});

Behavior and migration notesโ€‹

  • this rule checks static boolean assignments only
  • it targets committed config files, not arbitrary source modules

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 intentionally excludes non-imported files from coverage policy by design.

Package documentationโ€‹

Further readingโ€‹