Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autofix for jsonc/sort-keys doesn't fix in 1 iteration #355

Closed
abejfehr opened this issue Jul 30, 2024 · 1 comment
Closed

Autofix for jsonc/sort-keys doesn't fix in 1 iteration #355

abejfehr opened this issue Jul 30, 2024 · 1 comment

Comments

@abejfehr
Copy link

I have very large translation files that should be alphabetized according to the jsonc/sort-keys rule, but they autofix doesn't work in 1 iteration.

For a particularly large JSON file, it takes hitting save many times before the file is finally in the order it needs to be in.

Here's a minimal-ish sample:

{
  "i::b::c": "",
  "i::a::l": "",
  "i::d::h": "",
  "i::d::l": "",
  "i::ap::mwd": "",
  "i::b::cc": "",
  "a::c::h::c": "",
  "a::c::h::e": "",
  "i::b::caj": "",
  "i::b::cac": "",
  "i::ap::av::l": "",
  "i::ap::mw::la": "",
  "a::c::pc::u": "",
  "a::c::pe::u": "",
  "a::c::vfi::u": ""
}

For the above file to be alphabetized, I have to hit save (which runs autofix) twice.

jsonc--sort-keys.mov
@ota-meshi
Copy link
Owner

That's a limitation of ESLint.
If your code requires many fixes, you may need to run autofixes multiple times.

@ota-meshi ota-meshi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2024
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

No branches or pull requests

2 participants