react/jsx-uses-vars
eslint-plugin-react
No autofixRecommended
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-uses-vars": "error",
},
},
];var Hello = require('./Hello');var Hello = require('./Hello');
<Hello name="John" />;Examples from the ESLint documentation.
react/jsx-uses-vars
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-uses-vars": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow direct mutation of this.state
Enforce ES5 or ES6 class for returning value in render function