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

Making linter pick up separate function groups #215

Merged
merged 4 commits into from
Feb 10, 2022

Conversation

jonrohan
Copy link
Member

@jonrohan jonrohan commented Feb 9, 2022

This PR fixes a case that was missing from the spacing plugin. In this example, the linter should fail on 6px because it's separate from the math group happening.

I rewrote the walk function to recursively dive into each function group and evaluate the variables. This gives us more reliable results.

// This failed to be picked up by the linter before.
.x {
   padding: 6px ($spacer-3 + 12px + $spacer-2);
}

Co-authored-by: Joel Hawksley <joel@hawksley.org>
@jonrohan jonrohan requested a review from a team as a code owner February 9, 2022 20:35
@jonrohan jonrohan requested a review from simurai February 9, 2022 20:35
@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2022

🦋 Changeset detected

Latest commit: b656532

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/stylelint-config Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jonrohan jonrohan merged commit 66b16ae into main Feb 10, 2022
@jonrohan jonrohan deleted the spacing_linter_functions branch February 10, 2022 16:59
@primer-css primer-css mentioned this pull request Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants