Respect existing i18n.json formatting to avoid unnecessary PRs
What
Our CLI's JSON serializer, that handles reads/writes of the i18n.json, overwrites i18n.json with a default format, ignoring existing formatting from tools like Prettier, that user's repo might have.
This triggers useless PRs with only format changes when used with GitHub Actions. Example: https://github.com/calcom/cal.com/pull/16505/files
Originally, we fixed that in #195 by not rewriting i18n.json when there's no meaningful changes made in it. However, the update still happens when @lingodotdev team upgrades the i18n.json structure design, and that breaks the formatting.
Replexica CLI must respect the style guide of the user's repo.
Why
- Prevents noise in PRs and commit history
- Respects user's existing code style choices
- Improves compatibility with popular formatting tools
- Reduces confusion and manual work for users
How
- Detect existing formatting in i18n.json (indentation, quote style, etc.)
- Update our JSON serializer to preserve detected formatting
- If no clear format is detected, fall back to our default
- Test with popular formatting tools (Prettier, EditorConfig, etc.)
- Update docs to mention this behavior
hey, I would like to work on this issue.
@maxprilutskiy working on it using prettier to resolve the format but the issue is the function is an async one so should I introduce promises to handle if it's okay with the project?
This would be great if it could be fixed, We use prettier, and i suspect most in the js ecossystem do.