vitest/no-mocks-import
@vitest/eslint-plugin
No autofixRecommended
eslint.config.js
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/no-mocks-import": "error",
},
},
];import { foo } from '__mocks__/foo'import { foo } from 'foo'Examples from the ESLint documentation.
vitest/no-mocks-import
@vitest/eslint-plugin
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/no-mocks-import": "error",
},
},
];vitest/no-mocks-import
vitest plugin · style
{
"plugins": [
"vitest"
],
"rules": {
"vitest/no-mocks-import": "error"
}
}Biome does not have this rule.
Disallow string interpolation in snapshots
Disallow unnecessary async function wrapper for expected promises
Prefer toHaveBeenCalledExactlyOnceWith over toHaveBeenCalledOnce and toHaveBeenCalledWith