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

Default string-quotes rule and Sass modules #5138

Closed
niksy opened this issue Feb 9, 2021 · 2 comments
Closed

Default string-quotes rule and Sass modules #5138

niksy opened this issue Feb 9, 2021 · 2 comments
Labels
status: needs clarification triage needs clarification from author

Comments

@niksy
Copy link

niksy commented Feb 9, 2021

What is the problem you're trying to solve?

It seems like default string-quotes rule ignores Sass Modules at-rules @use and @forward. Is this something that should be supported in core? It seems there’s a bunch of checks for non-standard configurations so I don’t know if that relates to Sass modules.

I’ve already submitted it to stylelint-scss, but author consesus is that it should be handled in core.

What solution would you like to see?

Is it possible to add certain at-rules to allowed list of rules which should follow definition for this rule?

@jeddy3
Copy link
Member

jeddy3 commented Feb 9, 2021

@niksy Thanks for the request and for using the template.

I can't reproduce this using the demo:

Given:

@forward "functions";
@forward "theme" as theme-*;
@use "material" with ($theme-primary: blue);

And:

{
  "rules": {
    "string-quotes": "single"
  }
}

I get:

1:10 error Expected single quotes (string-quotes)
2:10 error Expected single quotes (string-quotes)
3:6 error Expected single quotes (string-quotes)

The rules built into stylelint supports non-standard syntax if they extend standard constructs, like at-rules, functions and so on, which @use and @forward do.

What behaviour are you seeing, and can you include a demo link to help us investigate?

@jeddy3 jeddy3 added the status: needs clarification triage needs clarification from author label Feb 9, 2021
@jeddy3 jeddy3 closed this as completed Apr 20, 2021
@niksy
Copy link
Author

niksy commented Sep 7, 2021

I finally found out why this is happening.

I’ve been using Prettier for formatting the code, and currently there’s a bug where use and forward at-rules are not handled.

I’ve created PR on Prettier repository to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs clarification triage needs clarification from author
Development

No branches or pull requests

2 participants