Repository navigation
feat(sort-keys): add allowLineSeparatedGroups option - #3084
FloEdelmann merged 10 commits into
Conversation
🦋 Changeset detectedLatest commit: 1c8b5ff The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>
…low-line-separated-groups
FloEdelmann
left a comment
There was a problem hiding this comment.
Thank you! I only have some suggestions for minor code style improvements.
Co-authored-by: Flo Edelmann <git@flo-edelmann.de>
Co-authored-by: Flo Edelmann <git@flo-edelmann.de>
Co-authored-by: Flo Edelmann <git@flo-edelmann.de>
There was a problem hiding this comment.
Pull request overview
Adds the allowLineSeparatedGroups option to vue/sort-keys, aligning behavior with ESLint core: when enabled, a blank line between properties resets the sort order so each group is sorted independently (default remains false).
Changes:
- Extend
vue/sort-keysrule implementation to detect blank-line-separated property groups and reset ordering when configured. - Add valid/invalid test cases (ported from ESLint core) to cover the new option’s behavior.
- Update rule documentation and add a changeset entry for the new option.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
lib/rules/sort-keys.js |
Implements allowLineSeparatedGroups by detecting blank lines between properties and resetting ordering per group. |
tests/lib/rules/sort-keys.test.ts |
Adds coverage for the new option across various syntax patterns (comments, methods, computed keys, spreads, Vue SFC context). |
docs/rules/sort-keys.md |
Documents the new option and updates the options list/example config. |
.changeset/sort-keys-allow-line-separated-groups.md |
Records the feature as a minor release change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #2212
Adds an
allowLineSeparatedGroupsoption tovue/sort-keys, mirroring the ESLint core option of the same name.When enabled, a blank line between properties resets the sort order, so each group is sorted independently.
Default
false, so existing behavior is unchanged.Test cases are ported from ESLint core's suite.