0.0.3 • Published 7 years ago
eslint-plugin-js-fp-linter v0.0.3
eslint-plugin-js-fp-linter
linting rules that promote functional programming practices
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-js-fp-linter:
$ npm install eslint-plugin-js-fp-linter --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-js-fp-linter globally.
Usage
Add js-fp-linter to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"js-fp-linter"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"js-fp-linter/rule-name": 2
}
}Supported Rules
Rules
- no-arguments - Forbid the use of
arguments. - no-delete - Forbid the use of
delete. - no-get-set - Forbid the use of getters and setters.
- no-loops - Forbid the use of loops.
- no-mutating-assign - Forbid the use of
Object.assign()with a variable as first argument. - no-mutating-methods - Forbid the use of mutating methods.
- no-mutation - Forbid the use of mutating operators.
- no-nil - Forbid the use of
nullandundefined. - no-proxy - Forbid the use of
Proxy. - no-rest-parameters - Forbid the use of rest parameters.
- no-variable-declarations - Forbids variable declarations, no
varorlet.
Recommended configuration
This plugin exports a recommended configuration that enforces good practices.
To enable this configuration, use the extends property in your package.json.
{
"name": "my-awesome-project",
"eslintConfig": {
"plugins": [
"js-fp-linter"
],
"extends": "plugin:js-fp-linter/recommended"
}
}