DocumentationRulesjsx-uses-vars

jsx-uses-vars

Rule category

Correctness.

What it does

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

const Hello = require('./Hello');

Passing

const Hello = require('./Hello');
 
<Hello name="John" />;