vitest/prefer-vi-mocked
@vitest/eslint-plugin
Safe autofix
eslint.config.js
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/prefer-vi-mocked": "error",
},
},
];No code example for this rule
The linters' documentation does not include one we could extract.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
vitest/prefer-vi-mocked
@vitest/eslint-plugin
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/prefer-vi-mocked": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce unbound methods are called with their expected scope
Require toThrow() to be called with an error message
Enforce using type parameters with vitest mock functions