{"id":19766,"library":"eslint-plugin-fp-ts","title":"ESLint Plugin fp-ts","description":"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.","status":"active","version":"0.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/buildo/eslint-plugin-fp-ts","tags":["javascript","eslint","eslintplugin","eslint-plugin","fp-ts","typescript"],"install":[{"cmd":"npm install eslint-plugin-fp-ts","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-fp-ts","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-fp-ts","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin is a set of ESLint rules that must be used with ESLint v9 or later","package":"eslint","optional":false},{"reason":"required for rules that need type information (e.g., no-discarded-pure-expression)","package":"@typescript-eslint/parser","optional":true}],"imports":[{"note":"The plugin is ESM-only since v0.5.0; require() will fail. Must use import for flat config.","wrong":"const fptsPlugin = require('eslint-plugin-fp-ts')","symbol":"default","correct":"import fptsPlugin from 'eslint-plugin-fp-ts'"},{"note":"Individual rules can be imported from 'eslint-plugin-fp-ts/rules/<rule-name>', but the plugin object is the simplest approach.","wrong":"import { 'no-lib-imports' } from 'eslint-plugin-fp-ts'","symbol":"no-lib-imports","correct":"import { noLibImports } from 'eslint-plugin-fp-ts/rules/no-lib-imports'"},{"note":"defineConfig is exported from 'eslint/config' in ESLint v9, not from the main 'eslint' package.","wrong":"import { defineConfig } from 'eslint'","symbol":"defineConfig","correct":"import { defineConfig } from 'eslint/config'"},{"note":"Type imports should use import type to avoid runtime side effects.","wrong":"import { Plugin } from 'eslint'","symbol":"types","correct":"import type { Plugin } from 'eslint'"}],"quickstart":{"code":"import { defineConfig } from 'eslint/config';\nimport fptsPlugin from 'eslint-plugin-fp-ts';\n\nexport default defineConfig({\n  plugins: {\n    'fp-ts': fptsPlugin,\n  },\n  languageOptions: {\n    parserOptions: {\n      projectService: true,\n      tsconfigRootDir: import.meta.dirname,\n    },\n  },\n  rules: {\n    'fp-ts/no-lib-imports': 'error',\n    'fp-ts/no-redundant-flow': 'error',\n    'fp-ts/no-discarded-pure-expression': 'warn',\n  },\n});","lang":"typescript","description":"Flat config example enabling 'no-lib-imports', 'no-redundant-flow', and 'no-discarded-pure-expression' rules with parser options for type checking."},"warnings":[{"fix":"Upgrade ESLint to ^9.0 and migrate to flat config (eslint.config.mjs).","message":"Plugin v0.5.0 drops support for ESLint v8; only ESLint v9 flat config is supported.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Use ESM imports and flat config or downgrade to v0.3.x if using eslintrc and CJS.","message":"Plugin v0.4.0 migrated to ESLint v9 and dropped CommonJS support; require() will fail.","severity":"breaking","affected_versions":">=0.4.0 <0.5.0"},{"fix":"Upgrade ESLint to ^8.0 or use v0.2.x for ESLint v7.","message":"Plugin v0.3.0 upgraded to ESLint v8, dropping ESLint v7 support.","severity":"breaking","affected_versions":">=0.3.0 <0.4.0"},{"fix":"Set parserOptions.projectService: true (or project) and tsconfigRootDir in languageOptions.","message":"Rules that require type-checking (e.g., no-discarded-pure-expression) will not work without configuring parserOptions.projectService or project.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Use rule 'fp-ts/no-lib-imports' to enforce the new import style.","message":"Importing from 'fp-ts/lib/' is deprecated; use 'fp-ts/<module>' instead.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import syntax: import fptsPlugin from 'eslint-plugin-fp-ts';","cause":"Using require() to load the plugin when the package is ESM-only.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Add languageOptions.parserOptions.projectService: true to your flat config.","cause":"Missing parser options for type-checking rules.","error":"Configuration for rule \"fp-ts/no-discarded-pure-expression\" is invalid: has no properties."},{"fix":"Ensure eslint-plugin-fp-ts is installed and imported as shown in the quickstart.","cause":"Plugin not installed or incorrectly referenced in config.","error":"ESLint couldn't find the plugin \"eslint-plugin-fp-ts\"."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}