Socket
Socket
Sign inDemoInstall

eslint-plugin-functional

Package Overview
Dependencies
215
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-rc.2 to 1.0.0

4

CHANGELOG.md

@@ -10,2 +10,6 @@ # Changelog

### Changed
- Rename the "No mutability" heading and "immutable" ruleset to "no-mutations". [`#62`](https://github.com/jonaskello/eslint-plugin-functional/pull/62)
## [v1.0.0-rc.2](https://github.com/jonaskello/eslint-plugin-functional/compare/v1.0.0-rc.1...v1.0.0-rc.2) - 2019-08-07

@@ -12,0 +16,0 @@

34

lib/index.js

@@ -360,5 +360,5 @@ 'use strict';

return (getParentOfType(function (n) {
return (n.parent != undefined &&
return n.parent != undefined &&
isFunctionLike(n.parent) &&
n.parent.returnType === n);
n.parent.returnType === n;
}, node) !== null);

@@ -543,7 +543,7 @@ }

*
* - IgnoreAccessorPatternOption
* - IgnoreClassOption
* - IgnoreInterfaceOption
* - IgnorePatternOption
* - AllowLocalMutationOption
* - IgnoreAccessorPatternOption.
* - IgnoreClassOption.
* - IgnoreInterfaceOption.
* - IgnorePatternOption.
* - AllowLocalMutationOption.
*/

@@ -574,3 +574,3 @@ function shouldIgnore(node, context, options) {

const version = "1.0.0-rc.1";
const version = "1.0.0-rc.2";

@@ -1778,8 +1778,7 @@ // This function can't be functional as it needs to interact with 3rd-party

return isAssignmentPattern(param)
? /* eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion */
{
id: param.left,
init: param.right,
node: param
}
? {
id: param.left,
init: param.right,
node: param
}
: undefined;

@@ -1789,3 +1788,2 @@ })

: node.declarations.map(function (declaration) {
/* eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion */
return ({

@@ -1926,9 +1924,9 @@ id: declaration.id,

all: config,
currying: config$2,
immutable: config$3,
recommended: config$7,
lite: config$8,
"no-mutations": config$3,
"no-exceptions": config$4,
"no-object-orientation": config$5,
"no-statements": config$6,
recommended: config$7
currying: config$2
}

@@ -1935,0 +1933,0 @@ };

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

@@ -52,8 +52,8 @@ "main": "lib/index.js",

"@types/node": "^8.10.49",
"@typescript-eslint/eslint-plugin": "^1.11.0",
"@typescript-eslint/parser": "^1.11.0",
"@typescript-eslint/eslint-plugin": "^2.3.1",
"@typescript-eslint/parser": "^2.3.1",
"babel-eslint": "^10.0.2",
"codecov": "^3.5.0",
"dedent": "^0.7.0",
"eslint": "^6.0.1",
"eslint": "^6.5.0",
"eslint-config-prettier": "^6.0.0",

@@ -82,3 +82,3 @@ "eslint-plugin-eslint-plugin": "^2.1.0",

"peerDependencies": {
"eslint": ">=6.0.0",
"eslint": "^5.0.0 || ^6.0.0",
"typescript": ">=3.4.1"

@@ -93,7 +93,7 @@ },

"compile": "rollup -c",
"compile-tests": "tsc -p tsconfig.tests.json",
"compile-tests": "tsc -p tsconfig.tests.json && cp ./tests/helpers/tsconfig.json ./build/tests/helpers/",
"build-tests": "rimraf build && yarn compile-tests",
"build": "rimraf lib && yarn compile",
"prelint": "yarn build && yarn link && yarn link 'eslint-plugin-functional'",
"lint": "eslint './{src,tests}/**/*.ts' --ext .ts",
"lint": "eslint './{src,tests}/**/*.ts' --ext .ts -f visualstudio",
"test": "jest --testPathIgnorePatterns _work.test",

@@ -100,0 +100,0 @@ "test-work": "jest tests/rules/_work.test.ts",

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

- [No mutability](#no-mutability)
- [No mutations](#no-mutations)
- [No object-orientation](#no-object-orientation)

@@ -26,3 +26,3 @@ - [No statements](#no-statements)

### No mutability
### No mutations

@@ -125,12 +125,12 @@ In some applications it is important to not mutate any data, for example when using Redux to store state in a React application. Moreover immutable data structures has a lot of advantages in general so I want to use them everywhere in my applications.

### Immutability Rules
### No Mutations Rules
:see_no_evil: = `immutable` Ruleset.
:see_no_evil: = `no-mutations` Ruleset.
| Name | Description | <span title="Immutable">:see_no_evil:</span> | <span title="Lite">:hear_no_evil:</span> | <span title="Recommended">:speak_no_evil:</span> | :wrench: | :blue_heart: |
| -------------------------------------------------------------- | -------------------------------------------------------------------------- | :------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :---------------: |
| [`prefer-readonly-type`](./docs/rules/prefer-readonly-type.md) | Use readonly types and readonly modifiers where possible | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :wrench: | :thought_balloon: |
| [`no-let`](./docs/rules/no-let.md) | Disallow mutable variables | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`immutable-data`](./docs/rules/immutable-data.md) | Disallow mutating objects and arrays | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :blue_heart: |
| [`no-method-signature`](./docs/rules/no-method-signature.md) | Enforce property signatures with readonly modifiers over method signatures | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :thought_balloon: |
| Name | Description | <span title="No Mutations">:see_no_evil:</span> | <span title="Lite">:hear_no_evil:</span> | <span title="Recommended">:speak_no_evil:</span> | :wrench: | :blue_heart: |
| -------------------------------------------------------------- | -------------------------------------------------------------------------- | :---------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :---------------: |
| [`immutable-data`](./docs/rules/immutable-data.md) | Disallow mutating objects and arrays | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :blue_heart: |
| [`no-let`](./docs/rules/no-let.md) | Disallow mutable variables | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`no-method-signature`](./docs/rules/no-method-signature.md) | Enforce property signatures with readonly modifiers over method signatures | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :thought_balloon: |
| [`prefer-readonly-type`](./docs/rules/prefer-readonly-type.md) | Use readonly types and readonly modifiers where possible | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :wrench: | :thought_balloon: |

@@ -143,5 +143,5 @@ ### No Object-Orientation Rules

| ------------------------------------------------------------ | ------------------------------------------------------------------------ | :------------------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :---------------: |
| [`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: | | |
| [`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: |
| [`no-this-expression`](./docs/rules/no-this-expression.md) | Disallow `this` access | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`prefer-type-literal`](./docs/rules/prefer-type-literal.md) | Use type literals over interfaces | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :thought_balloon: |

@@ -155,4 +155,4 @@

| ---------------------------------------------------------------------- | ---------------------------------------------------------- | :----------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :---------------: |
| [`no-conditional-statement`](./docs/rules/no-conditional-statement.md) | Disallow conditional statements (if and switch statements) | :heavy_check_mark: | | :heavy_check_mark: | | |
| [`no-expression-statement`](./docs/rules/no-expression-statement.md) | Disallow expressions to cause side-effects | :heavy_check_mark: | | :heavy_check_mark: | | |
| [`no-conditional-statement`](./docs/rules/no-conditional-statement.md) | Disallow conditional statements (if and switch statements) | :heavy_check_mark: | | :heavy_check_mark: | | |
| [`no-loop-statement`](./docs/rules/no-loop-statement.md) | Disallow imperative loops | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |

@@ -167,5 +167,5 @@ | [`no-return-void`](./docs/rules/no-return-void.md) | Disallow function that return nothing | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :thought_balloon: |

| ---------------------------------------------------------- | ----------------------------------------------------- | :----------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :----------: |
| [`no-promise-reject`](./docs/rules/no-promise-reject.md) | Disallow rejecting Promises | | | | | |
| [`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 | | | | | |

@@ -172,0 +172,0 @@ ### Currying Rules

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc