Skip to content

Commit abffcd5

Browse files
committed
DEBUG
1 parent 502bbe5 commit abffcd5

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/language-js/print/assignment.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ function chooseLayout(path, options, print, leftDoc, rightPropertyName) {
142142
node.type === "ImportAttribute" ||
143143
(rightNode.type === "CallExpression" &&
144144
rightNode.callee.name === "require") ||
145-
isUnionType(rightNode) ||
146145
// do not put values on a separate line from the key in json
147146
options.parser === "json5" ||
148147
options.parser === "jsonc" ||

src/language-js/print/type-annotation.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,12 @@ function printUnionType(path, options, print) {
211211
!parent.name &&
212212
path.grandparent.this !== parent
213213
) &&
214-
!(
215-
(parent.type === "TypeAlias" ||
216-
parent.type === "VariableDeclarator" ||
217-
parent.type === "TSTypeAliasDeclaration") &&
218-
hasLeadingOwnLineComment(options.originalText, node)
214+
!path.match(
215+
undefined,
216+
(node, key) =>
217+
(key === "right" && node.type === "TypeAlias") ||
218+
node.type === "VariableDeclarator" ||
219+
(key === "typeAnnotation" && node.type === "TSTypeAliasDeclaration"),
219220
);
220221

221222
// {

0 commit comments

Comments
 (0)