react/no-access-state-in-setstate
eslint-plugin-react
No autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-access-state-in-setstate": "error",
},
},
];The documentation shows no incorrect example for this rule.
setState({value: 1 + 1})
setState({value: 2 + 1})Examples from the ESLint documentation.
react/no-access-state-in-setstate
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-access-state-in-setstate": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow missing parentheses around multiline JSX
Lifecycle methods should be methods on the prototype, not class fields
Enforce whitespace in and around the JSX opening and closing brackets
Disallow multiple spaces between inline JSX props
Disallow declaring unused methods of component class