{"name":"eslint-plugin-functional","version":"5.0.5","keywords":["eslint","eslint plugin","fp","functional","functional programming","immutability","immutable"],"author":{"name":"Rebecca Stevens","email":"rebecca.stevens@outlook.co.nz"},"license":"MIT","_id":"eslint-plugin-functional@5.0.5","maintainers":[{"name":"jonaskello","email":"jonas.kello@gmail.com"},{"name":"rebeccastevens","email":"rebecca.stevens@outlook.co.nz"}],"contributors":[{"name":"Jonas Kello"}],"homepage":"https://github.com/eslint-functional/eslint-plugin-functional#readme","bugs":{"url":"https://github.com/eslint-functional/eslint-plugin-functional/issues"},"dist":{"shasum":"348654c25f2a8229f50f7c02de1b808136050269","tarball":"http://registry-npm.ywwl.com/eslint-plugin-functional/download/eslint-plugin-functional-5.0.5.tgz","fileCount":5,"integrity":"sha512-KUrONL/t9cByc+H/2xSUmyew/rJ7+ejLaqz3+y0dFkxNIBgyoeonB78THsozlRGsMr0gP+bLyWxyOREl6l6dkA==","signatures":[{"sig":"MEYCIQCN559ctyPRLowG6Zqbn6WVxfpIWH4WU1uqzxhc3aRYcwIhAPVubARwZOhXzPBFO6R/slsVcMZYkeeYdHTqR1DKKroA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":283473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBsnfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8YhAAnB15mA4WzLKtD2UIe33269gvQnUsrl4TzPyrJgFo7O2Oqg8d\r\ng2DF2sV/5GBqI8hRG7eH92TrdmOXdH1Iv0AZSYb4dfCS8bF8GWABqL6Oiqhh\r\nFosXrRf3ny8JXTLp3DN0bMJHgALCikteea/SM0G1Osra+Q1w0lgmBhCAE9bx\r\nG4Ov8716HxWBrvANQbXGQ+DkcKqzpjYZ5yM2ZZlOA17PXabLOHVRLgmnFofv\r\nLwjvLM4CRKrKieoOaqNfcZJLp1cHEwVS1I94IqWGGmGRpbgU+/doJ/7Gly5P\r\n1Or8STjqY2nFBkwfrBlUCpoWjB2pKg3gqEIgh3fXSdm8WEL2BC7wSwEh0hFe\r\nyVtEXCbN91B/cEfmAs1CGeCIXFeuPNHnd0eDbQg3CaBuOvzvjlHHlqqRVAS+\r\nr/kYv7o2PAZExX+qxgq0d8gfFv4igueKHzr3oUeXSbZPY6Z2g4j9pTNLJe/+\r\nJxr+mbTIjPrRUtpljVCt81UYQKSPXE/Kvccy+At5kVGgS+EwflANsU51OOKa\r\no+FQW96ZmN4JIi/vz3Jlqk4VgJc8nu8THdaoe0hQ5sje1BFsbdwcRfOjM38C\r\nd1MHwSlt4QgoLMenu25jUkEwsprK49uUHLjvXxAPVkikS8XGYixF25n8Rm36\r\noa8dGVwDmatdWD00//kb1fYyk6lEOq6aFjc=\r\n=7a6r\r\n-----END PGP SIGNATURE-----\r\n","size":45695,"noattachment":false,"key":"/eslint-plugin-functional/-/eslint-plugin-functional-5.0.5.tgz"},"main":"lib/index.js","engines":{"node":">=16.10.0"},"exports":{"import":"./lib/index.mjs","default":"./lib/index.js","require":"./lib/index.js"},"funding":[{"url":"https://ko-fi.com/rebeccastevens","type":"ko-fi"}],"gitHead":"df3f078d67ba8fa96ebf2b7dd67363b3d1e1db91","scripts":{"cz":"git-cz","lint":"pnpm run build && pnpm run lint:js && pnpm run lint:md && pnpm lint:eslint-docs && pnpm run lint:knip && pnpm run lint:spelling","test":"pnpm run test:js","build":"pnpm run build:node && pnpm run build:docs","format":"prettier \"**/*\" --ignore-unknown","verify":"pnpm run lint && pnpm run type-check && pnpm run build-tests && pnpm run test-compiled && rimraf build","lint:js":"eslint .","lint:md":"markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore","prepare":"husky install","test:js":"nyc ava","lint:knip":"knip --config knip.jsonc --production --exclude exports","test-work":"ONLY_TEST_WORK_FILE=1 ava","build:docs":"eslint-doc-generator","build:node":"rimraf lib && rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript","type-check":"tsc --noEmit --skipLibCheck","build-tests":"rimraf build && ts-node -P scripts/tsconfig.json scripts/compile-tests.mts","format:write":"pnpm run format --write","lint:spelling":"cspell \"**\" \".github/**/*\"","test-compiled":"USE_COMPILED_TESTS=1 nyc ava","lint:eslint-docs":"eslint-doc-generator --check"},"_npmUser":{"name":"rebeccastevens","email":"rebecca.stevens@outlook.co.nz"},"repository":{"url":"git+https://github.com/eslint-functional/eslint-plugin-functional.git","type":"git"},"_npmVersion":"9.5.0","description":"ESLint rules to disable mutation and promote fp in TypeScript.","directories":{},"_nodeVersion":"19.7.0","dependencies":{"semver":"^7.3.8","deepmerge-ts":"^4.2.2","is-immutable-type":"^1.2.4","escape-string-regexp":"^4.0.0","@typescript-eslint/utils":"^5.50.0","@typescript-eslint/type-utils":"^5.50.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@7.29.0","devDependencies":{"ava":"5.2.0","nyc":"15.1.0","knip":"^1.14.1","chalk":"4.1.2","husky":"8.0.3","tslib":"2.5.0","cspell":"6.28.0","dedent":"0.7.0","eslint":"8.35.0","espree":"9.4.1","rimraf":"4.3.1","rollup":"3.18.0","codecov":"3.8.2","ts-node":"10.9.1","prettier":"2.8.4","tsc-prog":"2.2.1","word-wrap":"1.2.3","commitizen":"4.3.0","typescript":"4.9.5","@babel/core":"^7.21.0","@types/node":"16.18.14","json-schema":"0.4.0","lint-staged":"13.1.2","jsonc-parser":"3.2.0","@types/dedent":"0.7.0","@types/eslint":"8.21.1","@types/estree":"1.0.0","@types/semver":"7.3.13","tsconfig-paths":"4.1.2","@ava/typescript":"3.0.1","@commitlint/cli":"17.4.4","markdownlint-cli":"0.33.0","semantic-release":"20.1.1","eslint-plugin-ava":"14.0.0","@types/json-schema":"^7.0.11","eslint-plugin-node":"11.1.0","@rollup/plugin-json":"6.0.0","eslint-plugin-jsdoc":"40.0.1","@babel/eslint-parser":"^7.19.1","eslint-doc-generator":"1.4.3","eslint-plugin-import":"2.27.5","@semantic-release/git":"10.0.1","@semantic-release/npm":"9.0.2","eslint-plugin-promise":"6.1.1","eslint-plugin-sonarjs":"0.18.0","eslint-plugin-unicorn":"46.0.0","eslint-ava-rule-tester":"4.0.0","eslint-config-prettier":"8.7.0","eslint-plugin-markdown":"3.0.0","eslint-plugin-prettier":"4.2.1","@rollup/plugin-commonjs":"24.0.1","@semantic-release/github":"8.0.7","@rollup/plugin-typescript":"11.0.0","@typescript-eslint/parser":"5.54.1","conventional-commit-types":"3.0.0","@rollup/plugin-node-resolve":"15.0.1","@semantic-release/changelog":"6.0.2","eslint-plugin-eslint-plugin":"5.0.8","prettier-plugin-packagejson":"2.4.3","rollup-plugin-auto-external":"2.0.0","eslint-plugin-optimize-regex":"1.2.1","@cspell/dict-cryptocurrencies":"3.0.1","@rebeccastevens/eslint-config":"1.5.2","eslint-plugin-eslint-comments":"3.2.0","@commitlint/config-conventional":"17.4.4","@typescript-eslint/eslint-plugin":"5.54.1","@istanbuljs/nyc-config-typescript":"1.0.2","@semantic-release/commit-analyzer":"9.0.2","eslint-import-resolver-typescript":"3.5.3","@types/rollup-plugin-auto-external":"2.0.2","@google/semantic-release-replace-plugin":"1.2.0","@semantic-release/release-notes-generator":"10.0.3"},"peerDependencies":{"eslint":"^8.0.0","typescript":">=4.0.2"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-functional_5.0.5_1678166494988_0.7345828840999984","host":"s3://npm-registry-packages"},"readme":"<div align=\"center\">\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</div>\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&utm_medium=referral&utm_campaign=enterprise&utm_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<!-- markdownlint-disable -->\n<!-- begin auto-generated rules list -->\n\n💼 Configurations enabled in.\\\n⚠️ Configurations set to warn in.\\\n🚫 Configurations disabled in.\\\n![badge-currying](https://img.shields.io/badge/-currying-red.svg) Set in the `currying` configuration.\\\n☑️ Set in the `lite` configuration.\\\n![badge-noExceptions](https://img.shields.io/badge/-noExceptions-blue.svg) Set in the `noExceptions` configuration.\\\n![badge-noMutations](https://img.shields.io/badge/-noMutations-orange.svg) Set in the `noMutations` configuration.\\\n![badge-noOtherParadigms](https://img.shields.io/badge/-noOtherParadigms-yellow.svg) Set in the `noOtherParadigms` configuration.\\\n![badge-noStatements](https://img.shields.io/badge/-noStatements-purple.svg) Set in the `noStatements` 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](https://img.shields.io/badge/-currying-red.svg) ☑️ ✅ 🔒 |     |     |     |     | 💭  |     |\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](https://img.shields.io/badge/-noExceptions-blue.svg) ✅ 🔒 |     |       |     |     | 💭  |     |\n| [no-try-statements](docs/rules/no-try-statements.md)     | Disallow try-catch[-finally] and try-finally patterns. | ![badge-noExceptions](https://img.shields.io/badge/-noExceptions-blue.svg) 🔒       |     | ☑️ ✅ |     |     |     |     |\n\n### No Mutations\n\n| Name                                                                         | Description                                                     | 💼                                                                                  | ⚠️  | 🚫  | 🔧  | 💡  | 💭  | ❌  |\n| :--------------------------------------------------------------------------- | :-------------------------------------------------------------- | :---------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | :-- |\n| [immutable-data](docs/rules/immutable-data.md)                               | Enforce treating data as immutable.                             | ☑️ ![badge-noMutations](https://img.shields.io/badge/-noMutations-orange.svg) ✅ 🔒 |     |     |     |     | 💭  |     |\n| [no-let](docs/rules/no-let.md)                                               | Disallow mutable variables.                                     | ☑️ ![badge-noMutations](https://img.shields.io/badge/-noMutations-orange.svg) ✅ 🔒 |     |     |     |     |     |     |\n| [prefer-immutable-types](docs/rules/prefer-immutable-types.md)               | Require function parameters to be typed as certain immutability | ☑️ ![badge-noMutations](https://img.shields.io/badge/-noMutations-orange.svg) ✅ 🔒 |     |     | 🔧  | 💡  | 💭  |     |\n| [prefer-readonly-type](docs/rules/prefer-readonly-type.md)                   | Prefer readonly types over mutable types.                       |                                                                                     |     |     | 🔧  |     | 💭  | ❌  |\n| [type-declaration-immutability](docs/rules/type-declaration-immutability.md) | Enforce the immutability of types based on patterns.            | ☑️ ![badge-noMutations](https://img.shields.io/badge/-noMutations-orange.svg) ✅ 🔒 |     |     | 🔧  | 💡  | 💭  |     |\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](https://img.shields.io/badge/-noOtherParadigms-yellow.svg) ✅ 🔒 |     |       |     |     |     |     |\n| [no-classes](docs/rules/no-classes.md)                     | Disallow classes.                                                         | ![badge-noOtherParadigms](https://img.shields.io/badge/-noOtherParadigms-yellow.svg) ✅ 🔒    |     | ☑️    |     |     |     |     |\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](https://img.shields.io/badge/-noOtherParadigms-yellow.svg) ✅ 🔒 |     |       |     |     | 💭  |     |\n| [no-this-expressions](docs/rules/no-this-expressions.md)   | Disallow this access.                                                     | ![badge-noOtherParadigms](https://img.shields.io/badge/-noOtherParadigms-yellow.svg) 🔒       |     | ☑️ ✅ |     |     |     |     |\n\n### No Statements\n\n| Name                                                                 | Description                                    | 💼                                                                                    | ⚠️  | 🚫  | 🔧  | 💡  | 💭  | ❌  |\n| :------------------------------------------------------------------- | :--------------------------------------------- | :------------------------------------------------------------------------------------ | :-- | :-- | :-- | :-- | :-- | :-- |\n| [no-conditional-statements](docs/rules/no-conditional-statements.md) | Disallow conditional statements.               | ![badge-noStatements](https://img.shields.io/badge/-noStatements-purple.svg) ✅ 🔒    |     | ☑️  |     |     | 💭  |     |\n| [no-expression-statements](docs/rules/no-expression-statements.md)   | Disallow expression statements.                | ![badge-noStatements](https://img.shields.io/badge/-noStatements-purple.svg) ✅ 🔒    |     | ☑️  |     |     | 💭  |     |\n| [no-loop-statements](docs/rules/no-loop-statements.md)               | Disallow imperative loops.                     | ☑️ ![badge-noStatements](https://img.shields.io/badge/-noStatements-purple.svg) ✅ 🔒 |     |     |     |     |     |     |\n| [no-return-void](docs/rules/no-return-void.md)                       | Disallow functions that don't return anything. | ☑️ ![badge-noStatements](https://img.shields.io/badge/-noStatements-purple.svg) ✅ 🔒 |     |     |     |     | 💭  |     |\n\n### Stylistic\n\n| Name                                                                   | Description                                                            | 💼  | ⚠️  | 🚫  | 🔧  | 💡  | 💭  | ❌  |\n| :--------------------------------------------------------------------- | :--------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | :-- | :-- |\n| [prefer-property-signatures](docs/rules/prefer-property-signatures.md) | Prefer property signatures over method signatures.                     | 🎨  |     |     |     |     | 💭  |     |\n| [prefer-tacit](docs/rules/prefer-tacit.md)                             | Replaces `x => f(x)` with just `f`.                                    |     | 🎨  |     |     | 💡  | 💭  |     |\n| [readonly-type](docs/rules/readonly-type.md)                           | Require consistently using either `readonly` keywords or `Readonly<T>` | 🎨  |     |     | 🔧  |     | 💭  |     |\n\n<!-- end auto-generated rules list -->\n<!-- markdownlint-restore -->\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","publish_time":1678166495133,"_cnpm_publish_time":1678166495133,"dist-tags":{"eslint-9-alpha":"7.0.0-alpha.12","latest":"10.0.1","next":"7.0.0-rc.1"}}