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 inside var in custom-property-pattern #5925

Conversation

yinonov
Copy link
Contributor

@yinonov yinonov commented Feb 20, 2022

Closes #5921

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.

@yinonov Thank you for the quick fix. LGTM 👍🏼

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.

@yinonov Thanks for the pull request.

I've made one minor request, otherwise looks good.

Comment on lines 22 to 27
{
code: 'a { color: var($foo-color); }',
},
{
code: 'a { color: var(tokens.$foo-color); }',
},
Copy link
Member

@jeddy3 jeddy3 Feb 21, 2022

Choose a reason for hiding this comment

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

Let's move this into a separate testRule (at the bottom of the file) that sets the customSyntax property (like so) as we like to keep non-standard syntax separate from standard syntax.

@jeddy3 jeddy3 changed the title fix(custom-property-pattern): false positives for interpolation inside var Fix false positives for interpolation inside var in custom-property-pattern Feb 21, 2022
testRule({
ruleName,
customSyntax: 'postcss-scss',
config: ['$foo-color'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jeddy3 any hints on relevant config here? ref to relevant documentation on possible values?

Copy link
Member

Choose a reason for hiding this comment

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

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.

Thanks for making the change.

I've requested two follow up changes (as committable suggestions).

lib/rules/custom-property-pattern/__tests__/index.js Outdated Show resolved Hide resolved
lib/rules/custom-property-pattern/__tests__/index.js Outdated Show resolved Hide resolved
yinonov and others added 2 commits February 21, 2022 15:53
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
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! LGTM.

@jeddy3 jeddy3 merged commit 8bb3ab1 into stylelint:main Feb 21, 2022
@jeddy3
Copy link
Member

jeddy3 commented Feb 21, 2022

Changelog entry added:

  • Fixed: custom-property-pattern false positives for interpolation inside var() (#5925).

@yinonov
Copy link
Contributor Author

yinonov commented Feb 21, 2022

I must say that the contribution experience with styling has been tremendously pleasant. Starting with the report bug template, maintainers assistance, and the development environment setup.

This should be rated 5 stars in a GitHub open source criteria If there was any.

Thanks team stylelint 😀

@jeddy3
Copy link
Member

jeddy3 commented Feb 21, 2022

I must say that the contribution experience with styling has been tremendously pleasant.

That's fantastic to hear!

Thank you for your contribution.

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 inside var in custom-property-pattern
3 participants