VSCode VUE常用配置


{
   // vscode默認啟用了根據文件類型自動設置tabsize的選項
   "editor.detectIndentation"false,
   // 重新設定tabsize
   "editor.tabSize"2,
   // #每次保存的時候自動格式化
   "editor.formatOnSave"true,
   // #每次保存的時候將代碼按eslint格式進行修復
   "editor.codeActionsOnSave": {
     "source.fixAll.eslint"true
  },
   "emmet.syntaxProfiles": {
     "vue-html""html",
     "vue""html"
  },
   // 添加 vue 支持
   "eslint.validate": [
     "javascript",
     "javascriptreact",
     "vue",
     "html",
     "wxml",
     "typescript",
     "typescriptreact"
  ],
   "eslint.options": {
     "plugins": [ "html"]
  },
   //  #去掉代碼結尾的分號
   "prettier.semi"false,
   //  #使用單引號替代雙引號
   "prettier.singleQuote"true,
   "prettier.eslintIntegration"true// 讓prettier使用eslint的代碼格式進行校驗
   //  #讓函數(名)和后面的括號之間加個空格
   "javascript.format.insertSpaceBeforeFunctionParenthesis"true,
   // #這個按用戶自身習慣選擇
   "vetur.format.defaultFormatter.html""js-beautify-html",
   "vetur.format.defaultFormatter.js""prettier-eslint",
   "vetur.format.defaultFormatter.css""prettier",
   "vetur.format.defaultFormatter.postcss""prettier",
   "vetur.format.defaultFormatter.scss""prettier",
   "vetur.format.defaultFormatter.less""prettier",
   "vetur.format.defaultFormatter.stylus""stylus-supremacy",
   "vetur.format.defaultFormatter.ts""prettier",
   "vetur.format.defaultFormatterOptions": {
     // "prettier": {
     //   "semi": false
     // },
     "js-beautify-html": {
       // html元素行內不換行
       "wrap_line_length"0,
       "wrap_attributes""auto",
       "end_with_newline"false
       // #vue組件中html代碼格式化樣式
    }
  },
   "files.associations": {
     "*.cjson""jsonc",
     "*.wxss""css",
     "*.wxs""javascript",
     ".gitmodules""gitconfig",
     "*.vue""vue",
     "*.ts""typescript"
  },
   "emmet.includeLanguages": {
     "wxml""html"
  },
   "editor.suggestSelection""first",
   "explorer.confirmDelete"false,
   "javascript.updateImportsOnFileMove.enabled""always",
   "git.autofetch"true,
   "liveServer.settings.donotShowInfoMsg"true,
   "files.exclude": {
     "**/.classpath"true,
     "**/.project"true,
     "**/.settings"true,
     "**/.factorypath"true
  },
   "editor.wordWrap""on",
}


免責聲明!

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



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