Registry / testing / eslint-plugin-fp-ts

eslint-plugin-fp-ts

JSON →
library0.5.0jsnpmunverified

An ESLint plugin providing fp-ts-specific lint rules, including auto-fixable rules to detect deprecated imports (no-lib-imports, no-pipeable, no-module-imports) and to reduce redundant functional patterns (no-redundant-flow, prefer-traverse, prefer-chain, prefer-bimap), plus a rule to catch discarded pure expressions (no-discarded-pure-expression). Current stable version v0.5.0 requires ESLint ^9.0 and ships TypeScript definitions. The plugin has migrated to the new flat config format and now only supports ESLint v9, dropping support for v8. It relies on typescript-eslint for rules that need type checking.

npm install eslint-plugin-fp-ts
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-FP-T
E
eslint-plugin-fp-ts
testingjavascriptv0.5.0
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 fptsPlugin from 'eslint-plugin-fp-ts'
const fptsPlugin = require('eslint-plugin-fp-ts')
The plugin is ESM-only since v0.5.0; require() will fail. Must use import for flat config.
no-lib-imports
import { noLibImports } from 'eslint-plugin-fp-ts/rules/no-lib-imports'
import { 'no-lib-imports' } from 'eslint-plugin-fp-ts'
Individual rules can be imported from 'eslint-plugin-fp-ts/rules/<rule-name>', but the plugin object is the simplest approach.
defineConfig
import { defineConfig } from 'eslint/config'
import { defineConfig } from 'eslint'
defineConfig is exported from 'eslint/config' in ESLint v9, not from the main 'eslint' package.
types
import type { Plugin } from 'eslint'
import { Plugin } from 'eslint'
Type imports should use import type to avoid runtime side effects.

Flat config example enabling 'no-lib-imports', 'no-redundant-flow', and 'no-discarded-pure-expression' rules with parser options for type checking.

import { defineConfig } from 'eslint/config'; import fptsPlugin from 'eslint-plugin-fp-ts'; export default defineConfig({ plugins: { 'fp-ts': fptsPlugin, }, languageOptions: { parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname, }, }, rules: { 'fp-ts/no-lib-imports': 'error', 'fp-ts/no-redundant-flow': 'error', 'fp-ts/no-discarded-pure-expression': 'warn', }, });
Debug
Known issues
breakingPlugin v0.5.0 drops support for ESLint v8; only ESLint v9 flat config is supported.
fix
Upgrade ESLint to ^9.0 and migrate to flat config (eslint.config.mjs).
affects: >=0.5.0
breakingPlugin v0.4.0 migrated to ESLint v9 and dropped CommonJS support; require() will fail.
fix
Use ESM imports and flat config or downgrade to v0.3.x if using eslintrc and CJS.
affects: >=0.4.0 <0.5.0
breakingPlugin v0.3.0 upgraded to ESLint v8, dropping ESLint v7 support.
fix
Upgrade ESLint to ^8.0 or use v0.2.x for ESLint v7.
affects: >=0.3.0 <0.4.0
gotchaRules that require type-checking (e.g., no-discarded-pure-expression) will not work without configuring parserOptions.projectService or project.
fix
Set parserOptions.projectService: true (or project) and tsconfigRootDir in languageOptions.
affects: >=0.2.0
deprecatedImporting from 'fp-ts/lib/' is deprecated; use 'fp-ts/<module>' instead.
fix
Use rule 'fp-ts/no-lib-imports' to enforce the new import style.
affects: >=0.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using require() to load the plugin when the package is ESM-only.
fix
Use import syntax: import fptsPlugin from 'eslint-plugin-fp-ts';
Configuration for rule "fp-ts/no-discarded-pure-expression" is invalid: has no properties.
Missing parser options for type-checking rules.
fix
Add languageOptions.parserOptions.projectService: true to your flat config.
ESLint couldn't find the plugin "eslint-plugin-fp-ts".
Plugin not installed or incorrectly referenced in config.
fix
Ensure eslint-plugin-fp-ts is installed and imported as shown in the quickstart.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency; plugin is a set of ESLint rules that must be used with ESLint v9 or later
@typescript-eslint/parseroptionalrequired for rules that need type information (e.g., no-discarded-pure-expression)
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-fp-ts — npm install eslint-plugin-fp-ts · libregistry