2.2.0-a1 • Published 7 years ago
eslint-plugin-lodash-fp v2.2.0-a1
eslint-plugin-lodash-fp 
ESLint rules for lodash/fp
Install
$ npm install --save-dev eslint eslint-plugin-lodash-fpUsage
Configure it in package.json.
{
"name": "my-awesome-project",
"eslintConfig": {
"env": {
"es6": true
},
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"
},
"plugins": [
"lodash-fp"
],
"rules": {
"lodash-fp/consistent-compose": "off",
"lodash-fp/consistent-name": [
"error",
"_"
],
"lodash-fp/no-argumentless-calls": "error",
"lodash-fp/no-chain": "error",
"lodash-fp/no-extraneous-args": "error",
"lodash-fp/no-extraneous-function-wrapping": "error",
"lodash-fp/no-extraneous-iteratee-args": "error",
"lodash-fp/no-extraneous-partials": "error",
"lodash-fp/no-for-each": "off",
"lodash-fp/no-partial-of-curried": "error",
"lodash-fp/no-single-composition": "error",
"lodash-fp/no-submodule-destructuring": "error",
"lodash-fp/no-unused-result": "error",
"lodash-fp/prefer-compact": "error",
"lodash-fp/prefer-composition-grouping": "error",
"lodash-fp/prefer-constant": [
"error",
{
"arrowFunctions": false
}
],
"lodash-fp/prefer-flat-map": "error",
"lodash-fp/prefer-get": "error",
"lodash-fp/prefer-identity": [
"error",
{
"arrowFunctions": false
}
],
"lodash-fp/preferred-alias": "off",
"lodash-fp/use-fp": "error"
}
}
}Rules
- consistent-compose - Enforce a consistent composition method.
- consistent-name - Enforce a consistent name for Lodash.
- no-argumentless-calls - Forbid argument-less calls of Lodash methods.
- no-chain - Forbid the use of
_.chain - no-extraneous-args - No extraneous arguments to methods with a fixed arity.
- no-extraneous-function-wrapping - Avoid unnecessary function wrapping.
- no-extraneous-partials - Avoid unnecessary intermediate partials in curried methods.
- no-extraneous-iteratee-args - No extraneous parameters in iteratees.
- no-for-each - Forbid the use of
_.forEach - no-partial-of-curried - No use of
_.partialon curried Lodash methods. - no-single-composition - Enforce at least two methods arguments for composition methods.
- no-submodule-destructuring - Forbid destructuring of Lodash submodules.
- no-unused-result - Enforce that the result of a Lodash method call gets used.
- prefer-compact - Prefer
_.compactover_.filterwith identity function. - prefer-composition-grouping - Prefer grouping similar methods in composition methods.
- prefer-constant - Prefer
_.constantover functions returning literals. - prefer-flat-map - Prefer
_.flatMapover consecutive_.mapand_.flatten. - prefer-get - Prefer
_.getover multiple&&. - prefer-identity - Prefer
_.identityover functions returning their argument. - preferred-alias - Limit the use of aliases.
- use-fp - Use lodash/fp instead of Lodash.
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": {
"extends": "plugin:lodash-fp/recommended"
}
}See ESLint documentation for more information about extending configuration files.
MIT © Jeroen Engels
2.2.0-a1
7 years ago
2.1.3
9 years ago
2.1.2
9 years ago
2.1.1
9 years ago
2.1.0
9 years ago
2.0.1
9 years ago
2.0.0
9 years ago
1.3.0
9 years ago
1.2.0
10 years ago
1.1.3
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago
0.1.0
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago