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

 


免責聲明!

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



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