no-vitest-timeout-triplet-mismatch
Disallow inconsistent Vitest timeout triplet ordering.
Rule catalog ID: R069
Targeted pattern scopeโ
test.testTimeouttest.hookTimeouttest.teardownTimeout
What this rule reportsโ
This rule reports when all three timeout values are static numbers and teardownTimeout is lower than hookTimeout.
Why this rule existsโ
If teardown has less time than hooks, shutdown and cleanup can fail under load and produce misleading flakes.
โ Incorrectโ
export default {
test: {
testTimeout: 20_000,
hookTimeout: 10_000,
teardownTimeout: 5_000,
},
};
โ Correctโ
export default {
test: {
testTimeout: 20_000,
hookTimeout: 10_000,
teardownTimeout: 10_000,
},
};
Behavior and migration notesโ
- Only checks static numeric literals.
- Only reports when all three timeout keys are present.
ESLint flat config exampleโ
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.vitest];
When not to use itโ
Disable if your workflow intentionally sets teardown lower than hook timeout.