Visual Studio Code保存代码时自动修复样式

在VsCode 的"文件"-“首选项”-“设置”中settings.json 这样配置:

{
  "git.autofetch": true,
  "window.zoomLevel": 0,
  "editor.fontSize": 16,
  "javascript.updateImportsOnFileMove.enabled": "always",
  "editor.detectIndentation": false, 
  "editor.tabSize": 2, // 重新设定tabsize
  "editor.formatOnSave": true, // #每次保存的时候自动格式化
  "editor.codeActionsOnSave": { // #每次保存的时候将代码按eslint格式进行修复
    "source.fixAll.eslint": true
  },
}

前天是安装好eslint插件。

你可能感兴趣的:(web前端)