I'm currently using the js-beautify plugin for SublimeText2 and editing the .jsbeautifyrc
. I was unable to find an attribute in the config docs that I think is manipulable: preserve comment indentation.
My desired output matches my initial format:
// This comment isn't indented so I can fold all of the code it refers to
function fooBar() {
... do stuff
};
Comments may be nested in another function:
var fooBar = fooBar || (function() {
// Unindented comment for folding
function fooBar() {
... do stuff
};
}());
Or in a nested object/array:
foo: {
// Another unindented comment for folding
bar: {
... more stuff
},
// Yet another unindented comment
baz: [
... even more stuff
]
}
I tried keep_comment_indentation
to no avail.