{"id":19769,"library":"eslint-plugin-functional","title":"eslint-plugin-functional","description":"ESLint plugin enforcing functional programming patterns in JavaScript and TypeScript, v9.0.4 (Feb 2026). Requires ESLint ^9.0.0 or ^10.0.0 and TypeScript >=4.7.4. Actively maintained with monthly releases. Provides presets (strict, recommended, lite) and categorized rulesets for immutability, no statements, no exceptions, currying, and stylistic rules. Differentiated by TypeScript-first design, type-aware rules (e.g., type-declaration-immutability), and support for Map/Set mutation detection. Recommended alternative to plugins like eslint-plugin-immutable or writing custom rules.","status":"active","version":"9.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/eslint-functional/eslint-plugin-functional","tags":["javascript","eslint","eslint plugin","fp","functional","functional programming","immutability","immutable"],"install":[{"cmd":"npm install eslint-plugin-functional","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-functional","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-functional","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - plugin requires ESLint to run","package":"eslint","optional":false},{"reason":"peer dependency - many rules require type checking","package":"typescript","optional":false}],"imports":[{"note":"ESM-first; require() may fail in some bundler configs.","wrong":"const plugin = require('eslint-plugin-functional')","symbol":"default","correct":"import plugin from 'eslint-plugin-functional'"},{"note":"Named export for direct rule access; ESM only.","wrong":"const { rules } = require('eslint-plugin-functional')","symbol":"rules","correct":"import { rules } from 'eslint-plugin-functional'"},{"note":"configs is a named export containing all rule presets (strict, recommended, lite, etc.). Access via configs.recommended.","wrong":"import { recommended } from 'eslint-plugin-functional'","symbol":"configs","correct":"import { configs } from 'eslint-plugin-functional'"}],"quickstart":{"code":"import plugin from 'eslint-plugin-functional';\nimport tsParser from '@typescript-eslint/parser';\n\nexport default [\n  {\n    files: ['src/**/*.ts'],\n    languageOptions: {\n      parser: tsParser,\n      parserOptions: { project: './tsconfig.json' },\n    },\n    plugins: { functional: plugin },\n    rules: {\n      'functional/immutable-data': 'error',\n      'functional/no-let': 'error',\n      'functional/prefer-tacit': 'warn',\n    },\n  },\n];","lang":"typescript","description":"Basic ESLint flat config enabling immutable-data, no-let, and prefer-tacit rules with TypeScript parser."},"warnings":[{"fix":"Set 'ignoreMapsAndSets: true' in the immutable-data rule config if you intentionally mutate Maps/Sets.","message":"v9.0.0: immutable-data rule now detects Map and Set mutations (e.g., .set(), .delete()). Code that mutates Maps/Sets will be flagged unless ignoreMapsAndSets option is set.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Update any custom rule logic or inline configs that check private identifiers to include the '#' prefix.","message":"v8.0.0: PrivateIdentifier names are now prefixed with '#'. Rules that reference private fields may report differently.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Add 'parserOptions: { project: \"./tsconfig.json\" }' to the languageOptions for files using this rule.","message":"no-throw-statements rule requires type checking (marked as requiring type checking since v9.0.2). Ensure parserOptions.project is set and the rule runs only on files included in the TypeScript project.","severity":"gotcha","affected_versions":">=9.0.2"},{"fix":"Use the flat config format with import: import { configs } from 'eslint-plugin-functional'; then spread configs.recommended.","message":"Rulesets like 'configs.recommended' are now accessed via named export 'configs'. Old string-based 'extends' patterns (e.g., 'plugin:functional/recommended') may still work but are not the future.","severity":"deprecated","affected_versions":">=7.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Migrate to eslint.config.js and use import plugin from 'eslint-plugin-functional' with the plugins and rules object.","cause":"Using legacy .eslintrc.* format with new flat config system introduced in v9.","error":"Error: ESLint configuration in .eslintrc.json is invalid: - The 'extends' property is not supported in flat config."},{"fix":"Add 'plugins: { functional: plugin }' in the flat config object.","cause":"Misconfigured plugin loading: plugin not listed under 'plugins' in flat config.","error":"TypeError: Cannot read properties of undefined (reading 'Functional')"},{"fix":"Ensure parserOptions.project points to a valid tsconfig.json file that includes the file being linted.","cause":"Missing or incorrect path to tsconfig.json in parserOptions.project.","error":"Parsing error: The 'parserOptions.project' has been set for 'nonexistent.ts' but the project does not exist."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}