Skip to content

Conversation

@AdamVig
Copy link
Contributor

@AdamVig AdamVig commented Aug 20, 2025

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.

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.
@AdamVig AdamVig changed the title Mention priority ordering in sort-attrs documentation docs: mention priority ordering in sort-attrs documentation Aug 20, 2025
@yeonjuan yeonjuan requested review from Copilot and yeonjuan August 21, 2025 15:32
Copy link
Contributor

Copilot AI left a 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.

Copy link
Owner

@yeonjuan yeonjuan left a 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

@yeonjuan yeonjuan merged commit 2228ec7 into yeonjuan:main Aug 21, 2025
5 checks passed
@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (0a2e241) to head (adff639).
⚠️ Report is 1 commits behind head on main.

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           
Flag Coverage Δ
unittest 98.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/eslint-plugin/lib/rules/sort-attrs.js 98.85% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AdamVig AdamVig deleted the patch-1 branch August 21, 2025 16:03
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