react/jsx-uses-react
eslint-plugin-react
No autofixRecommended
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-uses-react": "error",
},
},
];var React = require('react');
// nothing to do with React/** @jsx Foo */
var React = require('react');
var Hello = <div>Hello {this.props.name}</div>;var React = require('react');
var Hello = <div>Hello {this.props.name}</div>;/** @jsx Foo */
var Foo = require('foo');
var Hello = <div>Hello {this.props.name}</div>;Examples from the ESLint documentation.
react/jsx-uses-react
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-uses-react": "error",
},
},
];Oxlint does not have this rule.
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