Skip to content

Commit fe49434

Browse files
authored
Remove dead code checking union/intersection types length (#18396)
1 parent ca02b37 commit fe49434

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/language-js/parentheses/needs-parentheses.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,7 @@ function needsParentheses(path, options) {
560560
// fallthrough
561561
case "TSUnionType":
562562
case "TSIntersectionType":
563-
if (
564-
(isUnionType(parent) || isIntersectionType(parent)) &&
565-
parent.types.length > 1 &&
566-
(!node.types || node.types.length > 1)
567-
) {
563+
if (isUnionType(parent) || isIntersectionType(parent)) {
568564
return true;
569565
}
570566
// fallthrough

0 commit comments

Comments
 (0)