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

Can't parse value from sass module namespace #39

Closed
a9052681569 opened this issue Sep 10, 2021 · 3 comments
Closed

Can't parse value from sass module namespace #39

a9052681569 opened this issue Sep 10, 2021 · 3 comments

Comments

@a9052681569
Copy link

I'm using scss module's @use syntax.

When I "@use" module, I have to access its variables with namespace, like this

image

When I do so with mixins or variables, like on screenshot - there's no problem.

But when I want to use that variable in selector property - linter throws error

image

Error:
image

App builds normally.

What can be done in order for the validator to recognize this?

@lahmatiy
Copy link
Member

The validator can't recognize it as it can only validate CSS. The validator currently detects some Saas / Less specific syntax and ignores such values. But in this case, it didn't recognize that the value was not CSS. I don’t know why at the moment. As a workaround for now you may try ignoreValue option in plugin's config to suppress warnings for such values, e.g. a value that contains $ (don't forget escape $ with a tripple \).

@a9052681569
Copy link
Author

This solution does not work. Can't use tripple \ in JSON

image

Tried different variants of regExp, nothing works.

Is there other workarounds?

@lahmatiy
Copy link
Member

lahmatiy commented Oct 18, 2021

@a9052681569 You need double backslashes in this case, since one goes for string escaping and then for regexp, e.g. "[\\\\\\$]"

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

No branches or pull requests

2 participants