vs code保存自動格式化配置


{
  // tab 大小為2個空格
  "editor.tabSize": 2,
  // 100 列后換行
  "editor.wordWrapColumn": 100,
  // 自動保存 關閉
  "files.autoSave": "off",
  // 保存時格式化
  "editor.formatOnSave": false,
  // 開啟 vscode 文件路徑導航
  "breadcrumbs.enabled": true,
  // prettier 設置語句末尾加分號 true 加分號 false 不加分好
  "prettier.semi": true,
  // prettier 設置強制單引號
  "prettier.singleQuote": true,
  // 選擇 vue 文件中 template 的格式化工具
  "vetur.format.defaultFormatter.html": "prettyhtml",
  // 顯示 markdown 中英文切換時產生的特殊字符
  "editor.renderControlCharacters": true,
  // 設置 eslint 保存時自動修復  和 editor.formatOnSave 選一即可 影響 function () {} 格式
  "eslint.autoFixOnSave": true,
  // eslint 檢測文件類型
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "html",
      "autoFix": true
    },
    {
      "language": "vue",
      "autoFix": true
    }
  ],
  // vetur 的自定義設置
  "vetur.format.defaultFormatterOptions": {
    "prettier": {
      "singleQuote": true,
      "semi": true
    }
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}

或者下面這個

{
"editor.fontSize": 20,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"java.configuration.checkProjectSettingsExclusions": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"workbench.iconTheme": "vscode-icons",
"java.semanticHighlighting.enabled": true,
"[javascript]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"git.autofetch": true,
"editor.quickSuggestions": null,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"vsicons.dontShowNewVersionMessage": true,
"files.associations": {
".cjson": "jsonc",
"
.wxss": "css",
"*.wxs": "javascript"
},
"emmet.includeLanguages": {
"wxml": "html"
},
"minapp-vscode.disableAutoConfig": true,
"editor.fontLigatures": null
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM