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 doesn't ignore @use statements #524

Closed
elliotleelewis opened this issue May 12, 2021 · 3 comments
Closed
Labels
Bug 🐛 Something isn't working

Comments

@elliotleelewis
Copy link

When running stylelint with no-invalid-position-at-import-rule enabled, the following fails:

@use 'sass:selector';

@import './styles/icons';

image

But after switching them the SCSS compile fails, stating that @use rules must be written before any other rules.:

image

@kristerkari kristerkari added the Bug 🐛 Something isn't working label May 20, 2021
@kristerkari
Copy link
Collaborator

Thanks for reporting this!

@kristerkari
Copy link
Collaborator

I somehow missed that the rule in the title was from stylelint core, so there is nothing that I can do about it. I guess that the rule can be disabled if it does not work with scss.

@elliotleelewis
Copy link
Author

@kristerkari We probably need to create a replacement rule in stylelint-scss (scss/no-invalid-position-at-import-rule), as it looks like the Stylelint team aren't going to fix it. 😢

stylelint/stylelint#5322

I guess that as it only breaks with the SCSS custom syntax, this is probably the correct solution anyway, it's not really an issue with Stylelint itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something isn't working
Development

No branches or pull requests

2 participants