mxmvshnvsk / i18n-unused

The static analyze tool for finding, marking and removing unused and missing i18n translations in your JavaScript project
MIT License
127 stars 21 forks source link

Add option for JSON indent value #29

Closed alexbbt closed 1 year ago

alexbbt commented 1 year ago

This creates a new RunOption for jsonFileIndentValue. This allows controlling how the output json is generated. The current default was 2 and that is preserved in this new option, but now allows overriding with 4 or even '\t' to get tabs.

I added a helper function to wrap the json file writing, then added a test suite to validate the output.

Let me know if you think this should change at all, I am not too sure about the option name.

mxmvshnvsk commented 1 year ago

Hi, thanks for your pr. I think it's good idea. About option name, rename it from jsonFileIndentValue to localeJsonStringifyIndent, I think this name describe what this option do.

alexbbt commented 1 year ago

Oh nice, that's a much better name!

mxmvshnvsk commented 1 year ago

Thx, your changes now available in v0.12.0 =)