jest/prefer-mock-return-shorthand
eslint-plugin-jest
Safe autofix
eslint.config.js
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/prefer-mock-return-shorthand": "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.
jest/prefer-mock-return-shorthand
eslint-plugin-jest
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/prefer-mock-return-shorthand": "error",
},
},
];jest/prefer-mock-return-shorthand
jest plugin · style
{
"plugins": [
"jest"
],
"rules": {
"jest/prefer-mock-return-shorthand": "error"
}
}Biome does not have this rule.
Prefer mock resolved/rejected shorthands for promises
Prefer including a hint with external snapshots
Prefer await expect(...).resolves over expect(await ...) syntax