RJWadley / stylelint-no-unsupported-browser-features

Disallow features that aren't supported by your target browser audience.
426 stars 20 forks source link

Wrong css-nesting is not supported on *.scss files #294

Closed Yegorich555 closed 11 months ago

Yegorich555 commented 1 year ago

Steps to reproduce: add main.scss with following code

ul {
  & > li {
    list-style: none;
  }
}

Actual: linter throws: Unexpected browser feature "css-nesting" is not supported by Chrome 109,110,111 and only partially supported by Edge 117,118, Chrome 112,113,114,115,116,117,118, Safari 16.6,17.0,17.1, Opera 102,103 (plugin/no-unsupported-browser-features) Expected: no issues because it's scss file

H-L commented 1 year ago

Doiuse and this plugin are only compatible with standard css syntax, so syntaxes like scss, less and others aren't supported.

It specifically says this plugin does not supports SCSS and LESS syntaxes in the first paragraph of the README 😆

But if you really want to get rid of the error, you can just ignore it like this

// .stylelintrc
{
  "rules": {
    "plugin/no-unsupported-browser-features": [true, {
        "ignore": ["css-nesting"]
      }
    ],
  }
}
Yegorich555 commented 1 year ago

How to disable the rule for .scss but leave for .css at the same time?

dwightjack commented 11 months ago

@Yegorich555 you might want to try using stylelint overrides.

Yegorich555 commented 11 months ago

Great point. Thank you!