.vscode/settings.json

{
    // editor
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    },
    "editor.tabSize": 2,
    "editor.insertSpaces": true,
    "editor.detectIndentation": true,
    "editor.defaultFormatter": "vscode.typescript-language-features",
    "[javascript]": {
      "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "[typescript]": {
      "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "[vue]": {
      "editor.defaultFormatter": "octref.vetur"
    },
    "[css]": {
      "editor.defaultFormatter": "vscode.css-language-features"
    },
    "[html]": {
      "editor.defaultFormatter": "vscode.html-language-features"
    },
    "[json]": {
      "editor.defaultFormatter": "vscode.json-language-features"
    },
    "[less]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
  
    //javascript
    "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
    "javascript.format.semicolons": "insert", // 要设置 vscode.typescript-language-features
  
    //eslint
    "eslint.format.enable": false,
    "eslint.validate": [
      "javascript",
      "javascriptreact",
      "vue",
      "typescript",
      "typescriptreact"
    ],
  
    //vetur
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatterOptions": {
      "js-beautify-html": {
        "wrap_attributes": "force-aligned"
      }
    },
    "vetur.validation.template": false
  }
  

改.gitignore文件:
步骤一:
删除原来的.vscode
步骤二:
在文件末尾新增
.vscode/*
!.vscode/settings.json

posted @ 2022-02-14 11:20  彭成刚  阅读(89)  评论(0编辑  收藏  举报