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
I use SCSS, and the stylelint-scss rules at https://github.com/kristerkari/stylelint-scss. However, there are some plain CSS files in the project as well, and some stylelint-scss rules do not work well when run against plain CSS.
(Example: setting scss/comment-no-loud to true means no comments can be used in .css files, as it disallows /* … */ and only permits // — but this is not valid in plain CSS.
What solution would you like to see?
An ability to prevent SCSS-specific rules from running on non-SCSS files.
Ideally, stylelint-scss would be able to declare that its rules should only run against files detected to be SCSS (whether by checking the extension or some other means).
A second-best option would be allow stylelint-disable to accept wildcards — placing stylelint-disable scss/* at the start of every .css file would be annoying, but a reasonable workaround. Listing every rule starting scss/ individually would not be reasonable 😁 — nor would leaving the offending rules disabled by default and manually enabling them at the top of .scss files
Some of stylelint-scss could be applied to non-SCSS syntaxes. E. g. if someone uses $variables in their style sheet with PostCSS plugin. Then they could use dollar-variables rules from stylelint-scss, while not using SCSS itself.
Use separate configs and run stylelint twice. You can extends you main config in config for CSS and run stylelint for CSS as: stylelint "**/*.css" --config my-stylelint-css-config.json.
overrides object in configuration #3128 But it's not implemented yet :(
Yep, I think this is covered by the overrides feature that is present in other linters. @unikitty37 That issue is labeled as "help wanted", so feel free to contribute it if you've time.
I use SCSS, and the stylelint-scss rules at https://github.com/kristerkari/stylelint-scss. However, there are some plain CSS files in the project as well, and some stylelint-scss rules do not work well when run against plain CSS.
(Example: setting
scss/comment-no-loud
totrue
means no comments can be used in .css files, as it disallows/* … */
and only permits//
— but this is not valid in plain CSS.An ability to prevent SCSS-specific rules from running on non-SCSS files.
Ideally, stylelint-scss would be able to declare that its rules should only run against files detected to be SCSS (whether by checking the extension or some other means).
A second-best option would be allow
stylelint-disable
to accept wildcards — placingstylelint-disable scss/*
at the start of every .css file would be annoying, but a reasonable workaround. Listing every rule startingscss/
individually would not be reasonable 😁 — nor would leaving the offending rules disabled by default and manually enabling them at the top of .scss filesI originally filed this at stylelint-scss/stylelint-scss#352, but was told it needed to be addressed in stylelint itself.
The text was updated successfully, but these errors were encountered: