Registry / testing / eslint-plugin-functional

eslint-plugin-functional

JSON →
library9.0.4jsnpmunverified

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.

npm install eslint-plugin-functional
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-FUNC
E
eslint-plugin-functional
testingjavascriptv9.0.4
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.

default
import plugin from 'eslint-plugin-functional'
const plugin = require('eslint-plugin-functional')
ESM-first; require() may fail in some bundler configs.
rules
import { rules } from 'eslint-plugin-functional'
const { rules } = require('eslint-plugin-functional')
Named export for direct rule access; ESM only.
configs
import { configs } from 'eslint-plugin-functional'
import { recommended } from 'eslint-plugin-functional'
configs is a named export containing all rule presets (strict, recommended, lite, etc.). Access via configs.recommended.

Basic ESLint flat config enabling immutable-data, no-let, and prefer-tacit rules with TypeScript parser.

import plugin from 'eslint-plugin-functional'; import tsParser from '@typescript-eslint/parser'; export default [ { files: ['src/**/*.ts'], languageOptions: { parser: tsParser, parserOptions: { project: './tsconfig.json' }, }, plugins: { functional: plugin }, rules: { 'functional/immutable-data': 'error', 'functional/no-let': 'error', 'functional/prefer-tacit': 'warn', }, }, ];
Debug
Known issues
breakingv9.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.
fix
Set 'ignoreMapsAndSets: true' in the immutable-data rule config if you intentionally mutate Maps/Sets.
affects: >=9.0.0
breakingv8.0.0: PrivateIdentifier names are now prefixed with '#'. Rules that reference private fields may report differently.
fix
Update any custom rule logic or inline configs that check private identifiers to include the '#' prefix.
affects: >=8.0.0
gotchano-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.
fix
Add 'parserOptions: { project: "./tsconfig.json" }' to the languageOptions for files using this rule.
affects: >=9.0.2
deprecatedRulesets 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.
fix
Use the flat config format with import: import { configs } from 'eslint-plugin-functional'; then spread configs.recommended.
affects: >=7.0.0
Errors
Common errors & fixes
Error: ESLint configuration in .eslintrc.json is invalid: - The 'extends' property is not supported in flat config.
Using legacy .eslintrc.* format with new flat config system introduced in v9.
fix
Migrate to eslint.config.js and use import plugin from 'eslint-plugin-functional' with the plugins and rules object.
TypeError: Cannot read properties of undefined (reading 'Functional')
Misconfigured plugin loading: plugin not listed under 'plugins' in flat config.
fix
Add 'plugins: { functional: plugin }' in the flat config object.
Parsing error: The 'parserOptions.project' has been set for 'nonexistent.ts' but the project does not exist.
Missing or incorrect path to tsconfig.json in parserOptions.project.
fix
Ensure parserOptions.project points to a valid tsconfig.json file that includes the file being linted.
Upgrade
Version history
9.0.4latest on npm
Audit
Dependencies
eslintrequiredpeer dependency - plugin requires ESLint to run
typescriptrequiredpeer dependency - many rules require type checking
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-functional — npm install eslint-plugin-functional · libregistry