如何自定义javascript的代码格式?

时间:2015-11-22 19:50:37

标签: visual-studio-code

例如,我需要括号和参数之间的空格:

var myPrivateMethod = function( name, value ) {
  for ( var i = 0, l = this.stack.lenght; i < l; i-- ) {
    this.stack[ i ][ name ] = value;
  }
};

vs默认VS Code JS格式

var myPrivateMethod = function (name, value) {
  for (var i = 0, l = this.stack.lenght; i < l; i--) {
    this.stack[i][name] = value;
  }
}

1 个答案:

答案 0 :(得分:0)

您可以查看visual studio代码的'美化'扩展程序:https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify

我不确定它是否能够在括号和参数之间添加空格,但它允许您自定义代码格式。

相关问题