beautifier / js-beautify

Beautifier for javascript
https://beautifier.io
MIT License
8.63k stars 1.38k forks source link

Different beautification for js and json #729

Open thaiat opened 9 years ago

thaiat commented 9 years ago

Is there a way to have different beautification rules for .js and .json files in the same .jsbeautifyrc file. For example my use case is 4 indent_size for js and 2 for json

bitwiseman commented 9 years ago

Interesting idea, I like it. But sorry, it's not in there right now. You can work around by assigning the value on the command-line when you calll the beautifier.

This shouldn't be too hard to do, but there are a number of higher priority feature ahead of it.

olsonpm commented 9 years ago

@thaiat not sure your use-case, but in case you're looking for a temporary work-around - I use another library for json formatting. jsonlint to be exact

thaiat commented 9 years ago

@olsonpm does it have an integration with sublime ? My use case is that i use HTML/CSS/JS Prettify plugin in sublime and before i save the file i do Shift+Cmd+H to run beautify on the current file.

olsonpm commented 9 years ago

I don't use sublime, but this package seems like it fits your needs:

https://packagecontrol.io/packages/Pretty%20JSON

thaiat commented 9 years ago

@olsonpm nice thks!!!

bitwiseman commented 8 years ago

Related: #391.