vitest/no-alias-methods
@vitest/eslint-plugin
Safe autofix
eslint.config.js
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/no-alias-methods": "error",
},
},
];expect(a).toBeCalled()expect(a).toBeCalledTimes(1)expect(a).toHaveBeenCalled()expect(a).toHaveBeenCalledTimes(1)Examples from the ESLint documentation.
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/no-alias-methods
@vitest/eslint-plugin
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/no-alias-methods": "error",
},
},
];vitest/no-alias-methods
vitest plugin · style
{
"plugins": [
"vitest"
],
"rules": {
"vitest/no-alias-methods": "error"
}
}Biome does not have this rule.
Enforce hoisted APIs to be on top of the file