JS Beautify: keep comment indents

I am currently using the js-beautify plugin for SublimeText2 and editing .jsbeautifyrc

. I was unable to find an attribute in the config documents that I think can be manipulated: keep indenting comments .

My desired output matches my original format:

// This comment isn't indented so I can fold all of the code it refers to
   function fooBar() {
      ... do stuff
   };

      

Comments can be nested within 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 have tried to keep_comment_indentation

no avail.

+3


source to share





All Articles