Registry / testing / eslint-plugin-lodash-fp

eslint-plugin-lodash-fp

JSON →
library2.2.0-a1jsnpmunverified

An ESLint plugin providing rules specifically for lodash/fp, the functional programming variant of Lodash. The current stable version is 2.2.0-alpha1 (pre-release) and targets ESLint >=3. It helps enforce FP best practices such as currying, data-last argument order, and composition, and prevents usage of impure or chain-based patterns. It offers over 20 rules, including `use-fp` to enforce lodash/fp over lodash, `no-chain` to forbid `_.chain`, and `prefer-constant` to replace arrow functions returning literals. It distinguishes itself from general Lodash linting by focusing on the FP paradigm and catching subtle issues like extraneous arguments and unused results.

npm install eslint-plugin-lodash-fp
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-LODA
E
eslint-plugin-lodash-fp
testingjavascriptv2.2.0-a1
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.

eslint-plugin-lodash-fp
plugins: ['lodash-fp']
plugins: ['eslint-plugin-lodash-fp']
ESLint automatically resolves 'eslint-plugin-' prefix when specifying plugin name in .eslintrc.
lodash/fp/lodash.js
import _ from 'lodash/fp';
import _ from 'lodash';
The plugin assumes you are using lodash/fp, not lodash. Use 'lodash/fp' import to match rules like `use-fp`.
require('lodash/fp')
const _ = require('lodash/fp');
const _ = require('lodash');
For CommonJS, require the fp submodule. The plugin's `use-fp` rule will flag require('lodash').

Basic setup and a rule violation example: shows installation, configuration in .eslintrc.json, and how no-chain catches _.chain usage.

// Install: npm install --save-dev eslint eslint-plugin-lodash-fp // .eslintrc.json { "plugins": ["lodash-fp"], "rules": { "lodash-fp/consistent-name": ["error", "_"], "lodash-fp/no-chain": "error", "lodash-fp/prefer-compact": "error", "lodash-fp/use-fp": "error" } } // Example code that triggers no-chain: // _.chain([1,2,3]).map(x => x * 2).value(); // ❌ Error: Unexpected _.chain // Correct FP: compose or use lodash/fp directly import _ from 'lodash/fp'; const result = _.map(x => x * 2, [1, 2, 3]); // ✅
Debug
Known issues
deprecatedRule 'no-extraneous-function-wrapping' may produce false positives for complex expressions.
fix
Review rule documentation and consider disabling if too noisy.
affects: all
gotchaRules assume lodash/fp is imported. If you use both lodash and lodash/fp, some rules may misbehave.
fix
Use separate ESLint configurations per file or scope: one for lodash/fp files and one for lodash files.
affects: >=0.0.0
deprecatedThe 'no-extraneous-partials' rule can be too restrictive and may flag valid currying patterns.
fix
Disable the rule or use the 'exceptions' option if available (see docs).
affects: all
breakingVersion 2.0.0 changed some rule defaults: 'no-chain' became error by default.
fix
Update configurations to explicitly set severity for 'no-chain' if relying on old defaults.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'lodash-fp' from package 'eslint-plugin-lodash-fp': Could not find module 'eslint-plugin-lodash-fp'
eslint-plugin-lodash-fp is not installed or not in node_modules.
fix
npm install --save-dev eslint-plugin-lodash-fp
Definition for rule 'lodash-fp/use-fp' was not found
Plugin 'lodash-fp' not registered in plugins array or ESLint version too old (requires >=3).
fix
Add 'lodash-fp' to plugins in .eslintrc and ensure ESLint >=3.
Upgrade
Version history
2.2.0-a1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-lodash-fp — npm install eslint-plugin-lodash-fp · libregistry