Skip to content

Commit

Permalink
Fix: jsx with retainLines (#14869)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Aug 22, 2022
1 parent aa07f5f commit 14c3f12
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/babel-generator/src/generators/jsx.ts
Expand Up @@ -55,9 +55,9 @@ export function JSXText(this: Printer, node: t.JSXText) {
const raw = this.getPossibleRaw(node);

if (raw !== undefined) {
this.token(raw);
this.token(raw, true);
} else {
this.token(node.value);
this.token(node.value, true);
}
}

Expand Down
@@ -0,0 +1,9 @@
export default function Component() {
return (
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
);
}
@@ -0,0 +1,4 @@
{
"plugins": ["jsx"],
"retainLines": true
}
@@ -0,0 +1,9 @@
export default function Component() {
return (
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>);

}

0 comments on commit 14c3f12

Please sign in to comment.