Don't default print comments for JSXFragments (#3398)
parent
f3e7ca2210
commit
66c9315d13
|
@ -5105,7 +5105,7 @@ function printAstToDoc(ast, options, addAlignmentSize) {
|
|||
// UnionTypeAnnotation has to align the child without the comments
|
||||
let res;
|
||||
if (
|
||||
((node && node.type === "JSXElement") ||
|
||||
((node && isJSXNode(node)) ||
|
||||
(parent &&
|
||||
(parent.type === "JSXSpreadAttribute" ||
|
||||
parent.type === "JSXSpreadChild" ||
|
||||
|
|
|
@ -33,6 +33,11 @@ exports[`fragment.js 1`] = `
|
|||
</>
|
||||
</div>;
|
||||
|
||||
foo = (
|
||||
// comment
|
||||
<></>
|
||||
);
|
||||
|
||||
</* open fragment */>
|
||||
<Component />
|
||||
<Component />
|
||||
|
@ -75,6 +80,11 @@ exports[`fragment.js 1`] = `
|
|||
</>
|
||||
</div>;
|
||||
|
||||
foo = (
|
||||
// comment
|
||||
<></>
|
||||
);
|
||||
|
||||
</* open fragment */>
|
||||
<Component />
|
||||
<Component />
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
</>
|
||||
</div>;
|
||||
|
||||
foo = (
|
||||
// comment
|
||||
<></>
|
||||
);
|
||||
|
||||
</* open fragment */>
|
||||
<Component />
|
||||
<Component />
|
||||
|
|
Loading…
Reference in New Issue