Skip to content

Commit

Permalink
Merge pull request palantir#708 from palantir/yield
Browse files Browse the repository at this point in the history
Yield expressions are valid standalone expressions
  • Loading branch information
adidahiya committed Oct 2, 2015
2 parents c233ab3 + e27f430 commit 1784952
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/noUnusedExpressionRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class UnusedExpressionWalker extends Lint.RuleWalker {
if (expressionText === "\"use strict\"" || expressionText === "'use strict'") {
return;
}
} else if (node.expression.kind === ts.SyntaxKind.DeleteExpression) {
} else if (node.expression.kind === ts.SyntaxKind.DeleteExpression || node.expression.kind === ts.SyntaxKind.YieldExpression) {
return;
}

Expand Down
5 changes: 5 additions & 0 deletions test/files/rules/unused.expression.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ a => fun2(a);

var obj = {};
delete obj.key;
function* g(): Iterable<number> {
for (let i = 0; i < 100; i++) {
yield i;
}
}

0 comments on commit 1784952

Please sign in to comment.