vscode设置VUE eslint开发环境

我的使用vscode开发VUE的常用设置

1.安装插件

ESLint

Vetur

Beautify

Prettier - Code formatter

Auto Rename Tag -重命名标签,闭合标签自动修改

Auto Close Tag -自动生成闭合标签

2.配置 (设置保存文件时自动格式化成符合eslint规范的代码)  
文件》首选项》setting.json

{
  "editor.fontSize": 16,
  "typescript.referencesCodeLens.enabled": true,
  "typescript.implementationsCodeLens.enabled": true,
  "git.enableSmartCommit": true,
  "explorer.confirmDelete": false,

  // "window.zoomLevel": 1, // 窗口大小比例
  // "editor.tabSize": 2,
  // "editor.detectIndentation": false,
  // "emmet.triggerExpansionOnTab": true,
  // "update.channel": "none",
  "editor.formatOnSave": true, // eslint保存格式化
  "javascript.format.enable": false, // 不启动JavaScript格式化
  "prettier.eslintIntegration": true, // 让prettier遵循eslint格式美化
  "vetur.format.defaultFormatterOptions": {
    "prettier": {
      // 格式化不加分号
      "semi": false,
      // 格式化为单引号
      "singleQuote": true
    }
  },
  // 在方法括号之间插入空格
  //"javascript.format.insertSpaceBeforeFunctionParenthesis": true
}
View Code
原文地址:https://www.cnblogs.com/langhaoabcd/p/11344449.html