ESLint with React gives `no-unused-vars` errors

前端 未结 6 756
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 05:00

I\'ve setup eslint & eslint-plugin-react.

When I run ESLint, the linter returns no-unused-vars errors for each React comp

6条回答
  •  盖世英雄少女心
    2020-11-28 05:39

    Since I found this while googling, you should know that this simple rule is enough to prevent this message:

    react/jsx-uses-react
    

    The react/recommended set of rules adds many other rules you may not want.

提交回复
热议问题