Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-functional

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-functional - npm Package Compare versions

Comparing version 0.5.3 to 1.0.0-rc.1

2

package.json
{
"name": "eslint-plugin-functional",
"version": "0.5.3",
"version": "1.0.0-rc.1",
"description": "ESLint rules to disable mutation and promote fp in TypeScript.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -29,3 +29,3 @@ # eslint-plugin-functional

I originally used [immutablejs](https://github.com/facebook/immutable-js/) for this purpose. It is a really nice library but I found it had some drawbacks. Specifically when debugging it was hard to see the structure, creating JSON was not straightforward, and passing parameters to other libraries required converting to regular mutable arrays and objects. The [seamless-immutable](https://github.com/rtfeldman/seamless-immutable) project seems to have the same conclusions and they use regular objects and arrays and check for immutability at run-time. This solves all the aformentioned drawbacks but introduces a new drawback of only being enforced at run-time. (Altough you loose the structural sharing feature of immutablejs with this solution so you would have to consider if that is something you need).
I originally used [immutablejs](https://github.com/facebook/immutable-js/) for this purpose. It is a really nice library but I found it had some drawbacks. Specifically when debugging it was hard to see the structure, creating JSON was not straightforward, and passing parameters to other libraries required converting to regular mutable arrays and objects. The [seamless-immutable](https://github.com/rtfeldman/seamless-immutable) project seems to have the same conclusions and they use regular objects and arrays and check for immutability at run-time. This solves all the aformentioned drawbacks but introduces a new drawback of only being enforced at run-time. (Altough you lose the structural sharing feature of immutablejs with this solution so you would have to consider if that is something you need).

@@ -141,3 +141,3 @@ Then TypeScript 2.0 came along and introduced [readonly](https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#read-only-properties-and-index-signatures) options for properties, indexers and arrays. TypeScript 3.0 has continued to add support immutability enforcing syntax. This enables us to use regular object and arrays and have the immutability enforced at compile time instead of run-time. Now the only drawback is that there is nothing enforcing the use of readonly in TypeScript.

| ------------------------------------------------------------ | ------------------------------------------------------------------------ | :------------------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :---------------: |
| [`no-this`](./docs/rules/no-this.md) | Disallow `this` access | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`no-this-expression`](./docs/rules/no-this-expression.md) | Disallow `this` access | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`no-class`](./docs/rules/no-class.md) | Disallow classes | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |

@@ -162,7 +162,7 @@ | [`no-mixed-type`](./docs/rules/no-mixed-type.md) | Restrict types so that only members of the same kind are allowed in them | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :thought_balloon: |

| Name | Description | <span title="No Exceptions">:see_no_evil:</span> | <span title="Lite">:hear_no_evil:</span> | <span title="Recommended">:speak_no_evil:</span> | :wrench: | :blue_heart: |
| ---------------------------------------- | ----------------------------------------------------- | :----------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :----------: |
| [`no-throw`](./docs/rules/no-throw.md) | Disallow throwing exceptions | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`no-try`](./docs/rules/no-try.md) | Disallow try-catch[-finally] and try-finally patterns | :heavy_check_mark: | | :heavy_check_mark: | | |
| [`no-reject`](./docs/rules/no-reject.md) | Disallow rejecting Promises | | | | | |
| Name | Description | <span title="No Exceptions">:see_no_evil:</span> | <span title="Lite">:hear_no_evil:</span> | <span title="Recommended">:speak_no_evil:</span> | :wrench: | :blue_heart: |
| ---------------------------------------------------------- | ----------------------------------------------------- | :----------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :----------: |
| [`no-throw-statement`](./docs/rules/no-throw-statement.md) | Disallow throwing exceptions | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`no-try-statement`](./docs/rules/no-try-statement.md) | Disallow try-catch[-finally] and try-finally patterns | :heavy_check_mark: | | :heavy_check_mark: | | |
| [`no-promise-reject`](./docs/rules/no-promise-reject.md) | Disallow rejecting Promises | | | | | |

@@ -199,3 +199,3 @@ ### Currying Rules

```javascript
```js
function foo() {

@@ -202,0 +202,0 @@ return [1, 2, 3];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc