Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

using without stylelint-scss result in a lot of "Unknown rule scss/***" warnings #127

Closed
randomunrandom opened this issue Oct 11, 2021 · 12 comments

Comments

@randomunrandom
Copy link

I'm writing a project with css only and when I try to add this preset to my config, stylelint spams a lot of warnings about "Unknown rule scss/***", as seen on screenshot
screenshot from my termninal
As I understand, this happens because I don't use stylelint-scss plugin, which creates this rules.
To solve this, I copied all of the rules, except for scss ones, from src/index.js to my config.
I think that scss rules shouldn't be included by default and something similar to preset in stylelint-prettier, which would include these rules in addition to standard ones would be better, but I'm not sure how to do that.

@shannonmoeller
Copy link
Member

Thank you for reporting. Sorry about that. Will remove for now.

@shannonmoeller
Copy link
Member

@rynpsc, fyi (#124)

@shannonmoeller
Copy link
Member

Revert published as v9.0.2.

@chalkygames123
Copy link

@rynpsc Hi, would you mind taking a look at this issue? It would be appreciated if your suggestion could be made available 😊

@riddla
Copy link

riddla commented Dec 2, 2021

This isn't fixed, as for example scss/operator-no-newline-after is still (or again) enabled and causing errors.

@shannonmoeller
Copy link
Member

shannonmoeller commented Dec 2, 2021

@riddla Are you sure you're using the latest version of stylelint-config-prettier, that it's the last entry in your eslint config's extends array, and that you haven't added any scss rules in your config?

@riddla
Copy link

riddla commented Dec 3, 2021

@shannonmoeller, thanks for the heads up. My configuration is as follows:

npm ls stylelint-config-prettier | grep stylelint-config-prettier@
└── stylelint-config-prettier@9.0.3

npm ls stylelint --depth=0 | grep stylelint@
└── stylelint@14.1.0

.stylelint-config.js

module.exports = {
  extends: [
    'stylelint-config-recommended-scss',
    'stylelint-config-recommended-vue',
    'stylelint-config-prettier',
  ],
}
npx stylelint assets/scss/_mixins.scss

assets/scss/_mixins.scss
  8:87  ✖  Expected single space before "*"  scss/operator-no-unspaced     
  8:87  ✖  Expected single space after "*"   scss/operator-no-unspaced     
 18:77  ✖  Unexpected newline after "*"      scss/operator-no-newline-after
 26:77  ✖  Unexpected newline after "*"      scss/operator-no-newline-after
 36:77  ✖  Unexpected newline after "*"      scss/operator-no-newline-after

Am I missing something?

@chalkygames123
Copy link

chalkygames123 commented Dec 3, 2021

You are seeing lint errors, not "Unknown rule" errors (so this issue has surely been fixed). SCSS rules have been temporarily removed in v9.0.2, so you should turn off the rules by yourself if you want to suppress the errors.

@chalkygames123
Copy link

@shannonmoeller BTW, I'm trying to resolve the "Unknown rule" issue using the new overrides property of Stylelint v14. Would you be willing to receive a PR?

@riddla
Copy link

riddla commented Dec 3, 2021

@chalkygames123, sorry, I misread this issue.

But @shannonmoeller, can you speak to why these rules were removed (temporarily) and when they will be included again?

@shannonmoeller
Copy link
Member

@chalkygames123 Feel free to start a new issue regarding the overrides!

@riddla As the OP states, the rules were disabled because they only work when using the scss plugin and many people don’t. We either need to detect whether the plugin is enabled, or create a new stylelint-config-prettier-scss project. I’m leaning towards the new separate project.

@shannonmoeller
Copy link
Member

shannonmoeller commented Dec 9, 2021

Just created a pre-release of https://github.com/prettier/stylelint-config-prettier-scss. Would love some beta testers and rule recommendations. Lets continue the conversation in prettier/stylelint-config-prettier-scss#1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants