vitest/prefer-each
@vitest/eslint-plugin
No autofix
eslint.config.js
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/prefer-each": "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-each
@vitest/eslint-plugin
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/prefer-each": "error",
},
},
];vitest/prefer-each
vitest plugin · style
{
"plugins": [
"vitest"
],
"rules": {
"vitest/prefer-each": "error"
}
}Biome does not have this rule.
Enforce using the built-in comparison matchers
Enforce using expect assertions instead of callbacks
Enforce using toBeCalledOnce() or toHaveBeenCalledOnce()
Enforce using expect().resolves over expect(await ...) syntax