New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tslint-eslint-rules

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslint-eslint-rules - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

dist/readme/fetch.js

67

CHANGELOG.md
## Change Log
### v1.6.0 (2016/09/27 05:56 +00:00)
- [3f8dcc5](https://github.com/buzinas/tslint-eslint-rules/commit/3f8dcc5a2f5804243c86a47ba6dbfb4a2241d771) [feat] added the checkLoops option to the no-constant-condition rule (closes #92) (@buzinas)
- [8a98530](https://github.com/buzinas/tslint-eslint-rules/commit/8a985309a3c2c645fdd143ae893b026710fa8c01) [bug] fixed no-extra-boolean-cast inside binary expressions (closes #87) (@buzinas)
- [93de74b](https://github.com/buzinas/tslint-eslint-rules/commit/93de74b4d33bb4d6c32c047ac995dd57eb92648d) [bug] fixed no-ex-assign false positives (closes #54 and #89) (@buzinas)
- [f26559e](https://github.com/buzinas/tslint-eslint-rules/commit/f26559ed09e1aed9b8c31151b608a12627e776b3) [docs] fixed CRLF to LF (@buzinas)
- [28f94c6](https://github.com/buzinas/tslint-eslint-rules/commit/28f94c6f1be2ac4f9d066eb6586bdeeac88ef967) [bug] fix no constant conditions for increment/decrement (closes #86) (@buzinas)
- [#117](https://github.com/buzinas/tslint-eslint-rules/pull/117) Merge pull request #117 from buzinas/revert-112-gulpfile-typescript (@buzinas)
- [2fd858f](https://github.com/buzinas/tslint-eslint-rules/commit/2fd858ffeae7d6a81a64ebcca05bdf7efe5d1672) Revert "[gulp] using typescript to maintain the gulpfile" (@buzinas)
- [#112](https://github.com/buzinas/tslint-eslint-rules/pull/112) Merge pull request #112 from jmlopez-rod/gulpfile-typescript (@jmlopez-rod)
- [e8b1892](https://github.com/buzinas/tslint-eslint-rules/commit/e8b189241ba9e32f740bbf3d5af1ff26fa016820) [bugfix] using promises to handle async events (@jmlopez-rod)
- [bd13bfb](https://github.com/buzinas/tslint-eslint-rules/commit/bd13bfb0b7efe08b99c077a0843923fa2452816d) [bugfix] async processes mess the readme file creation (@jmlopez-rod)
- [e67527a](https://github.com/buzinas/tslint-eslint-rules/commit/e67527a04a8a69e28d65f0a9c096b3d80fd949cc) [gulp] adding fetch task on ts-gulp (@jmlopez-rod)
- [0a45ec1](https://github.com/buzinas/tslint-eslint-rules/commit/0a45ec1023bdf5411920b5e5805f6b2279eac0ec) Merge branch 'buzinas/master' into gulpfile-typescript (@jmlopez-rod)
- [#109](https://github.com/buzinas/tslint-eslint-rules/pull/109) Merge pull request #109 from jmlopez-rod/tslint-eslint-sync (@jmlopez-rod)
- [#111](https://github.com/buzinas/tslint-eslint-rules/pull/111) Merge pull request #111 from jmlopez-rod/readme-updates (@jmlopez-rod)
- [d132eee](https://github.com/buzinas/tslint-eslint-rules/commit/d132eee70825d619f5a59948ccba2f36519effc8) [feat] using typescript to manage the gulpfile (@jmlopez-rod)
- [c2605bf](https://github.com/buzinas/tslint-eslint-rules/commit/c2605bfeeeffa697f1521e17d556154473d75253) Merge branch 'buzinas/master' (@jmlopez-rod)
- [9d7b0c8](https://github.com/buzinas/tslint-eslint-rules/commit/9d7b0c8bb1d852b74cd80b004d354cd2dd5c8e96) [rule] no-multiple-empty-line => no-consecutive-blank-lines (@jmlopez-rod)
- [496494c](https://github.com/buzinas/tslint-eslint-rules/commit/496494ca1fb8f4e4a4ca77da81cee662908a12e0) [rule] max-len => max-line-length (@jmlopez-rod)
- [a76e7b6](https://github.com/buzinas/tslint-eslint-rules/commit/a76e7b6b20feb6e5bb75fd942b0e4546a9e3902c) [rule] max-lines => max-file-line-count (@jmlopez-rod)
- [7e5d9a1](https://github.com/buzinas/tslint-eslint-rules/commit/7e5d9a1078d2a10d1c28b5619196c573e2de40f4) [rename] sync -> fetch (@jmlopez-rod)
- [7f8768d](https://github.com/buzinas/tslint-eslint-rules/commit/7f8768d7dceb2e5ac9f0bcf02fb02860601bfcb1) Merge branch 'buzinas/master' into tslint-eslint-sync (@jmlopez-rod)
- [ea9cc75](https://github.com/buzinas/tslint-eslint-rules/commit/ea9cc7591e8ae1cda8db0e81cc1c6a65aca572a1) Merge branch 'buzinas/master' into readme-updates (@jmlopez-rod)
- [#106](https://github.com/buzinas/tslint-eslint-rules/pull/106) Merge pull request #106 from jmlopez-rod/no-multi-spaces (@jmlopez-rod)
- [#110](https://github.com/buzinas/tslint-eslint-rules/pull/110) Merge pull request #110 from jmlopez-rod/no-self-assign (@jmlopez-rod)
- [219bdc4](https://github.com/buzinas/tslint-eslint-rules/commit/219bdc4fa0f209716f8d746bc12a5dbaac202fcf) [rule] strict => use-strict (@jmlopez-rod)
- [c57bca1](https://github.com/buzinas/tslint-eslint-rules/commit/c57bca15fbc1919be79ed8bf1acc48e4486e19d5) [rule] semi => semicolon (@jmlopez-rod)
- [8b31c50](https://github.com/buzinas/tslint-eslint-rules/commit/8b31c50fc012548699f2a373099606c890d4bd49) [docs] added no-self-assign to README.md (@jmlopez-rod)
- [bf5e92a](https://github.com/buzinas/tslint-eslint-rules/commit/bf5e92ac8a5b83eb1713d3ac5eaf8d9d5e017db8) [utility] adding gulp task to help keep rules in sync (@jmlopez-rod)
- [caaed2c](https://github.com/buzinas/tslint-eslint-rules/commit/caaed2c89a291c2aebf49ac87b1b43246d4e46e1) Merge branch 'buzinas/master' (@jmlopez-rod)
- [1508562](https://github.com/buzinas/tslint-eslint-rules/commit/150856269e895435ffcad6b7de3a8fc738c64c2a) [docs] update README to introduce no-multi-spaces rule (closes #102) (@jmlopez-rod)
- [5b1c019](https://github.com/buzinas/tslint-eslint-rules/commit/5b1c0196bbac33358bed23eb6bb87bbe0e3db8b4) Merge branch 'buzinas/master' into no-multi-spaces (@jmlopez-rod)
- [#108](https://github.com/buzinas/tslint-eslint-rules/pull/108) Merge pull request #108 from jmlopez-rod/readme-rules-table (@jmlopez-rod)
- [4254d42](https://github.com/buzinas/tslint-eslint-rules/commit/4254d42d76585d0929c303a2e23143f299a611a4) [docs] fixing grammar error (@jmlopez-rod)
- [291c76e](https://github.com/buzinas/tslint-eslint-rules/commit/291c76e7d52c227623ffd949e207a03cbfe7c8e9) [docs] adding legend for rule status icons (@jmlopez-rod)
- [5c7fb19](https://github.com/buzinas/tslint-eslint-rules/commit/5c7fb19155b6883d4f51495e1bd148abdc2848b0) [docs] using ESLint and TSLint instead of Tslint and Eslint (@jmlopez-rod)
- [f45aa55](https://github.com/buzinas/tslint-eslint-rules/commit/f45aa55a33e2b56391ff43082d78d8cd49039df6) [docs] updated contribution section in README.md (@jmlopez-rod)
- [38ac669](https://github.com/buzinas/tslint-eslint-rules/commit/38ac6693881f5d87955792070bb43fd90e63959d) [doc] no-entry-sign for rules that do not apply (@jmlopez-rod)
- [ae86f70](https://github.com/buzinas/tslint-eslint-rules/commit/ae86f70f3563f8b7d95d642e90ceb8cf66aa11f0) [doc] cleaned up urls (@jmlopez-rod)
- [de0b0d5](https://github.com/buzinas/tslint-eslint-rules/commit/de0b0d5798075b295dc41378af092fe1fd9561e7) [doc] deleting tslintUrl when the project is the provider (@jmlopez-rod)
- [b7b4a9f](https://github.com/buzinas/tslint-eslint-rules/commit/b7b4a9f49920de43f2b854b35067856cabe6313d) [doc] missing new line and extra semicolon (@jmlopez-rod)
- [9617910](https://github.com/buzinas/tslint-eslint-rules/commit/961791020bb7947c1c4e942b5f7875165a693b2a) [doc] added markdown files for each of the rules (@jmlopez-rod)
- [88c3b45](https://github.com/buzinas/tslint-eslint-rules/commit/88c3b45f0bf432d02c62063a4dddae43a271c836) [doc] Adding the categories to the table (@jmlopez-rod)
- [3bc8508](https://github.com/buzinas/tslint-eslint-rules/commit/3bc85081375c5ade657148f255d08cebcb9a3853) [doc] removed list of rules (@jmlopez-rod)
- [a9adecc](https://github.com/buzinas/tslint-eslint-rules/commit/a9adecc37e608e540d99a74191d1e2bd1dc85b8d) [doc] using typescript to generate the README file (@jmlopez-rod)
- [7557e7c](https://github.com/buzinas/tslint-eslint-rules/commit/7557e7c507a28c02347aba1955fff5189b3b5db2) [doc] switching to typescript (@jmlopez-rod)
- [7e218d9](https://github.com/buzinas/tslint-eslint-rules/commit/7e218d91aa67119a1f0331b2db2f6ca7d323612b) [doc] replacing availability header for a question mark (@jmlopez-rod)
- [1c86880](https://github.com/buzinas/tslint-eslint-rules/commit/1c868803f270ec664a1199dc6df2844bae097ea8) [doc] added table of rules (@jmlopez-rod)
- [40eee40](https://github.com/buzinas/tslint-eslint-rules/commit/40eee4058fb0dad8bb4983d64f7a22d9ef923973) [doc] updated README file using the data in rules.js (@jmlopez-rod)
- [0f3ea05](https://github.com/buzinas/tslint-eslint-rules/commit/0f3ea055ec55b87a07533cad74cb36688665b810) [update]: missed a bunch of rules (@jmlopez-rod)
- [e2254c2](https://github.com/buzinas/tslint-eslint-rules/commit/e2254c2e1eb09c1116ed6e71fbefb2693f2de275) [docs]: adding a js file containing all the rules (@jmlopez-rod)
- [6789278](https://github.com/buzinas/tslint-eslint-rules/commit/67892788216e0e189268ff75ff79a0f0c5d7b631) Merge branch 'master' into readme-rules-table (@jmlopez-rod)
- [81315e7](https://github.com/buzinas/tslint-eslint-rules/commit/81315e759c46bee5d2f6f61bc5df800f6a9720a1) Merge remote-tracking branch 'buzinas/master' into no-multi-spaces (@jmlopez-rod)
- [e465cbb](https://github.com/buzinas/tslint-eslint-rules/commit/e465cbb76b2c2308067dd110daa86cb5a66d5d1c) Merge remote-tracking branch 'buzinas/master' (@jmlopez-rod)
- [89b392d](https://github.com/buzinas/tslint-eslint-rules/commit/89b392d41bf9da4ca8ab15a19f1bb09fec56db47) [docs] updated to v1.5.0 (@buzinas)
- [edf310b](https://github.com/buzinas/tslint-eslint-rules/commit/edf310bb71be5fc4ce81b2586429fab9b55f710e) Merge branch 'master' of https://github.com/buzinas/tslint-eslint-rules (@buzinas)
### v1.5.0 (2016/09/05 15:10 +00:00)
- [#99](https://github.com/buzinas/tslint-eslint-rules/pull/99) Merge pull request #99 from jmlopez-rod/object-curly-spacing (@jmlopez-rod)
- [e81a3b7](https://github.com/buzinas/tslint-eslint-rules/commit/e81a3b72a45238aab46aac8b7711eb32e7129ff2) [tslint] same error obtained from object-curly-spacing (@jmlopez-rod)
- [bfa9669](https://github.com/buzinas/tslint-eslint-rules/commit/bfa96699750aaf7b9c30860fa9a0b69d63ae94ab) Merge branch 'object-curly-spacing' into no-multi-spaces (@jmlopez-rod)
- [68ad5a1](https://github.com/buzinas/tslint-eslint-rules/commit/68ad5a183007539344b45b2a2afff02bea4a6feb) [tslint] Removing rule from configuration (@jmlopez-rod)
- [9dca874](https://github.com/buzinas/tslint-eslint-rules/commit/9dca8744cff0e4eff44378424bc3fa5645089a4c) Merge remote-tracking branch 'buzinas/master' into object-curly-spacing (@jmlopez-rod)
- [d3c4ccc](https://github.com/buzinas/tslint-eslint-rules/commit/d3c4ccc40f2306d32e30568350259ccbf26f3da2) Merge remote-tracking branch 'buzinas/master' (@jmlopez-rod)
- [387d1ec](https://github.com/buzinas/tslint-eslint-rules/commit/387d1ec98610a8875ef80b7b74dd752eaea33114) [docs] udpated changelog (@buzinas)

@@ -19,3 +80,9 @@ ### v1.4.0 (2016/09/05 13:47 +00:00)

- [874440f](https://github.com/buzinas/tslint-eslint-rules/commit/874440f99f2a37a3acf42939bdcd0212ec0dd148) [bug] fixed brace-style rule (closes #93) (@hadalin)
- [acc4f5b](https://github.com/buzinas/tslint-eslint-rules/commit/acc4f5b7850cca95b8a06fd671ee2784f7e7cc4f) [docs] fixing github json parsing error (@jmlopez-rod)
- [28524f7](https://github.com/buzinas/tslint-eslint-rules/commit/28524f76c7c7484065707fde41009781e34b951a) [lint] Neglected to change the walker name (@jmlopez-rod)
- [29a14ff](https://github.com/buzinas/tslint-eslint-rules/commit/29a14ff9ff5f6e8d5fc6256c02bdd9f01cff31db) [docs] Removed TODO from README (@jmlopez-rod)
- [a161904](https://github.com/buzinas/tslint-eslint-rules/commit/a16190461e58754bb41526c9cf64a251c1e02f3b) [bug] false errors when string literal ends with multi space (@jmlopez-rod)
- [3a748d5](https://github.com/buzinas/tslint-eslint-rules/commit/3a748d53ba31f39933071573741b50047e2d663f) [lint] added no-multi-space rule to project (@jmlopez-rod)
- [7972712](https://github.com/buzinas/tslint-eslint-rules/commit/79727121b64c383bc3c66f8bf2d5feaab3f2ad02) [feat] added no-multi-spaces rule (@jmlopez-rod)
- [eaed379](https://github.com/buzinas/tslint-eslint-rules/commit/eaed379e2404c58e7072ccad2ea34e2e80c6f9ba) [feat] adding runScript and runTest functions to the test helpers (@jmlopez-rod)
- [951a64c](https://github.com/buzinas/tslint-eslint-rules/commit/951a64cbb0c11070ab0fa26c2672cc0bed08e0e3) [bug] fixed valid-jsdoc rule (closes #100) (@jmlopez-rod)

@@ -22,0 +89,0 @@ - [28c5727](https://github.com/buzinas/tslint-eslint-rules/commit/28c57275aeb62d83e5df7d6f75dfd9c52b05d2bc) [feat] added object-curly-spacing rule (@jmlopez-rod)

21

dist/rules/noConstantConditionRule.js

@@ -24,5 +24,10 @@ "use strict";

__extends(NoConstantConditionWalker, _super);
function NoConstantConditionWalker() {
_super.apply(this, arguments);
function NoConstantConditionWalker(sourceFile, options) {
_super.call(this, sourceFile, options);
this.checkLoops = true;
this.isInConditional = false;
var opts = this.getOptions();
if (opts.length && opts[0].checkLoops === false) {
this.checkLoops = false;
}
}

@@ -34,11 +39,15 @@ NoConstantConditionWalker.prototype.visitIfStatement = function (node) {

NoConstantConditionWalker.prototype.visitWhileStatement = function (node) {
this.validateCondition(node.expression);
if (this.checkLoops) {
this.validateCondition(node.expression);
}
_super.prototype.visitWhileStatement.call(this, node);
};
NoConstantConditionWalker.prototype.visitDoStatement = function (node) {
this.validateCondition(node.expression);
if (this.checkLoops) {
this.validateCondition(node.expression);
}
_super.prototype.visitDoStatement.call(this, node);
};
NoConstantConditionWalker.prototype.visitForStatement = function (node) {
if (node.condition) {
if (this.checkLoops && node.condition) {
this.validateCondition(node.condition);

@@ -72,3 +81,3 @@ }

case ts.SyntaxKind.PostfixUnaryExpression:
return true;
return this.isConstant(node.operand);
case ts.SyntaxKind.BinaryExpression:

@@ -75,0 +84,0 @@ if (this.isAssignmentToken(node.operatorToken)) {

@@ -7,2 +7,3 @@ "use strict";

};
var ts = require('typescript');
var Lint = require('tslint/lib/lint');

@@ -18,3 +19,3 @@ var Rule = (function (_super) {

};
Rule.FAILURE_STRING = 'do not assign to the exception parameter.';
Rule.FAILURE_STRING = 'do not assign to the exception parameter';
return Rule;

@@ -28,20 +29,27 @@ }(Lint.Rules.AbstractRule));

this.isInCatchClause = false;
this.currentIdentifier = null;
this.variableNode = null;
}
NoExAssignWalker.prototype.visitCatchClause = function (node) {
this.variableNode = node.variableDeclaration;
this.isInCatchClause = true;
_super.prototype.visitCatchClause.call(this, node);
this.currentIdentifier = null;
this.isInCatchClause = false;
this.variableNode = null;
};
NoExAssignWalker.prototype.visitIdentifier = function (node) {
if (!this.currentIdentifier) {
this.currentIdentifier = node;
NoExAssignWalker.prototype.visitBinaryExpression = function (node) {
var _this = this;
if (this.isInCatchClause) {
if (node.left.kind === ts.SyntaxKind.Identifier && this.variableNode.name.getText() === node.left.getText()) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING));
}
else if (node.left.kind === ts.SyntaxKind.ArrayLiteralExpression) {
var els = node.left.elements;
if (els.some(function (el) { return el.getText() === _this.variableNode.getText(); })) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING));
}
}
}
else if (this.currentIdentifier.text === node.text) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING));
}
_super.prototype.visitIdentifier.call(this, node);
_super.prototype.visitBinaryExpression.call(this, node);
};
return NoExAssignWalker;
}(Lint.RuleWalker));

@@ -48,2 +48,5 @@ "use strict";

}
if (grandparent.kind === ts.SyntaxKind.BinaryExpression) {
grandparent = grandparent.parent;
}
if (grandparent.kind === ts.SyntaxKind.IfStatement) {

@@ -50,0 +53,0 @@ this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING.if));

{
"name": "tslint-eslint-rules",
"version": "1.5.0",
"version": "1.6.0",
"description": "Improve your TSLint with the missing ESLint Rules",

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

Sorry, the diff of this file is too big to display

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