{"id":13566891,"url":"https://github.com/eslint-functional/eslint-plugin-functional","last_synced_at":"2025-04-29T18:44:14.995Z","repository":{"id":34994359,"uuid":"194648815","full_name":"eslint-functional/eslint-plugin-functional","owner":"eslint-functional","description":"ESLint rules to disable mutation and promote fp in JavaScript and TypeScript.","archived":false,"fork":false,"pushed_at":"2025-04-04T14:32:42.000Z","size":6281,"stargazers_count":905,"open_issues_count":1,"forks_count":31,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-24T19:03:22.249Z","etag":null,"topics":["eslint","eslint-plugin","eslint-rules","fp","functional","functional-programming","immutability","javascript","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eslint-functional.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"tidelift":"npm/eslint-plugin-functional","ko_fi":"rebeccastevens","custom":"https://github.com/eslint-functional/eslint-plugin-functional/blob/main/DONATIONS.md","issuehunt":"eslint-functional/eslint-plugin-functional"}},"created_at":"2019-07-01T10:08:43.000Z","updated_at":"2025-04-23T12:54:57.000Z","dependencies_parsed_at":"2023-09-28T05:24:57.410Z","dependency_job_id":"6f159613-d866-420c-bc3d-ff4b7ec2b82e","html_url":"https://github.com/eslint-functional/eslint-plugin-functional","commit_stats":{"total_commits":1517,"total_committers":22,"mean_commits":68.95454545454545,"dds":0.5781147000659196,"last_synced_commit":"0409db6c992f3d7f1db19632ea5767d9ec78b7dc"},"previous_names":["jonaskello/eslint-plugin-ts-immutable","jonaskello/eslint-plugin-functional"],"tags_count":109,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint-functional%2Feslint-plugin-functional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint-functional%2Feslint-plugin-functional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint-functional%2Feslint-plugin-functional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint-functional%2Feslint-plugin-functional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eslint-functional","download_url":"https://codeload.github.com/eslint-functional/eslint-plugin-functional/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251561931,"owners_count":21609477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","eslint-plugin","eslint-rules","fp","functional","functional-programming","immutability","javascript","typescript"],"created_at":"2024-08-01T13:02:18.957Z","updated_at":"2025-04-29T18:44:14.974Z","avatar_url":"https://github.com/eslint-functional.png","language":"TypeScript","funding_links":["https://tidelift.com/funding/github/npm/eslint-plugin-functional","https://ko-fi.com/rebeccastevens","https://github.com/eslint-functional/eslint-plugin-functional/blob/main/DONATIONS.md","https://issuehunt.io/r/eslint-functional/eslint-plugin-functional","https://tidelift.com/subscription/pkg/npm-eslint-plugin-functional?utm_source=npm-eslint-plugin-functional\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo"],"categories":["TypeScript","typescript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![eslint-logo](docs/assets/eslint-functional-logo.png?sanitize=true)\n\n# eslint-plugin-functional\n\n[![npm version](https://img.shields.io/npm/v/eslint-plugin-functional.svg?style=flat)](https://www.npmjs.com/package/eslint-plugin-functional)\n[![Release](https://github.com/eslint-functional/eslint-plugin-functional/actions/workflows/release.yml/badge.svg)](https://github.com/eslint-functional/eslint-plugin-functional/actions/workflows/release.yml)\n[![Coverage Status](https://codecov.io/gh/eslint-functional/eslint-plugin-functional/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-functional/eslint-plugin-functional)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat)](https://github.com/semantic-release/semantic-release)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier)\n[![MIT license](https://img.shields.io/github/license/eslint-functional/eslint-plugin-functional.svg?style=flat)](https://opensource.org/licenses/MIT)\n[![GitHub Discussions](https://img.shields.io/github/discussions/eslint-functional/eslint-plugin-functional)](https://github.com/eslint-functional/eslint-plugin-functional/discussions)\n\nAn [ESLint](http://eslint.org) plugin to disable mutation and promote functional programming in JavaScript and TypeScript.\n\n\u003c/div\u003e\n\n## Donate\n\n[Any donations would be much appreciated](./DONATIONS.md). 😄\n\n### Enterprise Users\n\n`eslint-plugin-functional` is available as part of the Tidelift Subscription.\n\nTidelift is working with the maintainers of `eslint-plugin-functional` and a growing network of open source maintainers\nto ensure your open source software supply chain meets enterprise standards now and into the future.\n[Learn more.](https://tidelift.com/subscription/pkg/npm-eslint-plugin-functional?utm_source=npm-eslint-plugin-functional\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo)\n\n## Getting Started\n\n[See our getting started guide](./GETTING_STARTED.md).\n\n## Rulesets\n\nThe following rulesets are made available by this plugin.\n\nPresets:\n\n- **Strict** (`configs.strict`)\\\n  Enforce recommended rules designed to strictly enforce functional programming.\n\n- **Recommended** (`configs.recommended`)\\\n  Has the same goal as the `strict` preset but a little more lenient, allowing for functional-like coding styles and\n  nicer integration with non-functional 3rd-party libraries.\n\n- **Lite** (`configs.lite`)\\\n  Good if you're new to functional programming or are converting a large codebase.\n\nCategorized:\n\n- **Currying** (`configs.currying`)\\\n  JavaScript functions support syntax that is not compatible with curried functions. To enforce currying, this syntax\n  should be prevented.\n\n- **No Exceptions** (`configs.noExceptions`)\\\n  Functional programming style does not use run-time exceptions. Instead expressions produces values to indicate errors.\n\n- **No Mutations** (`configs.noMutations`)\\\n  Prevent mutating any data as that's not functional\n\n- **No Other Paradigms** (`configs.noOtherParadigms`)\\\n  JavaScript is multi-paradigm, allowing not only functional, but object-oriented as well as other programming styles.\n  To promote a functional style, prevent the use of other paradigm styles.\n\n- **No Statements** (`configs.noStatements`)\\\n  In functional programming everything is an expression that produces a value.\n  JavaScript has a lot of syntax that is just statements that does not produce a value.\n  That syntax has to be prevented to promote a functional style.\n\n- **Stylistic** (`configs.stylistic`)\\\n  Enforce code styles that can be considered to be more functional.\n\nOther:\n\n- **All** (`configs.all`)\\\n  Enables all rules defined in this plugin.\n\n- **Off** (`configs.off`)\\\n  Disable all rules defined in this plugin.\n\n- **Disable Type Checked** (`configs.disableTypeChecked`)\\\n  Disable all rules that require type information.\n\n- **External Vanilla Recommended** (`configs.externalVanillaRecommended`)\\\n  Configures recommended [vanilla ESLint](https://www.npmjs.com/package/eslint) rules.\n\n- **External TypeScript Recommended** (`configs.externalTypeScriptRecommended`)\\\n  Configures recommended [TypeScript ESLint](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) rules.\n  Enabling this ruleset will also enable the vanilla one.\n\nThe [below section](#rules) gives details on which rules are enabled by each ruleset.\n\n## Rules\n\n\u003c!-- markdownlint-disable --\u003e\n\u003c!-- begin auto-generated rules list --\u003e\n\n💼 Configurations enabled in.\\\n⚠️ Configurations set to warn in.\\\n🚫 Configurations disabled in.\\\n☑️ Set in the `lite` configuration.\\\n✅ Set in the `recommended` configuration.\\\n🔒 Set in the `strict` configuration.\\\n🎨 Set in the `stylistic` configuration.\\\n🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\\\n💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\\\n💭 Requires [type information](https://typescript-eslint.io/linting/typed-linting).\\\n❌ Deprecated.\n\n### Currying\n\n| Name                                                         | Description                    | 💼                           | ⚠️  | 🚫                            | 🔧  | 💡  | 💭  | ❌  |\n| :----------------------------------------------------------- | :----------------------------- | :--------------------------- | :-- | :---------------------------- | :-- | :-- | :-- | :-- |\n| [functional-parameters](docs/rules/functional-parameters.md) | Enforce functional parameters. | ☑️ ✅ 🔒 ![badge-currying][] |     | ![badge-disableTypeChecked][] |     |     | 💭  |     |\n\n### No Exceptions\n\n| Name                                                     | Description                                            | 💼                               | ⚠️  | 🚫    | 🔧  | 💡  | 💭  | ❌  |\n| :------------------------------------------------------- | :----------------------------------------------------- | :------------------------------- | :-- | :---- | :-- | :-- | :-- | :-- |\n| [no-promise-reject](docs/rules/no-promise-reject.md)     | Disallow rejecting promises.                           |                                  |     |       |     |     |     |     |\n| [no-throw-statements](docs/rules/no-throw-statements.md) | Disallow throwing exceptions.                          | ☑️ ✅ 🔒 ![badge-noExceptions][] |     |       |     |     |     |     |\n| [no-try-statements](docs/rules/no-try-statements.md)     | Disallow try-catch[-finally] and try-finally patterns. | 🔒 ![badge-noExceptions][]       |     | ☑️ ✅ |     |     |     |     |\n\n### No Mutations\n\n| Name                                                                         | Description                                                     | 💼                              | ⚠️  | 🚫                            | 🔧  | 💡  | 💭  | ❌  |\n| :--------------------------------------------------------------------------- | :-------------------------------------------------------------- | :------------------------------ | :-- | :---------------------------- | :-- | :-- | :-- | :-- |\n| [immutable-data](docs/rules/immutable-data.md)                               | Enforce treating data as immutable.                             | ☑️ ✅ 🔒 ![badge-noMutations][] |     | ![badge-disableTypeChecked][] |     |     | 💭  |     |\n| [no-let](docs/rules/no-let.md)                                               | Disallow mutable variables.                                     | ☑️ ✅ 🔒 ![badge-noMutations][] |     |                               |     |     |     |     |\n| [prefer-immutable-types](docs/rules/prefer-immutable-types.md)               | Require function parameters to be typed as certain immutability | ☑️ ✅ 🔒 ![badge-noMutations][] |     | ![badge-disableTypeChecked][] | 🔧  | 💡  | 💭  |     |\n| [prefer-readonly-type](docs/rules/prefer-readonly-type.md)                   | Prefer readonly types over mutable types.                       |                                 |     | ![badge-disableTypeChecked][] | 🔧  |     | 💭  | ❌  |\n| [type-declaration-immutability](docs/rules/type-declaration-immutability.md) | Enforce the immutability of types based on patterns.            | ☑️ ✅ 🔒 ![badge-noMutations][] |     | ![badge-disableTypeChecked][] | 🔧  | 💡  | 💭  |     |\n\n### No Other Paradigms\n\n| Name                                                       | Description                                                               | 💼                                   | ⚠️  | 🚫                            | 🔧  | 💡  | 💭  | ❌  |\n| :--------------------------------------------------------- | :------------------------------------------------------------------------ | :----------------------------------- | :-- | :---------------------------- | :-- | :-- | :-- | :-- |\n| [no-class-inheritance](docs/rules/no-class-inheritance.md) | Disallow inheritance in classes.                                          | ☑️ ✅ 🔒 ![badge-noOtherParadigms][] |     |                               |     |     |     |     |\n| [no-classes](docs/rules/no-classes.md)                     | Disallow classes.                                                         | ✅ 🔒 ![badge-noOtherParadigms][]    |     | ☑️                            |     |     |     |     |\n| [no-mixed-types](docs/rules/no-mixed-types.md)             | Restrict types so that only members of the same kind are allowed in them. | ☑️ ✅ 🔒 ![badge-noOtherParadigms][] |     | ![badge-disableTypeChecked][] |     |     | 💭  |     |\n| [no-this-expressions](docs/rules/no-this-expressions.md)   | Disallow this access.                                                     | 🔒 ![badge-noOtherParadigms][]       |     | ☑️ ✅                         |     |     |     |     |\n\n### No Statements\n\n| Name                                                                 | Description                                    | 💼                               | ⚠️  | 🚫                               | 🔧  | 💡  | 💭  | ❌  |\n| :------------------------------------------------------------------- | :--------------------------------------------- | :------------------------------- | :-- | :------------------------------- | :-- | :-- | :-- | :-- |\n| [no-conditional-statements](docs/rules/no-conditional-statements.md) | Disallow conditional statements.               | ✅ 🔒 ![badge-noStatements][]    |     | ☑️ ![badge-disableTypeChecked][] |     |     | 💭  |     |\n| [no-expression-statements](docs/rules/no-expression-statements.md)   | Disallow expression statements.                | ✅ 🔒 ![badge-noStatements][]    |     | ☑️ ![badge-disableTypeChecked][] |     |     | 💭  |     |\n| [no-loop-statements](docs/rules/no-loop-statements.md)               | Disallow imperative loops.                     | ☑️ ✅ 🔒 ![badge-noStatements][] |     |                                  |     |     |     |     |\n| [no-return-void](docs/rules/no-return-void.md)                       | Disallow functions that don't return anything. | ☑️ ✅ 🔒 ![badge-noStatements][] |     | ![badge-disableTypeChecked][]    |     |     | 💭  |     |\n\n### Stylistic\n\n| Name                                                                   | Description                                                            | 💼  | ⚠️  | 🚫                            | 🔧  | 💡  | 💭  | ❌  |\n| :--------------------------------------------------------------------- | :--------------------------------------------------------------------- | :-- | :-- | :---------------------------- | :-- | :-- | :-- | :-- |\n| [prefer-property-signatures](docs/rules/prefer-property-signatures.md) | Prefer property signatures over method signatures.                     | 🎨  |     | ![badge-disableTypeChecked][] |     |     | 💭  |     |\n| [prefer-tacit](docs/rules/prefer-tacit.md)                             | Replaces `x =\u003e f(x)` with just `f`.                                    |     | 🎨  | ![badge-disableTypeChecked][] |     | 💡  | 💭  |     |\n| [readonly-type](docs/rules/readonly-type.md)                           | Require consistently using either `readonly` keywords or `Readonly\u003cT\u003e` | 🎨  |     | ![badge-disableTypeChecked][] | 🔧  |     | 💭  |     |\n\n\u003c!-- end auto-generated rules list --\u003e\n\u003c!-- markdownlint-restore --\u003e\n\n[badge-currying]: https://img.shields.io/badge/-currying-red.svg\n[badge-noExceptions]: https://img.shields.io/badge/-noExceptions-blue.svg\n[badge-noMutations]: https://img.shields.io/badge/-noMutations-orange.svg\n[badge-noOtherParadigms]: https://img.shields.io/badge/-noOtherParadigms-yellow.svg\n[badge-noStatements]: https://img.shields.io/badge/-noStatements-purple.svg\n[badge-disableTypeChecked]: https://img.shields.io/badge/-disableTypeChecked-navy.svg\n\n## External Recommended Rules\n\nIn addition to the above rules, there are a few other rules we recommended.\n\nThese rules are what are included in the _external recommended_ rulesets.\n\n### Vanilla Rules\n\n- [no-var](https://eslint.org/docs/rules/no-var)\\\n  Without this rule, it is still possible to create mutable `var` variables.\n\n- [no-param-reassign](https://eslint.org/docs/rules/no-param-reassign)\\\n  Don't allow function parameters to be reassigned, they should be treated as constants.\n\n- [prefer-const](https://eslint.org/docs/rules/prefer-const)\\\n  This rule provides a helpful fixer when converting from an imperative code style to a functional one.\n\n### TypeScript Rules\n\n- [@typescript-eslint/prefer-readonly](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-readonly.mdx)\\\n  This rule is helpful when working with classes.\n\n- [@typescript-eslint/switch-exhaustiveness-check](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.mdx)\\\n  Although our [no-conditional-statements](./docs/rules/no-conditional-statements.md) rule also performs this check,\n  this rule has a fixer that will implement the unimplemented cases which can be useful.\n\n## Contributing\n\n[See our contributing guide](./CONTRIBUTING.md).\n\n## Prior work\n\nThis project started as a port of [tslint-immutable](https://github.com/jonaskello/tslint-immutable)\nwhich was originally inspired by [eslint-plugin-immutable](https://github.com/jhusain/eslint-plugin-immutable).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feslint-functional%2Feslint-plugin-functional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feslint-functional%2Feslint-plugin-functional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feslint-functional%2Feslint-plugin-functional/lists"}