feat(linter/sort-keys): support autofix with comments#22061
Merged
camc314 merged 2 commits intooxc-project:mainfrom May 4, 2026
Merged
feat(linter/sort-keys): support autofix with comments#22061camc314 merged 2 commits intooxc-project:mainfrom
camc314 merged 2 commits intooxc-project:mainfrom
Conversation
Leading `/** ... */` comments attached to a property and trailing same-line ``// ...` comments are now absorbed into that property's lifted text during the autofix, so they travel with the key when it moves. Other comment kinds still cause the fix to bail out. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Amund211
commented
May 1, 2026
Merging this PR will not alter performance
Comparing Footnotes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR is completely AI-generated, and I have only briefly read through it to check that it looked sensible. Feel free to reject it if the code seems unmaintainable or poorly implemented :^)
Building on the work I did in #22052, I want to "re-activate" some autofixes for this rule. Specifically targetting js-doc and same-line, trailing
//comments here as I feel pretty confident in attributing them to a specific property based on their position.Leading
/** ... */comments attached to a property and trailing same-line ``// ...` comments are now absorbed into that property's lifted text during the autofix, so they travel with the key when it moves. Other comment kinds still cause the fix to bail out.