0.1.1 • Published 4 months ago
eslint-plugin-friendly-reduce v0.1.1
eslint-plugin-friendly-reduce
Ensure best practices when dealing with Array#reduce()
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-friendly-reduce
:
npm install eslint-plugin-friendly-reduce --save-dev
Usage
Add friendly-reduce
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"friendly-reduce"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"friendly-reduce/wrap-reduce": 2
}
}
Rules
Name | Description |
---|---|
no-useless-reduce | Disallow the usage of useless Array#reduce() |
wrap-reduce | Disallow Array#reduce() outside of a function explaining it |