eslint-plugin-ramda

raw JSON →
2.5.1 verified Sat Apr 25 auth: no javascript maintenance

ESLint plugin providing lint rules for Ramda, a functional programming library. v2.5.1 is the latest stable release (2020-02-19), with v3.0.0 in beta. It helps enforce Ramda idioms, suggest simplifications, and prevent non-idiomatic usage. Unlike generic linting, it is Ramda-specific, with rules like prefer-complement, compose-pipe-style, and map-simplification. Released under the ramda GitHub organization, it follows semantic versioning.

error Error: Failed to load plugin 'ramda' declared in '.eslintrc': Cannot find module 'eslint-plugin-ramda'
cause eslint-plugin-ramda not installed or not in node_modules.
fix
Run npm install --save-dev eslint-plugin-ramda or yarn add --dev eslint-plugin-ramda.
error Definition for rule 'ramda/prefer-complement' was not found
cause Plugin installed but rule name is incorrect or plugin not loaded.
fix
Check that the rule name is exactly 'ramda/prefer-complement' and plugin is listed in 'plugins' array.
error TypeError: Cannot read property 'some' of undefined
cause ESLint version incompatible or plugin not compatible with ESLint flat config.
fix
Ensure ESLint version >=4, and use legacy config format if using ESLint >=9 flat config.
breaking v2.0.0 merged two plugin projects, dropping v1 rules except prefer-reject.
fix Update to v2.5.1 and adapt configs to new rule names and structure.
deprecated v3.0.0-beta deprecates Node.js <=6; final v3 may drop more versions.
fix Use Node >=10 for compatibility with upcoming releases.
gotcha Plugin assumes all Ramda calls use the 'R' variable; custom namespace not supported.
fix Ensure Ramda is imported as 'R' or use options if available in future versions.
gotcha Rules may produce false positives when Ramda functions are shadowed or reassigned.
fix Avoid shadowing R.xxx in scopes where linting is active.
deprecated Rule 'prefer-reject' from v1 was dropped in v2; use 'ramda/prefer-complement' instead.
fix Replace 'prefer-reject' with 'prefer-complement' in ESLint config.
npm install eslint-plugin-ramda
yarn add eslint-plugin-ramda
pnpm add eslint-plugin-ramda

Shows how to install and configure eslint-plugin-ramda in an ESLint config file with three example rules.

// Install: npm install --save-dev eslint-plugin-ramda
// In .eslintrc.js:
module.exports = {
  plugins: ['ramda'],
  rules: {
    'ramda/always-simplification': 'warn',
    'ramda/compose-pipe-style': ['error', 'pipe'],
    'ramda/prefer-complement': 'warn'
  }
};