Repository navigation
Closed
Labels
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.scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency
Description
Apologies if this is the same issue as #2127 - I noticed that in that case the entire comment is eaten, whereas here it's just a substring within the comment.
Input
.first-selector, // some|comment
.second-selector {
color: white;
}Expected
.first-selector,
// some|comment
.second-selector {
color: white;
}Output
Notice that the part of the comment up to and including the vertical bar is discarded
.first-selector,
// comment
.second-selector {
color: white;
}Repro
Thanks for an amazing tool! We have an enormous codebase and it's been nearly flawless.
Metadata
Metadata
Assignees
Labels
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.scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency
Activity
azz commentedon Jul 13, 2017
Thanks for the bug report.
This is a bug (or potentially unsupported feature) of one in our dependencies. I've raised it at postcss/postcss-selector-parser#112.
suchipi commentedon Dec 9, 2017
As a workaround, you can use inline comments (normal CSS syntax), but it's still not very pretty:
Prettier 1.9.1
Playground link
Input:
Output:
azz commentedon Jan 5, 2018
Fixed in #3649