-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse multiline silent comments as unified blocks #109
Comments
Yeap. It will be a nice feature. PR is welcome since after PostCSS 8 release I will busy with Browserslist. |
I think proposed change would be unfortunate for tools, which use control comments (stylelint, Autoprefixer, Prettier, etc). In CSS we have 3 separate comment: /* a */
/* stylelint-disable */
/* b */ If we convert them to Sass: // a
// stylelint-disable
// b And then back to CSS (virtually, it just easier to understand what grouping of comments would do in /* a
stylelint-disable
b */ This is completely different thing, which is not important for Sass compiler, but is important for other tools. All these tools would need to change their code to parse every comment if there a line which starts with control words, etc. |
It's specifically for stylelint that we're trying to add this. I'd expect an inline comment that's intended to be a distinct chunk of text from another adjacent inline comment to be separated by an empty line. |
Currently this package parses each line of a silent
//
-style comment as a separateComment
object. In practice, users usually think of comments on adjacent lines as part of a single block, so it would be useful if this parser represented them as a single comment object. This would make downstream processing like documentation generation or stylelint/stylelint#4886 easier as well.Note: Dart Sass also internally represents adjacent (block-level) silent comment lines as a single object, so you can look to its parsing logic for inspiration.
The text was updated successfully, but these errors were encountered: