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

Add support to checkAgainstRule with custom rules #6460

Merged
merged 12 commits into from Nov 11, 2022

Conversation

aaronccasanova
Copy link
Member

@aaronccasanova aaronccasanova commented Nov 9, 2022

Closes #6446

  • Added support to checkAgainstRule with custom rules
  • Added test cases to validate passing/failing custom rules and a missing result option
  • Updated the internal normalizeRuleSettings utility to handle custom rules
  • Updated the checkAgainstRule documentation to describe the new behavior

@changeset-bot
Copy link

changeset-bot bot commented Nov 9, 2022

🦋 Changeset detected

Latest commit: 7aab43b

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

This PR includes changesets to release 1 package
Name Type
stylelint Minor

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

@ybiquitous
Copy link
Member

@aaronccasanova Thanks for creating the pull request.

Should this PR include updates to the checkAgainstRule documentation describing the new behavior?

Yes, please.

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.

Thank you so much for adding good test cases. Also, the refactoring you introduced is so nice.

This PR is good enough, but I suggest additional refactorings to improve the code quality. If possible, please consider addressing my reviews.

lib/normalizeRuleSettings.js Show resolved Hide resolved
lib/utils/checkAgainstRule.js Outdated Show resolved Hide resolved
lib/utils/checkAgainstRule.js Outdated Show resolved Hide resolved
lib/utils/checkAgainstRule.js Outdated Show resolved Hide resolved
docs/developer-guide/plugins.md Outdated Show resolved Hide resolved
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.

Thanks for the refactoring. The code is now more straightforward and readable. I've left comments for tiny suggestions.


Could you add a minor changelog entry following the guideline on #6460 (comment) like this?

Added: support to `checkAgainstRule` with custom rules

lib/utils/checkAgainstRule.js Outdated Show resolved Hide resolved
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.

Thank you. LGTM 👍🏼

@aaronccasanova
Copy link
Member Author

Thanks for the reviews and feedback @ybiquitous! I'm very happy with the additional code quality wins we were able to include in this PR 👍

@ybiquitous ybiquitous merged commit d91bb5b into stylelint:main Nov 11, 2022
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.

Add support to checkAgainstRule with custom rules
2 participants