-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add lint for loud comments on nested style rules #893
Comments
BTW I'm looking to work on this this week unless :) |
@Goodwine Thanks for the detailed description! Looking at what you wrote, I started wondering if the problem is maybe a bit too specific to RTLCSS to be added as a rule to this library. I understand that your problem is related to Sass, but I bet that most of the users of Could this idea instead be turned into a separate stylelint plugin that would be published in npm? Stylelint supports the |
Since this affects any loud comment (not just RTLCSS), would it make sense to still implement this lint check as part of this repo if it was made more generic? For example:
|
rtl:ignore
comment directives on nested style rules
I have updated the description of the issue to be more generic. |
Input
Output (playground)
Context
Sass loud comments (
/* */
) within a rule declaration are not "connected" to anything. They don't "belong" to the subsequent node. So when Sass compiles nested comments and rules to CSS, it "splits" the loud comment away from the nested rule block that the author intended, as shown in the example above.This could cause issues for libraries like Autoprefixer or RTLCSS that depend on these "loud comments" being positioned at the top of a specific line or block. For instance:
Which produces:
The text was updated successfully, but these errors were encountered: