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
False positive for non standard selectors in no-duplicate-selectors #2199
Comments
I think we should ignore any resolved non-standard selectors in this rule i.e. those with interpolation. If there are no objections to this, I'll point @cookch10 in the direction of how to do this. |
@jeddy3 , what are your thoughts on this one? Is this a valid bug? |
Whoops, I didn't notice those thumbs up. @cookch10 Yes, this is a bug. Non-standard constructs should be ignored. Would you like to contribute a fix? It will involve checking that each resolved selector is of standard syntax. FYI, tests are run as so. |
@jeddy3, I would be interested in contributing a fix for this. I'll need a little time to get familiar with the project, so no promises on it being a quick turnaround :) |
Awesome! Take your time, there's no rush on these things :) |
This issue is similar to #2198. The rule works as expected. Explanation why in #2198 (comment). TL;DR: A rule with a parent selector .widget-container {
$variation-without-image: #{"&[data-variation^=without_image]"};
#{$variation-without-image} { // ← .widget-container #{$variation-without-image}
& { // ← .widget-container #{$variation-without-image}
}
}
} |
When using stylelint
v7.6.0
as follows:package.json (simplified):
My .stylelintrc config (uses stylelint-config-standard
v11.0.0
):given the following Sass (scss file): Sassmeister gist
The following results in an error:
:5 × Unexpected duplicate selector ".widget-container #{$variation-without-image}" no-duplicate-selectors
There is no duplicate selector here. If I change the Sass to the following (which yields the same output): given the following Sass (scss file), there is no error observed: Sassmeister gist
The text was updated successfully, but these errors were encountered: