Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
add eslint-plugin-lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Neculau (anu) committed Aug 7, 2017
1 parent 0cb524c commit 73e310b
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
1 change: 1 addition & 0 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
'./configs/async-await.js',
'./configs/dependencies.js',
'./configs/import.js',
'./configs/lodash.js',
'./configs/no-null.js',
'./configs/max-len-2.js',
'./configs/browser.js',
Expand Down
84 changes: 84 additions & 0 deletions configs/lodash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
module.exports = {
plugins: [
'lodash'
],
settings: {
lodash: {
pragma: '_',
version: 4
}
},
rules: {
// possible errors
'lodash/callback-binding': 'error',
'lodash/collection-method-value': 'error',
'lodash/collection-return': 'error',
'lodash/no-double-unwrap': 'error',
'lodash/no-extra-args': 'error',
'lodash/no-unbound-this': 'error',
'lodash/unwrap': 'error',

// stylistic issues
'lodash/chain-style': [
'error',
'explicit'
],
'lodash/chaining': [
'error',
'never'
],
'lodash/consistent-compose': [
'error',
'flowRight'
],
'lodash/identity-shorthand': [
'error',
'always'
],
'lodash/import-scope': [
'error',
'full'
],
'lodash/matches-prop-shorthand': 'off',
'lodash/matches-shorthand': [
'error',
'always'
],
'lodash/no-commit': 'error',
'lodash/path-style': [
'error',
'string'
],
'lodash/prefer-compact': 'off',
'lodash/prefer-filter': 'error',
'lodash/prefer-flat-map': 'off',
'lodash/prefer-invoke-map': 'off',
'lodash/prefer-map': 'error',
'lodash/prefer-reject': 'off',
'lodash/prefer-thru': 'off',
'lodash/prefer-wrapper-method': 'error',
'lodash/preferred-alias': 'error',
'lodash/prop-shorthand': 'error',

// preference over native
'lodash/prefer-constant': 'off',
'lodash/prefer-get': 'error',
'lodash/prefer-includes': [
'error',
{includeNative: true}
],
'lodash/prefer-is-nil': 'error',
'lodash/prefer-lodash-chain': 'error',
'lodash/prefer-lodash-method': 'error',
'lodash/prefer-lodash-typecheck': 'error',
'lodash/prefer-matches': 'error',
'lodash/prefer-noop': 'error',
'lodash/prefer-over-quantifier': 'off',
'lodash/prefer-some': [
'error',
{includeNative: true}
],
'lodash/prefer-startswith': 'error',
'lodash/prefer-times': 'error'
}
};
1 change: 1 addition & 0 deletions node.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
'./configs/async-await.js',
'./configs/dependencies.js',
'./configs/import.js',
'./configs/lodash.js',
'./configs/no-null.js',
'./configs/max-len-2.js',
'./configs/node.js',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"eslint-plugin-babel": "4.1.1",
"eslint-plugin-dependencies": "2.4.0",
"eslint-plugin-import": "2.6.0",
"eslint-plugin-lodash": "2.4.4",
"eslint-plugin-max-len-2": "0.0.5",
"eslint-plugin-no-null": "1.0.2"
},
Expand Down

0 comments on commit 73e310b

Please sign in to comment.