Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
plugin
✓ import plugin from 'eslint-plugin-lodash'
✗ const plugin = require('eslint-plugin-lodash')
ESM default export; CJS require() still works for Node <12 but plugin is ESM-only for v8.
recommended config
✓ module.exports = { plugins: ['lodash'], extends: ['plugin:lodash/recommended'] }
✗ module.exports = { plugins: ['eslint-plugin-lodash'], extends: ['eslint-plugin-lodash/recommended'] }
Use shorthand 'lodash' for plugin and 'plugin:lodash/recommended' for config.
canonical config
✓ extends: ['plugin:lodash/canonical']
✗ extends: ['lodash/canonical']
Configs must be prefixed with 'plugin:'. The 'canonical' config assumes a single Lodash object (e.g., '_') without explicit imports.
Shows installation, ESLint config for recommended rules, and examples of rule-triggering code.
// Install: npm install --save-dev eslint eslint-plugin-lodash
// .eslintrc.json
{
"plugins": ["lodash"],
"extends": ["plugin:lodash/recommended"],
"rules": {
"lodash/callback-binding": "error",
"lodash/collection-method-value": "warn",
"lodash/collection-return": "error",
"lodash/no-double-unwrap": "error",
"lodash/no-extra-args": "error",
"lodash/no-unbound-this": "error",
"lodash/unwrap": "error"
},
"settings": {
"lodash": {
"pragma": "_"
}
}
}
// Example file
import _ from 'lodash';
const arr = [1, 2, 3];
// OK: _.forEach returns undefined, but collection-method-value rule warns
_.forEach(arr, item => console.log(item));
// Error: collection-return rule expects return in non-forEach iteratee
const doubled = _.map(arr, item => item * 2); // OK, returns value
Errors
Common errors & fixes
ESLint couldn't find the plugin "eslint-plugin-lodash".
Plugin not installed or ESLint config incorrectly references the plugin.
fixRun 'npm install eslint-plugin-lodash --save-dev' and ensure .eslintrc.json has 'plugins: ["lodash"]'.
Configuration for rule "lodash/collection-return" is invalid: Value "error" is not allowed.
Rule does not exist or is misspelled.
fixCheck the rule name in the official list; ensure it's included in the plugin.
Parsing error: The keyword 'import' is reserved.
ESLint parser does not support ES modules.
fixAdd 'parserOptions: { sourceType: "module" }' to your ESLint config. Audit
Dependencies
eslintrequiredpeer dependency; requires ESLint >=9.0.0