fix(css-in-js): do not duplicate comments (#5416)
parent
d4c248bb0b
commit
cc6899e5c5
|
@ -207,8 +207,11 @@ function genericPrint(path, options, print) {
|
|||
? concat([
|
||||
isDetachedRulesetCallNode(node)
|
||||
? ""
|
||||
: isTemplatePlaceholderNode(node)
|
||||
? node.raws.afterName
|
||||
: isTemplatePlaceholderNode(node) &&
|
||||
/^\s*\n/.test(node.raws.afterName)
|
||||
? /^\s*\n\s*\n/.test(node.raws.afterName)
|
||||
? concat([hardline, hardline])
|
||||
: hardline
|
||||
: " ",
|
||||
path.call(print, "params")
|
||||
])
|
||||
|
|
|
@ -140,6 +140,25 @@ styled.a\`
|
|||
margin: 0;
|
||||
}
|
||||
\`
|
||||
|
||||
const StyledComponent = styled.div\`
|
||||
\${anInterpolation}
|
||||
/* a comment */
|
||||
|
||||
.aRule {
|
||||
color: red
|
||||
}
|
||||
\`;
|
||||
|
||||
const StyledComponent = styled.div\`
|
||||
\${anInterpolation}
|
||||
|
||||
/* a comment */
|
||||
|
||||
.aRule {
|
||||
color: red
|
||||
}
|
||||
\`;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
const ListItem = styled.li\`\`;
|
||||
|
||||
|
@ -282,4 +301,23 @@ styled.a\`
|
|||
}
|
||||
\`;
|
||||
|
||||
const StyledComponent = styled.div\`
|
||||
\${anInterpolation}
|
||||
/* a comment */
|
||||
|
||||
.aRule {
|
||||
color: red;
|
||||
}
|
||||
\`;
|
||||
|
||||
const StyledComponent = styled.div\`
|
||||
\${anInterpolation}
|
||||
|
||||
/* a comment */
|
||||
|
||||
.aRule {
|
||||
color: red;
|
||||
}
|
||||
\`;
|
||||
|
||||
`;
|
||||
|
|
|
@ -137,3 +137,22 @@ styled.a`
|
|||
margin: 0;
|
||||
}
|
||||
`
|
||||
|
||||
const StyledComponent = styled.div`
|
||||
${anInterpolation}
|
||||
/* a comment */
|
||||
|
||||
.aRule {
|
||||
color: red
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledComponent = styled.div`
|
||||
${anInterpolation}
|
||||
|
||||
/* a comment */
|
||||
|
||||
.aRule {
|
||||
color: red
|
||||
}
|
||||
`;
|
||||
|
|
Loading…
Reference in New Issue