$ show eslint-functional/eslint-plugin-functional
This is an ESLint plugin (`eslint-plugin-functional`) that enforces functional programming patterns in JavaScript and TypeScript code. It provides 20 actively maintained rules targeting immutability, functional parameters, no classes, no exceptions, no statements, and other FP principles. The plugin deeply integrates with TypeScript's type system via `@typescript-eslint/utils` and libraries like `is-immutable-type` for type-aware immutability checks. It offers multiple configuration presets (strict, recommended, lite, etc.) and supports ESLint 9 and 10 flat configs. The codebase is well-structured with a consistent rule factory (`createRule`), shared utilities (type guards, option overrides), and an extensive test suite using snapshot testing. It is actively maintained with frequent releases, a comprehensive CI pipeline, and semantic versioning.
The LLM identified 3 files worth highlighting for reuse:
Provides a typed rule factory (`createRule` and `createRuleUsingFunction`) that abstracts the common structure of ESLint rules, enforcing consistent options, meta, and result handling. This pattern can be extracted and reused to build other ESLint plugins with a standardized, type-safe rule definition approach.
Exports a comprehensive set of AST node type guards and TypeScript type analysis helpers (e.g., `isArrayExpression`, `isMapType`, `typeMatchesSpecifier`). These are well-organized and decoupled from rule logic, making them reusable for any TypeScript AST manipulation or static analysis tool.
Implements a generic overridable options system that allows per-file or per-type-specifier configuration via a cascading override pattern. It includes a schema builder (`overridableOptionsSchema`) that can create JSON schemas for such options. This pattern is reusable across any rule system that requires context-sensitive configuration.