fix(css-in-js): do not remove semicolon (#5353)
parent
b87fe4cf22
commit
6a54e21c12
|
@ -556,7 +556,7 @@ const parser = {
|
|||
if (endNode && node.source && !node.source.end) {
|
||||
node = endNode;
|
||||
}
|
||||
if (node.source) {
|
||||
if (node.source && node.source.end) {
|
||||
return lineColumnToIndex(node.source.end, node.source.input.css);
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -185,7 +185,9 @@ function genericPrint(path, options, print) {
|
|||
softline,
|
||||
"}"
|
||||
])
|
||||
: isTemplatePropNode(node) && !parentNode.raws.semicolon
|
||||
: isTemplatePropNode(node) &&
|
||||
!parentNode.raws.semicolon &&
|
||||
options.originalText[options.locEnd(node) - 1] !== ";"
|
||||
? ""
|
||||
: ";"
|
||||
]);
|
||||
|
@ -242,7 +244,9 @@ function genericPrint(path, options, print) {
|
|||
softline,
|
||||
"}"
|
||||
])
|
||||
: isTemplatePlaceholderNode(node) && !parentNode.raws.semicolon
|
||||
: isTemplatePlaceholderNode(node) &&
|
||||
!parentNode.raws.semicolon &&
|
||||
options.originalText[options.locEnd(node) - 1] !== ";"
|
||||
? ""
|
||||
: ";"
|
||||
]);
|
||||
|
|
|
@ -130,7 +130,17 @@ styled.span\`
|
|||
styled.span\`
|
||||
\${foo}:
|
||||
\${bar};
|
||||
\`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
\`
|
||||
|
||||
styled.a\`
|
||||
\${feedbackCountBlockCss}
|
||||
text-decoration: none;
|
||||
|
||||
\${FeedbackCount} {
|
||||
margin: 0;
|
||||
}
|
||||
\`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
const ListItem = styled.li\`\`;
|
||||
|
||||
const ListItem = styled.li\`\`;
|
||||
|
@ -263,4 +273,13 @@ styled.span\`
|
|||
\${foo}: \${bar};
|
||||
\`;
|
||||
|
||||
styled.a\`
|
||||
\${feedbackCountBlockCss}
|
||||
text-decoration: none;
|
||||
|
||||
\${FeedbackCount} {
|
||||
margin: 0;
|
||||
}
|
||||
\`;
|
||||
|
||||
`;
|
||||
|
|
|
@ -127,4 +127,13 @@ ${bar}
|
|||
styled.span`
|
||||
${foo}:
|
||||
${bar};
|
||||
`
|
||||
`
|
||||
|
||||
styled.a`
|
||||
${feedbackCountBlockCss}
|
||||
text-decoration: none;
|
||||
|
||||
${FeedbackCount} {
|
||||
margin: 0;
|
||||
}
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue