ESLint plugin for Lodash, forked from the original eslint-plugin-lodash by Wix, adding extra rules and ESLint v9 support. Current stable version is 7.6.0. It provides over 40 lint rules to enforce best practices with Lodash, including collection method usage, chaining, and performance traps. It supports both Lodash v3 and v4, and offers recommended and canonical configurations. This fork is actively maintained and adds rules like prefer-nullish-coalescing not present in the original.
npm install eslint-plugin-lodash-fVerified import paths — ran on the pinned version, not inferred.
Shows how to use the plugin in ESLint flat config, enabling two rules.
If using ESLint <8.40, stick to v6.x. Update rule configs to new names as per changelog.
Ensure your code uses single method imports if possible, or update rule configurations.
Use 'prefer-chain' instead.
Add 'settings: { lodash: { pragma: '_' } }' in your ESLint config.Use the 'v3' config or manually disable those rules if using lodash/fp.
Use the flat config format shown in the quickstart.
Run 'npm install eslint-plugin-lodash --save-dev' and ensure it's in node_modules.
Use the legacy format: { "plugins": ["lodash"], "extends": ["plugin:lodash/recommended"] } or migrate to flat config.Use the plugin as an object: { plugins: { lodash: plugin } }.Check the list of rules in the plugin docs. Ensure the rule name is exact.