The project started as an Atom wrapper for js-beautify, but it should be treated independent to js-beautify now.
We already added a non-standard .jsbeautifyrc
(#9). I would recommend to deprecate the use of .jsbeautifyrc
right now and introduce a .atombeautifyrc
. This JSON file collects default settings which can be used for every language, but could be overridden for a specific language (and adds language-specific settings). Something like
{
"_default": {
"indent_size": 4,
"indent_char": " "
},
"html": {
"brace_style": "collapse",
"indent_scripts": "normal",
"indent_size": 6,
"max_preserve_newlines": 1,
"preserve_newlines": true,
"unformatted": ["a", "sub", "sup", "b", "i", "u"],
"wrap_line_length": 0
},
"css": {
"indent_size": 2
},
"js": {
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"jslint_happy": true
},
"sql": {
"indent_level": 0,
"indent_with_tabs": false
},
"python": { ... }
}
You could even exchange js-beautify for a different beautifier for JS at a later state or use different beautifier for CSS and HTML, but still use it just for JS.