{"id":19824,"library":"eslint-plugin-lodash-fp","title":"eslint-plugin-lodash-fp","description":"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.","status":"maintenance","version":"2.2.0-a1","language":"javascript","source_language":"en","source_url":"https://github.com/jfmengels/eslint-plugin-lodash-fp","tags":["javascript","eslint","plugin","eslint-plugin","eslintplugin","lodash","lodash/fp","lodash-fp","fp"],"install":[{"cmd":"npm install eslint-plugin-lodash-fp","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-lodash-fp","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-lodash-fp","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESLint automatically resolves 'eslint-plugin-' prefix when specifying plugin name in .eslintrc.","wrong":"plugins: ['eslint-plugin-lodash-fp']","symbol":"eslint-plugin-lodash-fp","correct":"plugins: ['lodash-fp']"},{"note":"The plugin assumes you are using lodash/fp, not lodash. Use 'lodash/fp' import to match rules like `use-fp`.","wrong":"import _ from 'lodash';","symbol":"lodash/fp/lodash.js","correct":"import _ from 'lodash/fp';"},{"note":"For CommonJS, require the fp submodule. The plugin's `use-fp` rule will flag require('lodash').","wrong":"const _ = require('lodash');","symbol":"require('lodash/fp')","correct":"const _ = require('lodash/fp');"}],"quickstart":{"code":"// Install: npm install --save-dev eslint eslint-plugin-lodash-fp\n\n// .eslintrc.json\n{\n  \"plugins\": [\"lodash-fp\"],\n  \"rules\": {\n    \"lodash-fp/consistent-name\": [\"error\", \"_\"],\n    \"lodash-fp/no-chain\": \"error\",\n    \"lodash-fp/prefer-compact\": \"error\",\n    \"lodash-fp/use-fp\": \"error\"\n  }\n}\n\n// Example code that triggers no-chain:\n// _.chain([1,2,3]).map(x => x * 2).value(); // ❌ Error: Unexpected _.chain\n\n// Correct FP: compose or use lodash/fp directly\nimport _ from 'lodash/fp';\nconst result = _.map(x => x * 2, [1, 2, 3]); // ✅","lang":"javascript","description":"Basic setup and a rule violation example: shows installation, configuration in .eslintrc.json, and how no-chain catches _.chain usage."},"warnings":[{"fix":"Review rule documentation and consider disabling if too noisy.","message":"Rule 'no-extraneous-function-wrapping' may produce false positives for complex expressions.","severity":"deprecated","affected_versions":"all"},{"fix":"Use separate ESLint configurations per file or scope: one for lodash/fp files and one for lodash files.","message":"Rules assume lodash/fp is imported. If you use both lodash and lodash/fp, some rules may misbehave.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Disable the rule or use the 'exceptions' option if available (see docs).","message":"The 'no-extraneous-partials' rule can be too restrictive and may flag valid currying patterns.","severity":"deprecated","affected_versions":"all"},{"fix":"Update configurations to explicitly set severity for 'no-chain' if relying on old defaults.","message":"Version 2.0.0 changed some rule defaults: 'no-chain' became error by default.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev eslint-plugin-lodash-fp","cause":"eslint-plugin-lodash-fp is not installed or not in node_modules.","error":"Error: Failed to load plugin 'lodash-fp' from package 'eslint-plugin-lodash-fp': Could not find module 'eslint-plugin-lodash-fp'"},{"fix":"Add 'lodash-fp' to plugins in .eslintrc and ensure ESLint >=3.","cause":"Plugin 'lodash-fp' not registered in plugins array or ESLint version too old (requires >=3).","error":"Definition for rule 'lodash-fp/use-fp' was not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}