Skip to content

Commit 94c4557

Browse files
committed
Remove unneeded assertions
1 parent 4683cb5 commit 94c4557

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

scripts/tslint/rules/noInOperatorRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class Rule extends Lint.Rules.AbstractRule {
1212
function walk(ctx: Lint.WalkContext<void>): void {
1313
ts.forEachChild(ctx.sourceFile, recur);
1414
function recur(node: ts.Node): void {
15-
if (node.kind === ts.SyntaxKind.InKeyword && node.parent!.kind === ts.SyntaxKind.BinaryExpression) {
15+
if (node.kind === ts.SyntaxKind.InKeyword && node.parent.kind === ts.SyntaxKind.BinaryExpression) {
1616
ctx.addFailureAtNode(node, Rule.FAILURE_STRING);
1717
}
1818
}

scripts/tslint/rules/noIncrementDecrementRule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function walk(ctx: Lint.WalkContext<void>): void {
2828
}
2929

3030
function check(node: ts.UnaryExpression): void {
31-
if (!isAllowedLocation(node.parent!)) {
31+
if (!isAllowedLocation(node.parent)) {
3232
ctx.addFailureAtNode(node, Rule.POSTFIX_FAILURE_STRING);
3333
}
3434
}
@@ -47,7 +47,7 @@ function isAllowedLocation(node: ts.Node): boolean {
4747
// Can be in a comma operator in a for statement (`for (let a = 0, b = 10; a < b; a++, b--)`)
4848
case ts.SyntaxKind.BinaryExpression:
4949
return (node as ts.BinaryExpression).operatorToken.kind === ts.SyntaxKind.CommaToken &&
50-
node.parent!.kind === ts.SyntaxKind.ForStatement;
50+
node.parent.kind === ts.SyntaxKind.ForStatement;
5151

5252
default:
5353
return false;

src/services/documentHighlights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ namespace ts.DocumentHighlights {
180180
default:
181181
// Don't cross function boundaries.
182182
// TODO: GH#20090
183-
return (isFunctionLike(node) && "quit") as false | "quit";
183+
return isFunctionLike(node) && "quit";
184184
}
185185
});
186186
}

0 commit comments

Comments
 (0)