Skip to content

feature: Comma-first JSON #1977

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

Open
1 task done
juliancoffee opened this issue Apr 16, 2025 · 0 comments
Open
1 task done

feature: Comma-first JSON #1977

juliancoffee opened this issue Apr 16, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@juliancoffee
Copy link

Did you check the docs?

  • I have read all the lazy.nvim docs

Is your feature request related to a problem? Please describe.

Ok, so lazylock.json is very nice, but it doesn't diff well. Because JSON doesn't allow trailing commas, each new plugin adds a comma to the previous line and adds its own line, so you have two lines changed.
Which is fine, but not perfect.
If you store your lazylock.json in git with dotfiles, it'll produce confusing diffs.

Describe the solution you'd like

{ "blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" }
, "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }
, "conform.nvim": { "branch": "master", "commit": "eebc724d12c5579d733d1f801386e0ceb909d001" }
, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }
, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }
}

Provide the option to use comma-first.
Looking at my example, I guess I might have overestimated (and underestimated) the problem a bit because lazylock is always sorted alphabetically, so that might be an option to tweak as well.

Describe alternatives you've considered

Just living with it as it is, I guess

Additional context

No response

@juliancoffee juliancoffee added the enhancement New feature or request label Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant