stylelint
stylelint copied to clipboard
Fix `no-irregular-whitespace` false positives for strings
What is the problem you're trying to solve?
I get a [no-irregular-whitespace] error with this code:
example:
.foo:after {
content: ' '; // a non-breaking space.
}
What solution would you like to see?
irregular whitespace should be allowed in string
Workaround
As workaround we can use unicode escape: content: '\a0'
@yukulele Thank you for the report. I can reproduce the issue on the online demo.
I've labelled the issue as ready to implement. Please consider contributing if you have time.
There are steps on how to fix a bug in a rule in the Developer guide.
It'll likely involve ignoring strings in at-rules params, rule selectors and declaration values. It may involve reaching for the value parser, if regex doesn't provide enough robustness.