Mangling comments in scss
See original GitHub issueThis is the smallest example I could create
before:
$colors: (
light: #fff,
);
//
//
after:
$colors: (
light: #fff
);
li
);
Empty comments are removed and replaced with garbage pulled from elsewhere in the file.
I first saw this happening with a much larger file with a much longer defintion of $colors
followed by a block of comments (//
not /* */
) which had multiple empty comment lines for paragraph spacing. The formatter a) replaced a couple empty comment lines with a pair of characters from a different line (as above) and b) removed others leaving an empty line. After removing the erroring characters, subsequent format would then remove those empty lines (also undesired behavior) clumping the comment paragraphs into a single block.
I’ve looked for a setting to disable formatting of any comments but I couldn’t find any.
I’m happy to move this issue to https://github.com/prettier/prettier if that’s a better place.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Related - ignore rules are not obeyed.
Before formatting:
After formatting:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.