Rules
jsx-uses-vars
Full Name in eslint-plugin-react-x
Full Name in @eslint-react/eslint-plugin
Presets
x
recommended
Description
Marks variables used in JSX elements as used.
Since 0.17.0 the eslint no-unused-vars
rule does not detect variables used in JSX (see details). This rule will find variables used in JSX and mark them as used.
This rule only has an effect when the no-unused-vars
rule is enabled.
Examples
Failing
Passing
Implementation
See Also
jsx-no-undef
Prevents using variables in JSX that are not defined in the scope.jsx-uses-react
Marks React variables as used when JSX is used.jsx-no-duplicated-props
Disallow duplicate props in JSX elements.