Skip to content

Commit

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

Remove needless condition
  • Loading branch information
sosukesuzuki authored and medikoo committed Feb 5, 2024
1 parent 717db84 commit 117aeda
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/language-js/needs-parens.js
Expand Up @@ -408,12 +408,7 @@ function needsParens(path, options) {
}

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

0 comments on commit 117aeda

Please sign in to comment.