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

Fix false positives for interpolation in function-no-unknown #5914

Merged

Conversation

m4thieulavoie
Copy link
Contributor

This PR tweaks function-no-unknown so that ignoreFunctions are also supported in the custom properties syntax (e.g. --primary-color: #{custom-mixin(#fff)};

Which issue, if any, is this issue related to?

Fixes #5913

Is there anything in the PR that needs further explanation?

e.g. "No, it's self-explanatory."

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

@m4thieulavoie Thanks for the pull request.

As per #5913 (comment), let's check for #{ in the isStandardSyntaxFunction utility instead.

You'll want to include the accept tests in this testRule so that the postcss-scss custom syntax is used.

I suspect the changes you've made in this pull request to sanitize the node value will be useful in the stylelint-scss plugin if they add a scss/function-no-unknown rule. Let's revert them in this pull request, though.

@jeddy3 jeddy3 changed the title better handling of function-no-unknown Fix false positives for interpolation in function-no-unknown Feb 14, 2022
@m4thieulavoie
Copy link
Contributor Author

@m4thieulavoie Thanks for the pull request.

As per #5913 (comment), let's check for #{ in the isStandardSyntaxFunction utility instead.

You'll want to include the accept tests in this testRule so that the postcss-scss custom syntax is used.

I suspect the changes you've made in this pull request to sanitize the node value will be useful in the stylelint-scss plugin if they add a scss/function-no-unknown rule. Let's revert them in this pull request, though.

That should be done 👍 Let me know what you think!

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

Thank you for making the changes.

LGTM.

@jeddy3 jeddy3 mentioned this pull request Feb 15, 2022
6 tasks
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

@m4thieulavoie Thank you. LGTM 👍🏼

@ybiquitous ybiquitous changed the title Fix false positives for interpolation in function-no-unknown Fix false positives for interpolation in function-no-unknown Feb 15, 2022
@ybiquitous ybiquitous merged commit 7cc2e4f into stylelint:main Feb 15, 2022
@ybiquitous
Copy link
Member

Updated the changelog:

Fixed: function-no-unknown false positives for interpolation (#5914).

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.

Fix false positives for interpolation in function-no-unknown
3 participants