-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Labels
area:multiparserIssues with printing one language inside another, like CSS-in-JSIssues with printing one language inside another, like CSS-in-JSlang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 3.7.2
Playground link
--parser babel
--arrow-parens avoid
--trailing-comma noneInput:
const a = `flex-direction: ${long_condlong_condlong_condlong_cond ? "column-reverse" : "column"}`
const b = css`
.class{
flex-direction: column${long_cond && long_cond && long_cond ? "-reverse" : ""};
}
`
const c = html`
<div>${long_cond && long_cond && long_cond && long_cond && long_cond ? "-reverse" : ""}</div>
`Output:
const a = `flex-direction: ${long_condlong_condlong_condlong_cond ? "column-reverse" : "column"}`;
const b = css`
.class {
flex-direction: column${long_cond && long_cond && long_cond
? "-reverse"
: ""};
}
`;
const c = html`
<div>
${long_cond && long_cond && long_cond && long_cond && long_cond
? "-reverse"
: ""}
</div>
`;Expected output:
const a = `flex-direction: ${long_condlong_condlong_condlong_cond ? "column-reverse" : "column"}`;
const b = css`
.class {
flex-direction: column${long_cond && long_cond && long_cond ? "-reverse" : ""};
}
`;
const c = html`
<div>
${long_cond && long_cond && long_cond && long_cond && long_cond ? "-reverse": ""}
</div>
`;Why?
Should not break the ternay like it's in js.
Original issue #5886
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:multiparserIssues with printing one language inside another, like CSS-in-JSIssues with printing one language inside another, like CSS-in-JSlang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.