-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add option to set JSON indentation depth #231
Comments
I'll merge a PR implementing this :) |
Thanks :)
That sound also like a good idea. Maybe both? You can either set a number or a string containing a formatter wich then gets mapped to a number? |
I think one of the two is better? I can go with either! |
Well the naming sure is a problem indeed. I guess then when both options are being implemented two separate options should be created, but then there would be the issue of which takes precedence and so on. So yeah, I guess one would be better? But when only one is implemented I would propose to take the more general one with What do you think? |
Well,
This is using something like https://www.npmjs.com/package/json-beautify |
Ah ok, I had a different approach in mind. I thought that the formatter option would just be a string, which then would get mapped into a number. But your approach is much better. Yes with this I would agree with you, that this would be the more general option. I like it. |
I hit the same problem with prettier vs the converter. Would also like to see this. |
this matches what i18n-conv does, and avoids thrash See i18next/i18next-gettext-converter#231
this matches what i18n-conv does, and avoids thrash See i18next/i18next-gettext-converter#231
🚀 Feature Proposal
Add an option to specify the indentation of the JSON file when converting from po to JSON files.
Motivation
I use a simple custom script which uses i18next-conv to convert my po files to JSON files. I also use prettier for auto-formatting via pre-commit. prettier by default indents JSON files by 2 spaces, but i18next-conv creates them with 4 spaces. Thus the pre-commit hook fails once because of this.
If there was the option to set the indentation to 2 this issue would be resolved.
Example
The indentation would be able to be set via CLI and the API in custom scripts.
The text was updated successfully, but these errors were encountered: