settings.json 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {
  2. "workbench.settings.useSplitJSON": true,
  3. // vscode默认启用了根据文件类型自动设置tabsize的选项
  4. "editor.detectIndentation": false,
  5. // 重新设定tabsize
  6. "editor.tabSize": 2,
  7. // #每次保存的时候自动格式化
  8. // "editor.formatOnSave": true,
  9. // #每次保存的时候将代码按eslint格式进行修复
  10. "editor.codeActionsOnSave": {
  11. "source.fixAll.eslint": true
  12. },
  13. // 添加 vue 支持
  14. "eslint.validate": [
  15. "javascript",
  16. "javascriptreact",
  17. "typescript",
  18. "vue"
  19. ],
  20. // #去掉代码结尾的分号
  21. "prettier.semi": true,
  22. // #使用单引号替代双引号
  23. "prettier.singleQuote": true,
  24. // #让函数(名)和后面的括号之间加个空格
  25. "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
  26. // #这个按用户自身习惯选择
  27. "vetur.format.defaultFormatter.html": "js-beautify-html",
  28. // #让vue中的js按编辑器自带的ts格式进行格式化
  29. "vetur.format.defaultFormatter.js": "vscode-typescript",
  30. "vetur.format.options.tabSize": 2,
  31. "vetur.format.defaultFormatterOptions": {
  32. "js-beautify-html": {
  33. "wrap_line_length": 150,
  34. "wrap_attributes": true,
  35. "end_with_newline": true
  36. // #vue组件中html代码格式化样式
  37. }
  38. }
  39. }