Sometimes, we want to fix ESLint with React giving no-unused-vars
errors.
In this article, we’ll look at how to fix ESLint with React giving no-unused-vars
errors.
How to fix ESLint with React giving no-unused-vars errors?
To fix ESLint with React giving no-unused-vars
errors, we can use the eslint-plugin-react
plugin.
To install it, we run
npm install --save-dev eslint-plugin-react
Then we add it to .eslintrc.json by writing
{
//...
"extends": ["plugin:react/recommended"]
//...
}
to add the "plugin:react/recommended"
rules from the eslint-plugin-react
plugin to our project.
Conclusion
To fix ESLint with React giving no-unused-vars
errors, we can use the eslint-plugin-react
plugin.