-1

I run stylelint in my angular project and I got error:

Unexpected unknown at-rule "@use" 

My stylelint version is "^13.12.0".

I don't want to disable this rule. I want stylelint to know about "@use" in scss files.

I also tested in stylelint demo website and I got the same error.

@use 'sass:list';

a {color: #FFF; }

stylelint.io/demo

Stylelint doesn't support @use?

How can I solve this issue?

Jon Sud
  • 10,211
  • 17
  • 76
  • 174
  • 1
    There's a [Stylelint plugin](https://github.com/stylelint-scss/stylelint-scss) specifically for SCSS, have you given that a try? I presume the lint error you're seeing is behaving as intended because `@use` isn't available in vanilla CSS. – miqh Oct 20 '21 at 06:47
  • yes it's solve the problem. thanks – Jon Sud Oct 20 '21 at 06:53
  • FWIW, this did not fix the issue for me – danwoods Oct 21 '22 at 16:49

1 Answers1

0

If you're linting SCSS with Stylelint, the "Getting started" guide within the Stylelint documentation now recommends extending the stylelint-config-standard-scss shared config. It will configure Stylelint for SCSS.

You can install the config using:

npm install --save-dev stylelint-config-standard-scss

And then update your Stylelint configuration object to extend it:

{
  "extends": "stylelint-config-standard-scss"
}
jeddy3
  • 3,451
  • 1
  • 12
  • 21