stylelint-bem icon indicating copy to clipboard operation
stylelint-bem copied to clipboard

Rule expected but ")" found on `:is` with nested selectors

Open gglnx opened this issue 2 years ago • 1 comments

Type of issue

  • Bug report

Environment

  • Node.js v16.14.2
  • Mac OS 12.4
  • NPM: 8.5.0
  • Using postcss-scss as customSyntax

Expected behavior

When using a nested :is selector, no error should be thrown.

Current behavior

The fellowing error is thrown:

  • Rule expected but ")" found plugin/stylelint-bem-namics

Steps to reproduce the behavior

Create an stylesheet with the fellowing CSS code:

.u-underline:is(:focus:not(.has-invisible-focus), :hover:not([disabled])) {
  text-decoration: underline;
}

gglnx avatar Jun 07 '22 12:06 gglnx

Thanks for your bug report. I can't find a quick solution right now. We'll have to take a closer look. PR's are of course also welcome

In the meantime the bug can be worked around e.g. with ignore-codes https://stylelint.io/user-guide/ignore-code/ or with less complex selectors ;-)

ernscht avatar Jun 07 '22 20:06 ernscht

Same with :has selector:

.select {
  &:has(> .icon:not(.icon--chevron)) {
    .select__native,
    .select__custom__trigger {
      padding-inline-start: 46px;
    }
  }
}

Rule expected but ")" found. on &:has(> .icon:not(.icon--chevron)) { and .select__native.

t0byman avatar Jul 05 '23 11:07 t0byman

A fix for this was published as version 9 (Release Notes) You are welcome to test it.

ernscht avatar Sep 01 '23 10:09 ernscht

fixed and closed

ernscht avatar Oct 15 '23 15:10 ernscht