You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SCSS Selector List with Comments loses code, causes syntax error #2686
area:commentsIssues with how Prettier prints commentslang:css/scss/lessIssues affecting CSS, Less or SCSSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!
changed the title [-][1.6.0] CSS Selector List with Comments loses code, causes syntax error[/-][+][1.6.0] SCSS Selector List with Comments loses code, causes syntax error[/+]on Aug 28, 2017
changed the title [-][1.6.0] SCSS Selector List with Comments loses code, causes syntax error[/-][+]SCSS Selector List with Comments loses code, causes syntax error[/+]on Aug 28, 2017
area:commentsIssues with how Prettier prints commentslang:css/scss/lessIssues affecting CSS, Less or SCSSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!
Activity
[-][1.6.0] CSS Selector List with Comments loses code, causes syntax error[/-][+][1.6.0] SCSS Selector List with Comments loses code, causes syntax error[/+][-][1.6.0] SCSS Selector List with Comments loses code, causes syntax error[/-][+]SCSS Selector List with Comments loses code, causes syntax error[/+]vjeux commentedon Aug 28, 2017
This is not a 1.6 issue, this has been an issue ever since we shipped support for CSS. We need to fix it at some point, thanks for the report!
jackyho112 commentedon Sep 1, 2017
@vjeux
Should it be printed as
?
Also, doesn't seem like
postcsswith the scss plugin specifically handles inline comments written on the same line as a rule or a selector.I guess to fix this, we will have to handle this kind of cases on our own?
dcalhoun commentedon Nov 21, 2017
Below is a slightly different example I use often that suffers similar issues.
Input
Output
j-f1 commentedon Jan 24, 2018
Current status:
Prettier 1.10.2
Playground link
Input:
Output:
One of the comments is eaten, but the syntax is valid now.
alexander-akait commentedon Jan 24, 2018
@j-f1 already reported postcss/postcss-scss#75
alexander-akait commentedon Feb 7, 2018
We fix this, but we have open issue about best place for comments, please see #3905
j-f1 commentedon Feb 7, 2018
Status after PR:
Prettier pr-3909
Playground link
Input:
Output: