Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-invalid-position-at-import-rule needs to be disabled for scss #117

Closed
fgblomqvist opened this issue Jun 8, 2021 · 8 comments · Fixed by #118
Closed

no-invalid-position-at-import-rule needs to be disabled for scss #117

fgblomqvist opened this issue Jun 8, 2021 · 8 comments · Fixed by #118

Comments

@fgblomqvist
Copy link
Contributor

I'm hitting this since upgrading from 2.1.0 to 2.2.0: stylelint/stylelint#5322
Rather than just blindly disabling it in your stylelint config, I believe it should be fixed upstream.

I don't think https://github.com/kristerkari/stylelint-config-recommended-scss suffers from it (yet) because they have yet to update to stylelint-config-recommended 5.0 (which enables this rule). So perhaps the problem is in this repo and related to how you extend the scss config as well as your own css config? Not sure how the priorities work there.

@fgblomqvist fgblomqvist changed the title no-invalid-position-at-import-rule needs to be disabled for sass no-invalid-position-at-import-rule needs to be disabled for scss Jun 8, 2021
@XhmikosR
Copy link
Member

XhmikosR commented Jun 8, 2021

Hmm, perhaps we should disable the rule in the Scss config indeed. Right now the scss config inherits from the CSS config where the rule is enabled.

@fgblomqvist
Copy link
Contributor Author

Out of curiosity, why does the scss config inherit from css? Doesn't that defeat a part of the purpose of keeping them separate?

@XhmikosR
Copy link
Member

XhmikosR commented Jun 8, 2021

Because many rules are common and it's been working for us for all these years.

@XhmikosR
Copy link
Member

XhmikosR commented Jun 8, 2021

@fgblomqvist
Copy link
Contributor Author

The issue rn is that by inheriting from css in scss, you also inherit stylelint-config-standard. That one in turn inherits stylelint-config-recommended. That doesn't feel right.

With your current setup, your SCSS extends chain look like this:

  1. stylelint-config-recommended - OK
  2. stylelint-config-recommended-scss - Disables some CSS-specific stuff from the -recommended one
  3. stylelint-config-recommended - This undoes step 2
  4. stylelint-config-standard - OK
  5. ../css - OK

I've bolded the ones you directly reference from your scss config. As you can see, step 2 is redundant. It would make sense to therefore drop the dep on that one (it does so little and is barely even maintained anymore) which would reduce confusion and "clean up" your chain so that you're extending from various CSS configs, then finally (in your SCSS one) do SCSS stuff.

@fgblomqvist
Copy link
Contributor Author

Will try the patch (but I'm 99% sure it'll work).

@fgblomqvist
Copy link
Contributor Author

It worked.

@XhmikosR
Copy link
Member

XhmikosR commented Jun 8, 2021

We don't have the bandwidth to work on cleaning the configs, but you are welcome to provide a PR assuming all the current rules are still included.

I'll make a new release for this.

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

Successfully merging a pull request may close this issue.

2 participants