Skip to content

Fix false positives for #{&} in no-descending-specificity #3417

Closed
@primetwig

Description

Clearly describe the bug

There are false positives for rule no-descending-specificity when some manipulations are applied to a selector.

Which rule, if any, is the bug related to?

no-descending-specificity

What CSS is needed to reproduce the bug?

e.g.

.foo {
    &--a,
    &--a#{&}--b {
      div {
        padding: 10px;
      }
    }
}

What stylelint configuration is needed to reproduce the bug?

default

Which version of stylelint are you using?

9.2.0

How are you running stylelint: CLI, PostCSS plugin, Node API?

"CLI with stylelint '**/*.{css,scss}'"

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?

"Yes, it's related to SCSS injections into selector string."

What did you expect to happen?

"No warnings to be flagged."

What actually happened (e.g. what warnings or errors did you get)?

"The following warnings were flagged:"

file.scss
4:6    Expected selector ".foo--a#{.foo}--b div" to come before selector ".foo--a div" (no-descending-specificity)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions