This plugin prevents to name React component props with the same name as shadow functions or variables
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-prop-has-no-shadow-declaration
:
$ npm install eslint-plugin-prop-has-no-shadow-declaration --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-prop-has-no-shadow-declaration
globally.
Add prop-has-no-shadow-declaration
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"prop-has-no-shadow-declaration"
]
}
Then add the following to your rules section.
{
"rules": {
"prop-has-no-shadow-declaration/rule": 1
}
}
- Fill in provided rules here