JS Beautify:保留评论缩进

时间:2014-12-03 18:55:08

标签: javascript sublimetext2 js-beautify

我目前正在使用SublimeText2的js-beautify插件并编辑.jsbeautifyrc。我无法在配置文档中找到我认为可操作的属性:保留评论缩进

我想要的输出符合我的初始格式:

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

评论可能嵌套在另一个函数中:

var fooBar = fooBar || (function() {
// Unindented comment for folding
   function fooBar() {
      ... do stuff
   };
}());

或者在嵌套对象/数组中:

foo: {
// Another unindented comment for folding
  bar: {
    ... more stuff
  },
// Yet another unindented comment
  baz: [
    ... even more stuff
  ]
}

我试过keep_comment_indentation无济于事。

0 个答案:

没有答案