Skip to content

fix: sort-keys autofix fully sorts keys in a single pass#235

Draft
crimsonjay0 wants to merge 1 commit into
eslint:mainfrom
crimsonjay0:sort-keys-single-pass-autofix
Draft

fix: sort-keys autofix fully sorts keys in a single pass#235
crimsonjay0 wants to merge 1 commit into
eslint:mainfrom
crimsonjay0:sort-keys-single-pass-autofix

Conversation

@crimsonjay0
Copy link
Copy Markdown

Prerequisites checklist

AI acknowledgment

  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

What is the purpose of this pull request?

The sort-keys autofix previously used a pairwise swap strategy, where each --fix pass only swapped two adjacent out-of-order members. For a fully reversed object with N keys, this required up to N-1 passes of eslint --fix to reach a fully sorted state.

What changes did you make? (Give an overview)

I replaced the pairwise swap fixer with a segment-based sorting approach that fully sorts all keys in a single pass.

Related Issues

Fixes #222

Is there anything you'd like reviewers to focus on?

@eslint-github-bot eslint-github-bot Bot added the bug Something isn't working label May 5, 2026
@eslintbot eslintbot added this to Triage May 5, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

Bug: sort-keys autofix requires multiple passes

2 participants