Rules
jsx-uses-react
Full Name in eslint-plugin-react-x
Full Name in @eslint-react/eslint-plugin
Presets
x
recommended
Description
Marks React variables as used when JSX is used.
If you are using the @jsx
pragma this rule will mark the designated variable and not the React one.
This rule does nothing when using the New JSX Transform or if the no-unused-vars
rule is not enabled.
Examples
Failing
Passing
Implementation
See Also
jsx-no-undef
Prevents using variables in JSX that are not defined in the scope.jsx-uses-vars
Marks variables used in JSX elements as used.jsx-no-duplicated-props
Disallow duplicate props in JSX elements.