0.1.8 • Published 3 years ago
eslint-plugin-weavers-react v0.1.8
ESLint-Custom-Rules
The repository is a collection of custom eslint-rules used to maintain code-quality.
Install
From your terminal type
npm install --save-dev eslint-plugin-weavers-react
to install the plugin as a devDependency
Configure
On your eslintrc
file, esure that the options are set as shown below.
{
"plugins" : ["react","weavers-react"]
}
How to Use
The plugin features the following rules.
1. react_maxlines_per_function
The rule to limit the number of lines inside a function in react.
"weavers-react/react_maxlines_per_function" : [
"error",
{"maxLines": 80, "maxJSLines": 30, "maxJSXLines": 50}
]
maxLines : refer to the maximum allowed lines in a function.
maxJSXLines : refer to the maximum allowed lines in the functin that can have a JSX Element.
maxJSLines: refer to the maximum allowed lines without any JSXElements.
Dependencies
Package works best with: eslint : >=7.5.0 @babel/eslint-parser : **>=7.13.10"