A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/eslint-plugin-lodash below:

eslint-plugin-lodash - npm

Lodash-specific linting rules for ESLint.

Install ESLint either locally or globally.

$ npm install eslint --save-dev

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

$ npm install eslint-plugin-lodash --save-dev

Add a plugins section and specify ESLint-Plugin-Lodash as a plugin. You can additionally add settings for the plugin.

These are settings that can be shared by all of the rules. All settings are under the lodash inside the general settings object. For more info about shared settings, read the ESLint Configuration Guide.

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

Recommended configuration

This plugin exports a recommended configuration that enforces all the rules. You can configure the plugin as follows:

{
  "plugins": ["lodash"],
  "extends": ["plugin:lodash/recommended"]
}
Configuration for use with the full Lodash object

If you work with the full Lodash object with the same variable name every time, you should use the canonical configuration. This allows rules to run without explicitly importing Lodash in your code, and allows for faster execution for some of the rules:

{
  "plugins": ["lodash"],
  "extends": ["plugin:lodash/canonical"]
}
Configuration for Using with Lodash v3

Out of the box, this plugin supports the use of Lodash v4. To use with Lodash v3, the config needs to specify the version in the settings, and can't use some rules. The plugin also exports a v3 config for ease of use.

{
  "plugins": ["lodash"],
  "extends": ["plugin:lodash/v3"]
}

Rules are divided into categories for your convenience. All rules are off by default, unless you use one of the plugin's configurations which turn all relevant rules on.

The following rules point out areas where you might have made mistakes.

These rules are purely matters of style and are quite subjective.

These rules are also stylistic choices, but they also recommend using Lodash instead of native functions and constructs. For example, Lodash collection methods (e.g. map, forEach) are generally faster than native collection methods.

Contributions are always welcome! For more info, read our contribution guide.

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4