react/jsx-no-undef
eslint-plugin-react
No autofixRecommended
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-no-undef": "error",
},
},
];<Hello name="John" />;// will ignore Text in the global scope and warn
var Hello = React.createClass({
render: function() {
return <Text>Hello</Text>;
}
});
module.exports = Hello;var Hello = require('./Hello');
<Hello name="John" />;Examples from the ESLint documentation.
react/jsx-no-undef
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-no-undef": "error",
},
},
];react/jsx-no-undef
react plugin · correctness
{
"plugins": [
"react"
],
"rules": {
"react/jsx-no-undef": "error"
}
}Biome does not have this rule.
Enforce ES5 or ES6 class for returning value in render function
Disallow variables used in JSX to be incorrectly marked as unused
Disallow direct mutation of this.state