Tighten no ++/-- rule
This commit is contained in:
parent
a69825e84e
commit
189357db1a
|
@ -28,7 +28,8 @@ class IncrementDecrementWalker extends Lint.RuleWalker {
|
||||||
}
|
}
|
||||||
|
|
||||||
visitIncrementDecrement(node: ts.UnaryExpression) {
|
visitIncrementDecrement(node: ts.UnaryExpression) {
|
||||||
if (node.parent && (node.parent.kind === ts.SyntaxKind.ExpressionStatement || node.parent.kind === ts.SyntaxKind.ForStatement || node.parent.kind === ts.SyntaxKind.ElementAccessExpression)) {
|
if (node.parent && (node.parent.kind === ts.SyntaxKind.ExpressionStatement ||
|
||||||
|
node.parent.kind === ts.SyntaxKind.ForStatement)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.POSTFIX_FAILURE_STRING));
|
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.POSTFIX_FAILURE_STRING));
|
||||||
|
|
Loading…
Reference in a new issue