tslint-immutable
Advanced tools
Comparing version 4.8.0 to 4.9.0
@@ -10,2 +10,8 @@ # Change Log | ||
## [v4.9.0] - 2018-11-01 | ||
### Added | ||
* New option `ignore-return-type` for the `readonly-array` rule. See [#82](https://github.com/jonaskello/tslint-immutable/issues/82). Thanks to [@RebeccaStevens](https://github.com/RebeccaStevens) for adding this option! (See PR [#95](https://github.com/jonaskello/tslint-immutable/pull/95)) | ||
## [v4.8.0] - 2018-10-07 | ||
@@ -280,3 +286,4 @@ | ||
[unreleased]: https://github.com/jonaskello/tslint-immutable/compare/v4.8.0...master | ||
[unreleased]: https://github.com/jonaskello/tslint-immutable/compare/v4.9.0...master | ||
[v4.9.0]: https://github.com/jonaskello/tslint-immutable/compare/v4.8.0...v4.9.0 | ||
[v4.8.0]: https://github.com/jonaskello/tslint-immutable/compare/v4.7.0...v4.8.0 | ||
@@ -283,0 +290,0 @@ [v4.7.0]: https://github.com/jonaskello/tslint-immutable/compare/v4.6.0...v4.7.0 |
{ | ||
"name": "tslint-immutable", | ||
"version": "4.8.0", | ||
"version": "4.9.0", | ||
"description": "TSLint rules to disable mutation in TypeScript.", | ||
@@ -5,0 +5,0 @@ "main": "tslint-immutable.json", |
@@ -171,3 +171,4 @@ # tslint-immutable | ||
- [ignore-prefix](#using-the-ignore-prefix-option) | ||
- [ignore-rest-parameters](#using-the-ignore-rest-parameters) | ||
- [ignore-return-type](#using-the-ignore-return-type-option) | ||
- [ignore-rest-parameters](#using-the-ignore-rest-parameters-option) | ||
@@ -488,4 +489,9 @@ #### Example config | ||
### Using the `ignore-rest-parameters` option | ||
Doesn't check for `ReadonlyArray` for function rest parameters. | ||
### Using the `ignore-return-type` option | ||
Doesn't check the return type of functions. | ||
### Using the `ignore-prefix` option | ||
@@ -492,0 +498,0 @@ |
@@ -27,2 +27,5 @@ "use strict"; | ||
} | ||
if (ctx.options.ignoreReturnType && checkIsReturnType(node)) { | ||
return []; | ||
} | ||
return [ | ||
@@ -45,2 +48,5 @@ check_node_1.createInvalidNode(node, [ | ||
} | ||
if (ctx.options.ignoreReturnType && checkIsReturnType(node)) { | ||
return []; | ||
} | ||
return [ | ||
@@ -91,2 +97,10 @@ check_node_1.createInvalidNode(node, [ | ||
} | ||
function checkIsReturnType(node) { | ||
return Boolean(node.parent !== undefined && | ||
(node.parent.kind === ts.SyntaxKind.FunctionDeclaration || | ||
node.parent.kind === ts.SyntaxKind.FunctionExpression || | ||
node.parent.kind === ts.SyntaxKind.ArrowFunction) && | ||
node === | ||
node.parent.type); | ||
} | ||
//# sourceMappingURL=readonlyArrayRule.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
639526
1923
643