no-pass-with-no-tests
Disallow test.passWithNoTests: true in Vitest configuration.
Rule catalog ID: R022
Targeted pattern scopeβ
vitest.config.*vitest.workspace.*vite.config.*when a Vitesttestblock is used- root and inline project
test.passWithNoTests
What this rule reportsβ
This rule reports explicit test.passWithNoTests: true assignments.
Why this rule existsβ
passWithNoTests can be useful for one-off local workflows, but committing it to shared config can mask accidental test-discovery regressions.
When files are moved, globs change, or projects are misconfigured, CI can appear green while running zero tests.
This plugin focuses on safe Vite/Vitest configuration defaults, so preventing this failure-masking toggle in committed config is a high-signal check.
β Incorrectβ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
passWithNoTests: true,
},
});
β Correctβ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
passWithNoTests: false,
},
});
Behavior and migration notesβ
- this rule only reports explicit
trueassignments - it does not require setting
passWithNoTestswhen omitted - if you need local-only behavior, prefer CLI flags or local config overrides instead of committing this toggle
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 team intentionally accepts βgreen with no discovered testsβ as a committed behavior.