Registry / testing / eslint-plugin-lodash-f

eslint-plugin-lodash-f

JSON →
library7.6.0jsnpmunverified

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-f
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-LODA
E
eslint-plugin-lodash-f
testingjavascriptv7.6.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rules
import { rules } from 'eslint-plugin-lodash'
const rules = require('eslint-plugin-lodash').rules
The plugin exports rules as an object. You can also require it in CJS.
configs.recommended
import { configs } from 'eslint-plugin-lodash'
Use configs.recommended in flat config.
plugin
import plugin from 'eslint-plugin-lodash'
const plugin = require('eslint-plugin-lodash').default
Default import works in ESM. In CJS, use require('eslint-plugin-lodash') directly.

Shows how to use the plugin in ESLint flat config, enabling two rules.

// eslint.config.js (flat config) import plugin from 'eslint-plugin-lodash'; export default [ { plugins: { lodash: plugin }, rules: { 'lodash/collection-return': 'error', 'lodash/no-extra-args': 'warn', }, }, ];
Debug
Known issues
breakingVersion 7.0.0 dropped support for ESLint <8.40 and changed rule names.
fix
If using ESLint <8.40, stick to v6.x. Update rule configs to new names as per changelog.
affects: >=7.0.0
breakingVersion 2.0.0 switched from requiring full lodash to supporting single method imports. Rules may behave differently with method imports.
fix
Ensure your code uses single method imports if possible, or update rule configurations.
affects: >=2.0.0 <3.0.0
deprecatedThe 'no-single-chain' rule is deprecated and will be removed in the next major version.
fix
Use 'prefer-chain' instead.
affects: >=7.0.0
gotchaIf using the 'canonical' config, you must set the lodash pragma in settings, otherwise rules may not work.
fix
Add 'settings: { lodash: { pragma: '_' } }' in your ESLint config.
affects: >=1.0.0
gotchaRules that analyze chaining (e.g., 'chain', 'unwrap') may produce false positives when using method imports from lodash/fp.
fix
Use the 'v3' config or manually disable those rules if using lodash/fp.
affects: >=7.0.0
breakingESLint v9 flat config requires importing the plugin differently. The legacy rc format is no longer supported.
fix
Use the flat config format shown in the quickstart.
affects: >=7.6.0 <8.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'lodash': Cannot find module 'eslint-plugin-lodash'
Plugin not installed or not resolved in ESLint's plugin resolution.
fix
Run 'npm install eslint-plugin-lodash --save-dev' and ensure it's in node_modules.
Error: ESLint configuration in .eslintrc.json is invalid: - Unexpected top-level property "configs"
Using the flat config export (configs) in a legacy .eslintrc file.
fix
Use the legacy format: { "plugins": ["lodash"], "extends": ["plugin:lodash/recommended"] } or migrate to flat config.
TypeError: plugin is not a function
Trying to call the plugin as a function in flat config.
fix
Use the plugin as an object: { plugins: { lodash: plugin } }.
Rule 'lodash/xxx' is not defined.
Rule name typo or rule not included in the loaded plugin.
fix
Check the list of rules in the plugin docs. Ensure the rule name is exact.
Upgrade
Version history
7.6.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency: plugin requires ESLint >=9.29.0
Agent activity
2 hits · last 30 days
node
2
Resources