Some recommended conventions to enforce in react projects.
This borrows heavily from the work of the original ESLint Complexity rule, as well as the component detection routines in eslint-plugin-react. This synthesizes their work.
Big thanks to them!
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-react-conventions
:
$ npm install eslint-plugin-react-conventions --save-dev
Add react-conventions
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"react-conventions"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"react-conventions/rule-name": 2
}
}
- Fill in provided rules here