Remove needless conditions for YeildExpression in needs-parens (#13790)

Remove needless condition
This commit is contained in:
Sosuke Suzuki authored and GitHub committed 2022-11-06 14:06:46 +09:00
1 parent 8ae1fb69bd
commit fb55c39c00
1 file changed
+1 -6
+1 -6
View File
@@ -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