Skip to content

Conversation

0xA1337
Copy link
Contributor

@0xA1337 0xA1337 commented Jun 13, 2025

Resolves #2758.

Copy link

changeset-bot bot commented Jun 13, 2025

🦋 Changeset detected

Latest commit: 5cd66bd

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

This PR includes changesets to release 1 package
Name Type
eslint-plugin-vue 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

@0xA1337 0xA1337 changed the title feat(attributes-order): add sortByLineLength option feat(attributes-order): add sortLineLength option Jun 13, 2025
Copy link
Member

@waynzh waynzh left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

Copy link
Contributor

@Copilot 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

This PR adds a new sortLineLength option to the vue/attributes-order ESLint rule that allows attributes to be sorted by their line length within the same attribute group. When enabled, shorter attributes come before longer ones, providing an alternative sorting method to the existing alphabetical option.

  • Adds sortLineLength configuration option to the attributes-order rule
  • Implements line length comparison logic for attributes within the same position group
  • Adds comprehensive test coverage for the new sorting behavior

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
lib/rules/attributes-order.js Implements the core logic for sorting attributes by line length
tests/lib/rules/attributes-order.js Adds comprehensive test cases for the new sortLineLength option
docs/rules/attributes-order.md Documents the new option with examples and usage guidelines
.changeset/social-ghosts-dress.md Records the feature addition for changelog generation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

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

Looks good to me 🙂

@FloEdelmann FloEdelmann merged commit adc460d into vuejs:master Sep 5, 2025
15 checks passed
@github-actions github-actions bot mentioned this pull request Sep 5, 2025
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.

Add sortLineLength option to vue/attributes-order rule
3 participants