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

Bug fix: Make filenames with dots work with at-import-partial-extension rule #612

Conversation

kersh
Copy link
Contributor

@kersh kersh commented Jun 29, 2022

Bug

image

Before (didn't work)

@import "colors.variables"; // <--- Stylelint: Unexpected extension ".utility" in @import (scss/at-import-partial-extension)
@import "defaultOutlineStyle.mixin"; // <--- Stylelint: Unexpected extension ".utility" in @import (scss/at-import-partial-extension)

// ...

After (works now)

@import "colors.variables"; // OK
@import "defaultOutlineStyle.mixin"; // OK

// ...

@@ -75,7 +75,8 @@ export default function rule(expectation, _, context) {
return;
}

if (extension && expectation === "never") {
const isScssPartial = extension === "scss";
if (extension && isScssPartial && expectation === "never") {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So extension contains after dot value (in my case it is .variables or .mixin).
I assume we only care about checking if there is a .scss file partial since we work with Sass. Other extension values can be left in the code and linter shouldn't highlight them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@kristerkari kristerkari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@kristerkari kristerkari merged commit c0a87c2 into stylelint-scss:master Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants