Skip to content

Files

Latest commit

 

History

History
27 lines (18 loc) · 684 Bytes

jsx-uses-vars.md

File metadata and controls

27 lines (18 loc) · 684 Bytes

Pattern: Used JSX variable

Issue: -

Description

This rule will find variables used in JSX and mark them as used. It has an effect when the no-unused-vars rule is enabled. Without this rule this code triggers warning:

import HelloWorld from './HelloWorld';

export default {
  render () {
    return (
      <HelloWorld msg="world"/>
    )
  },
};

After turning on, Hello is being marked as used and no-unused-vars rule doesn't report an issue.

If you are not using JSX or if you do not use the no-unused-vars rule then you can disable this rule.

Further Reading