-
-
Notifications
You must be signed in to change notification settings - Fork 51
docs: mention priority ordering in sort-attrs documentation
#414
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
Conversation
A coworker expressed confusion about why `type` would be sorted before `class` when the rule's error message says "Attributes should be sorted alphabetically." Updating the rule's error message and documentation to mention the priority sorting behavior should avoid future confusion.
sort-attrs documentationsort-attrs documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Updates documentation and error messages for the sort-attrs ESLint rule to clarify that attributes are sorted by priority first, then alphabetically, rather than just alphabetically. This addresses confusion where users expected pure alphabetical sorting but observed priority-based ordering (e.g., type before class).
- Updated rule description and error message to mention priority ordering
- Modified documentation to reflect the actual sorting behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/eslint-plugin/lib/rules/sort-attrs.js | Updated rule description and error message to include priority ordering |
| docs/rules/sort-attrs.md | Updated rule documentation to clarify priority-based sorting behavior |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
yeonjuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AdamVig Thanks! It makes sense
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #414 +/- ##
=======================================
Coverage 98.61% 98.61%
=======================================
Files 83 83
Lines 2748 2748
Branches 768 768
=======================================
Hits 2710 2710
Misses 38 38
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
A coworker expressed confusion about why
typewould be sorted beforeclasswhen the rule's error message says "Attributes should be sorted alphabetically." Updating the rule's error message and documentation to mention the priority sorting behavior should avoid future confusion.