Skip to content

eslint-plugins/eslint-plugin-lodash

Repository files navigation

ESLint-plugin-lodash

DEPRECATED IN FAVOR OF eslint-plugin-lodash3

Travis Build Status devDependency Status

lodash specific linting rules for ESLint

Installation

Install ESLint either locally or globally.

npm install eslint

If you installed ESLint globally, you have to install lodash plugin globally too. Otherwise, install it locally.

$ npm install eslint-plugin-lodash

The rules are specifically written to target ES6 JavaScript, so you'll want to use the babel-eslint parser.

Configuration

Add plugins section and specify ESLint-plugin-lodash as a plugin.

{
  "parser": "babel-eslint",
  "plugins": [
    "lodash"
  ]
}

Finally, enable all of the rules that you would like to use.

{
  "rules": {
    "lodash/import": 1,
  }
}

List of supported rules

  • import: Prevent importing the entire lodash (or lodash-compat) library.

To Do

  • Add Contributing Guide, until then PRs welcome!

Any rule idea is welcome !

License

ESLint-plugin-lodash is licensed under the MIT License.