tslint-immutable
Advanced tools
Comparing version 2.1.1 to 3.0.0
@@ -7,7 +7,20 @@ # Change Log | ||
## [2.1.1] - 2017-03-29 | ||
## [Unreleased] | ||
### Added | ||
### Changed | ||
## [v3.0.0] - 2017-04-02 | ||
### Changed | ||
- Upgraded to tslint 5.0.0 | ||
### Added | ||
- readonly-array now also checks for implicit arrays. | ||
## [v2.1.1] - 2017-03-29 | ||
### Fixed | ||
- Remove vestigial `noMutationRule.js` and `no-mutation` example from README, thanks to @pmlamotte. (see #6) | ||
- Remove vestigial `noMutationRule.js` and `no-mutation` example from README, thanks to [@pmlamotte](https://github.com/pmlamotte). (see [#6](https://github.com/jonaskello/tslint-immutable/pull/6)) | ||
## [2.1.0] - 2016-12-12 | ||
## [v2.1.0] - 2016-12-12 | ||
### Added | ||
@@ -19,3 +32,3 @@ - `readonly-indexer` rule. | ||
## [2.0.0] - 2016-12-12 | ||
## [v2.0.0] - 2016-12-12 | ||
### Added | ||
@@ -36,3 +49,3 @@ - `readonly-interface` rule. | ||
## [1.0.0] - 2016-12-10 | ||
## v1.0.0 - 2016-12-10 | ||
### Added | ||
@@ -43,1 +56,7 @@ - `no-expression-statement` rule. | ||
- `no-this` rule. | ||
[Unreleased]: https://github.com/jonaskello/tslint-immutable/compare/v2.1.2...master | ||
[v2.1.2]: https://github.com/jonaskello/tslint-immutable/compare/v2.1.1...v2.1.2 | ||
[v2.1.1]: https://github.com/jonaskello/tslint-immutable/compare/v2.1.0...v2.1.1 | ||
[v2.1.0]: https://github.com/jonaskello/tslint-immutable/compare/v2.0.0...v2.1.0 | ||
[v2.0.0]: https://github.com/jonaskello/tslint-immutable/compare/v1.0.0...v2.0.0 |
{ | ||
"name": "tslint-immutable", | ||
"version": "2.1.1", | ||
"version": "3.0.0", | ||
"description": "TSLint rules to disable mutation in TypeScript.", | ||
@@ -21,26 +21,15 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@types/chai": "^3.4.34", | ||
"@types/mocha": "^2.2.40", | ||
"@types/node": "^6.0.46", | ||
"chai": "^3.5.0", | ||
"codecov": "^2.1.0", | ||
"mocha": "^3.2.0", | ||
"nyc": "^10.2.0", | ||
"shelljs": "^0.7.5", | ||
"tslint": "^4.0.2", | ||
"typescript": "^2.0.6" | ||
"tslint": "^5.0.0", | ||
"typescript": "^2.2.2" | ||
}, | ||
"scripts": { | ||
"tsc": "tsc", | ||
"build": "tsc -p tsconfig.prod.json", | ||
"test:unit": "rm -rf js_out_test && yarn run tsc && mocha --compilers ts:ts-node/register \"tests/**/*.ts\"", | ||
"test": "nyc --include src/**/*.ts -e '.ts' --r html -r lcov -r text yarn test:unit", | ||
"report-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", | ||
"build": "rm -rf rules && tsc -p tsconfig.json", | ||
"test": "yarn build && yarn test:rules", | ||
"test:rules": "./scripts/test-rules.sh", | ||
"publish:major": "npm run build && node scripts/publish.js major", | ||
"publish:minor": "npm run build && node scripts/publish.js minor", | ||
"publish:patch": "npm run build && node scripts/publish.js patch" | ||
}, | ||
"dependencies": { | ||
"ts-node": "^3.0.2" | ||
} | ||
} | ||
} |
@@ -5,3 +5,2 @@ # tslint-immutable | ||
[![travis build][travis-image]][travis-url] | ||
[![codecov coverage][codecov-image]][codecov-url] | ||
[![MIT license][license-image]][license-url] | ||
@@ -11,4 +10,2 @@ | ||
> NOTE: tslint-immutable >= 2.0.0 is compatible with tslint >= 4.0.0. For older versions that is compatible with older tslint versions please check the [v1](https://github.com/jonaskello/tslint-immutable/tree/v1) branch. | ||
## Background | ||
@@ -28,2 +25,8 @@ | ||
## Compability | ||
* tslint-immutable 3.x.x is compatible with tslint 5.x.x. | ||
* tslint-immutable 2.x.x is compatible with tslint 4.x.x. | ||
* tslint-immutable 1.x.x is compatible with tslint 3.x.x. | ||
## TSLint Rules | ||
@@ -215,5 +218,3 @@ | ||
[travis-url]: https://travis-ci.org/jonaskello/tslint-immutable | ||
[codecov-image]: https://img.shields.io/codecov/c/github/jonaskello/tslint-immutable/master.svg?style=flat | ||
[codecov-url]: https://codecov.io/gh/jonaskello/tslint-immutable/branch/master | ||
[license-image]: https://img.shields.io/github/license/jonaskello/tslint-immutable.svg?style=flat | ||
[license-url]: https://opensource.org/licenses/MIT |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Lint = require("tslint"); | ||
@@ -11,3 +17,3 @@ var Rule = (function (_super) { | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function ImportsContainmentWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -83,3 +89,3 @@ ImportsContainmentWalker.prototype.visitImportDeclaration = function (node) { | ||
} | ||
return null; | ||
return undefined; | ||
} | ||
@@ -89,6 +95,6 @@ function getMyOptions(options) { | ||
if (!myOptions) | ||
return null; | ||
return undefined; | ||
var containmentPath = myOptions.containmentPath, allowedExternalFileNames = myOptions.allowedExternalFileNames, disallowedInternalFileNames = myOptions.disallowedInternalFileNames; | ||
if (!containmentPath) | ||
return null; | ||
return undefined; | ||
return { | ||
@@ -110,3 +116,3 @@ containmentPath: containmentPath, | ||
} | ||
return null; | ||
return undefined; | ||
} | ||
@@ -113,0 +119,0 @@ // Calculate how many levels below [path] that [subPath] resides |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function NoArgumentsWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -29,0 +35,0 @@ NoArgumentsWalker.prototype.visitNode = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function NoClassWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -29,0 +35,0 @@ NoClassWalker.prototype.visitNode = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function NoExpressionStatementWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -29,0 +35,0 @@ NoExpressionStatementWalker.prototype.visitNode = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function NoLabelsWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -29,0 +35,0 @@ NoLabelsWalker.prototype.visitNode = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function NoLetKeywordWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -29,0 +35,0 @@ NoLetKeywordWalker.prototype.visitVariableStatement = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Lint = require("tslint"); | ||
@@ -11,3 +17,3 @@ var Rule = (function (_super) { | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -25,3 +31,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function PropertyInterfaceWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -28,0 +34,0 @@ PropertyInterfaceWalker.prototype.visitInterfaceDeclaration = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function NoNewWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -29,0 +35,0 @@ NoNewWalker.prototype.visitNode = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function SemicolonInterfaceWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -29,0 +35,0 @@ SemicolonInterfaceWalker.prototype.visitInterfaceDeclaration = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function NoThisWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -29,0 +35,0 @@ NoThisWalker.prototype.visitNode = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function ReadonlyArrayWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -35,2 +41,13 @@ ReadonlyArrayWalker.prototype.visitTypeReference = function (node) { | ||
}; | ||
ReadonlyArrayWalker.prototype.visitArrayLiteralExpression = function (node) { | ||
_super.prototype.visitArrayLiteralExpression.call(this, node); | ||
// If the array literal is used in a variable declaration, the variable | ||
// must have a type spcecified, otherwise it will implicitly be of mutable Array type | ||
if (node.parent && node.parent.kind === ts.SyntaxKind.VariableDeclaration) { | ||
var variableDeclarationNode = node.parent; | ||
if (!variableDeclarationNode.type) { | ||
this.addFailure(this.createFailure(variableDeclarationNode.name.getStart(), variableDeclarationNode.name.getWidth(), Rule.FAILURE_STRING)); | ||
} | ||
} | ||
}; | ||
ReadonlyArrayWalker.prototype.visitTypeLiteral = function (node) { | ||
@@ -37,0 +54,0 @@ _super.prototype.visitTypeLiteral.call(this, node); |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -26,3 +32,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function ReadonlyIndexerWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -29,0 +35,0 @@ ReadonlyIndexerWalker.prototype.visitIndexSignatureDeclaration = function (node) { |
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
@@ -12,3 +18,3 @@ var Lint = require("tslint"); | ||
function Rule() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -27,3 +33,3 @@ Rule.prototype.apply = function (sourceFile) { | ||
function ReadonlyInterfaceWalker() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -36,2 +42,15 @@ ReadonlyInterfaceWalker.prototype.visitInterfaceDeclaration = function (node) { | ||
} | ||
// interface Foo { | ||
// readonly bar: number, | ||
// readonly zoo: () => string | ||
// readonly loo: Array<string>, | ||
// readonly <T1>(): Array<T1> | ||
// } | ||
// let f: Foo; | ||
// f.zoo = () => ""; | ||
// console.log("member.type", (member as any).type); | ||
// | ||
// if (member.kind === ts.SyntaxKind.ArrayType) { | ||
// this.addFailure(this.createFailure(member.getStart(), member.getWidth(), Rule.FAILURE_STRING_ARRAY)); | ||
// } | ||
} | ||
@@ -38,0 +57,0 @@ _super.prototype.visitInterfaceDeclaration.call(this, node); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
0
3
47
217
57151
818
1
- Removedts-node@^3.0.2
- Removedansi-styles@3.2.1(transitive)
- Removedarrify@1.0.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removeddiff@3.5.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhomedir-polyfill@1.0.3(transitive)
- Removedmake-error@1.3.6(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedparse-passwd@1.0.0(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-support@0.4.18(transitive)
- Removedstrip-bom@3.0.0(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedts-node@3.3.0(transitive)
- Removedtsconfig@6.0.0(transitive)
- Removedv8flags@3.2.0(transitive)
- Removedyn@2.0.0(transitive)