A set of ESLint rules to make your code better.
A set of ESLint rules to make your code better.
strings and numbers are actually constant values, and are the only values that should be assigned to const when it's instantiated.Read Stop Writing Inhuman const.
complexity rule in ESLint includes rules that do not affect the number of linearly independent code paths. For example: default values for parameters. This rule only counts linearly independent code paths to increase complexity.npm install eslint-plugin-do-this
Add the plugin to your ESLint configuration:
``
import doThis from "eslint-plugin-do-this";
// ...
"plugins": [
"do-this": doThis
]
`
Then, enable the rules you want:
```
"rules": {
"do-this/no-inhuman-const": "error",
"do-this/no-multiple-exit": "error",
"do-this/uppercase-const": "error",
"do-this/cyclomatic-complexity": [
"error",
{
"maximum": 3
}
]
}