Skip to content

Commit

Permalink
Remove needless conditions for YeildExpression in needs-parens (#…
Browse files Browse the repository at this point in the history
…13790)

Remove needless condition
  • Loading branch information
sosukesuzuki committed Nov 6, 2022
1 parent 8ae1fb6 commit fb55c39
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/language-js/needs-parens.js
Expand Up @@ -349,12 +349,7 @@ function needsParens(path, options) {
}

case "YieldExpression":
if (
parent.type === "UnaryExpression" ||
parent.type === "AwaitExpression" ||
parent.type === "TSAsExpression" ||
parent.type === "TSNonNullExpression"
) {
if (parent.type === "AwaitExpression") {
return true;
}
// else fallthrough
Expand Down

0 comments on commit fb55c39

Please sign in to comment.