no-zero-vitest-slow-test-threshold
Disallow test.slowTestThreshold: 0 in Vitest configuration.
Rule catalog ID: R021
Targeted pattern scopeโ
vitest.config.*vitest.workspace.*vite.config.*when a Vitesttestblock is used- root and inline project
test.slowTestThreshold
What this rule reportsโ
This rule reports explicit test.slowTestThreshold: 0 assignments.
Why this rule existsโ
slowTestThreshold controls when Vitest reports slow tests.
Setting it to 0 disables practical slow-test signal and makes it harder to detect performance regressions in the suite.
This repository focuses on configuration quality, so preventing disabled slow-test reporting is a useful Vitest-specific guardrail.
โ Incorrectโ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
slowTestThreshold: 0,
},
});
โ Correctโ
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
slowTestThreshold: 300,
},
});
Behavior and migration notesโ
- this rule only reports explicit zero-valued thresholds
- it does not require setting
slowTestThresholdwhen omitted - tune the threshold to fit your environment (e.g. 300โ1000 ms) rather than disabling the signal entirely
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 removes slow-test reporting from committed Vitest configuration.