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
|
// UnionTypeAnnotation has to align the child without the comments
|
||||||
let res;
|
let res;
|
||||||
if (
|
if (
|
||||||
((node && node.type === "JSXElement") ||
|
((node && isJSXNode(node)) ||
|
||||||
(parent &&
|
(parent &&
|
||||||
(parent.type === "JSXSpreadAttribute" ||
|
(parent.type === "JSXSpreadAttribute" ||
|
||||||
parent.type === "JSXSpreadChild" ||
|
parent.type === "JSXSpreadChild" ||
|
||||||
|
|
|
@ -33,6 +33,11 @@ exports[`fragment.js 1`] = `
|
||||||
</>
|
</>
|
||||||
</div>;
|
</div>;
|
||||||
|
|
||||||
|
foo = (
|
||||||
|
// comment
|
||||||
|
<></>
|
||||||
|
);
|
||||||
|
|
||||||
</* open fragment */>
|
</* open fragment */>
|
||||||
<Component />
|
<Component />
|
||||||
<Component />
|
<Component />
|
||||||
|
@ -75,6 +80,11 @@ exports[`fragment.js 1`] = `
|
||||||
</>
|
</>
|
||||||
</div>;
|
</div>;
|
||||||
|
|
||||||
|
foo = (
|
||||||
|
// comment
|
||||||
|
<></>
|
||||||
|
);
|
||||||
|
|
||||||
</* open fragment */>
|
</* open fragment */>
|
||||||
<Component />
|
<Component />
|
||||||
<Component />
|
<Component />
|
||||||
|
|
|
@ -30,6 +30,11 @@
|
||||||
</>
|
</>
|
||||||
</div>;
|
</div>;
|
||||||
|
|
||||||
|
foo = (
|
||||||
|
// comment
|
||||||
|
<></>
|
||||||
|
);
|
||||||
|
|
||||||
</* open fragment */>
|
</* open fragment */>
|
||||||
<Component />
|
<Component />
|
||||||
<Component />
|
<Component />
|
||||||
|
|
Loading…
Reference in New Issue