Comparing version 0.4.7 to 0.4.8
@@ -31,2 +31,8 @@ var __extends = this.__extends || function (d, b) { | ||
if (this.expressionIsUnused) { | ||
if (node.expression.kind() === 14 /* StringLiteral */) { | ||
var expressionText = node.expression.text(); | ||
if (expressionText === "\"use strict\"" || expressionText === "'use strict'") { | ||
return; | ||
} | ||
} | ||
this.addFailure(this.createFailure(position, node.width(), Rule.FAILURE_STRING)); | ||
@@ -33,0 +39,0 @@ } |
@@ -98,10 +98,6 @@ var __extends = this.__extends || function (d, b) { | ||
if (modifiers.childCount() === 0) { | ||
if (!this.hasModifier(modifiers, 55 /* PrivateKeyword */)) { | ||
this.skipVariableDeclaration = true; | ||
} | ||
if (this.hasModifier(modifiers, 57 /* PublicKeyword */)) { | ||
this.skipVariableDeclaration = true; | ||
} | ||
_super.prototype.visitMemberVariableDeclaration.call(this, node); | ||
@@ -108,0 +104,0 @@ this.skipVariableDeclaration = false; |
@@ -54,8 +54,18 @@ var __extends = this.__extends || function (d, b) { | ||
TypedefWalker.prototype.visitVariableDeclarator = function (node) { | ||
this.checkTypeAnnotation("variableDeclarator", node, node.typeAnnotation, node.propertyName); | ||
TypedefWalker.prototype.visitVariableDeclaration = function (node) { | ||
for (var i = 0, n = node.variableDeclarators.nonSeparatorCount(); i < n; i++) { | ||
var item = node.variableDeclarators.nonSeparatorAt(i); | ||
this.checkTypeAnnotation("variableDeclarator", node, item.typeAnnotation, item.propertyName); | ||
} | ||
_super.prototype.visitVariableDeclarator.call(this, node); | ||
_super.prototype.visitVariableDeclaration.call(this, node); | ||
}; | ||
TypedefWalker.prototype.visitMemberVariableDeclaration = function (node) { | ||
var variableDeclarator = node.variableDeclarator; | ||
this.checkTypeAnnotation("memberVariableDeclarator", variableDeclarator, variableDeclarator.typeAnnotation, variableDeclarator.propertyName); | ||
_super.prototype.visitMemberVariableDeclaration.call(this, node); | ||
}; | ||
TypedefWalker.prototype.checkTypeAnnotation = function (option, node, typeAnnotation, name) { | ||
@@ -62,0 +72,0 @@ if (this.hasOption(option) && !typeAnnotation) { |
@@ -41,3 +41,3 @@ var __extends = this.__extends || function (d, b) { | ||
if (this.getCurrentDepth() === 2) { | ||
if (this.hasOption(UseStrictWalker.OPTION_CHECK_FUNCTION)) { | ||
if (node.block && this.hasOption(UseStrictWalker.OPTION_CHECK_FUNCTION)) { | ||
this.checkUseStrict(node, node.block.statements); | ||
@@ -44,0 +44,0 @@ } |
Change Log | ||
=== | ||
v0.4.8 | ||
--- | ||
* [new-rule] `no-var-requires` disallows require statements not part of an import statement | ||
* [new-rule] `typedef` rule also checks for member variables | ||
* [bug] `no-unused-variable` no longer triggers false positives for class members labeled only `static` | ||
* [bug] `no-unused-expression` no longer triggers false positives for `"use strict";` expressions | ||
* [bug] `use-strict` works correctly on function declarations | ||
* [bug] config file is now discoverable from other drives on Windows | ||
v0.4.7 | ||
@@ -37,5 +47,5 @@ --- | ||
* [new rule] `no-unused-variable` | ||
* [new rule] `no-trailing-comma` | ||
* [new rule] `no-use-before-declare` | ||
* [new-rule] `no-unused-variable` | ||
* [new-rule] `no-trailing-comma` | ||
* [new-rule] `no-use-before-declare` | ||
* [feature] support `--version` in CLI | ||
@@ -42,0 +52,0 @@ * [feature] expose rule names to custom formatters |
@@ -44,2 +44,3 @@ { | ||
"no-use-before-declare": true, | ||
"no-var-requires": true, | ||
"one-line": [true, | ||
@@ -46,0 +47,0 @@ "check-open-brace", |
{ | ||
"name": "tslint", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"description": "a static analysis linter for TypeScript", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -48,2 +48,3 @@ TSLint [![NPM version](https://badge.fury.io/js/tslint.png)](http://badge.fury.io/js/tslint) [![Builds](https://api.travis-ci.org/repositories/palantir/tslint.png?branch=master)](https://travis-ci.org/palantir/tslint) | ||
* `no-use-before-declare` disallows usage of variables before their declaration. | ||
* `no-var-requires` disallows the use of require statements except in import statements, banning the use of forms such as `var module = require("module")` | ||
* `one-line` enforces the specified tokens to be on the same line as the expression preceding it. Rule options: | ||
@@ -65,2 +66,3 @@ * `"check-catch"` checks that `catch` is on the same line as the closing brace for `try` | ||
* `"variableDeclarator"` checks variable declarations | ||
* `"memberVariableDeclarator"` checks member variable declarations | ||
* `typedef-whitespace` enforces spacing whitespace for type definitions. Each rule option requires a value of `"space"` or `"nospace"` | ||
@@ -67,0 +69,0 @@ to require a space or no space before the type specifier's colon. Rule options: |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
7062079
58
125814
302