diff --git a/examples/simple-jsbeautifyrc/test.json b/examples/simple-jsbeautifyrc/test.json new file mode 100644 index 000000000..75f283d88 --- /dev/null +++ b/examples/simple-jsbeautifyrc/test.json @@ -0,0 +1,9 @@ +{ + "indent_size": 2, +"indent_char": " ", // test + "indent_level": 0, +"indent_with_tabs": false, /* test */ + "preserve_newlines": true, +"max_preserve_newlines": 2, /* test * + "jslint_happy": true +} diff --git a/lib/atom-beautify.js b/lib/atom-beautify.js index 7c9509ba1..14e145bbb 100644 --- a/lib/atom-beautify.js +++ b/lib/atom-beautify.js @@ -244,6 +244,9 @@ function beautify() { } switch (editor.getGrammar().name) { + case 'JSON': + // Treat JSON as JavaScript, because it will support comments. + // And Glavin001 has tested JSON beauifying with beautifyJS. case 'JavaScript': text = beautifyJS(text, getOptions('js', allOptions)); break;