settings.json

    1. {
    2. //设置文字大小
    3. "editor.fontSize": 16,
    4. //设置文字行高
    5. "editor.lineHeight": 24,
    6. //开启行数提示
    7. "editor.lineNumbers": "on",
    8. // 在输入时显示含有参数文档和类型信息的小面板。
    9. "editor.parameterHints.enabled": true,
    10. // 设置字体
    11. // "editor.fontFamily": "'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
    12. // 自动换行
    13. "editor.wordWrap": "on",
    14. // vscode默认启用了根据文件类型自动设置tabsize的选项
    15. "editor.detectIndentation": false,
    16. // 重新设定tabsize
    17. "editor.tabSize": 2,
    18. // #让函数(名)和后面的括号之间加个空格
    19. "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
    20. // #这个按用户自身习惯选择
    21. "vetur.format.defaultFormatter.html": "js-beautify-html",
    22. // #让vue中的js按编辑器自带的ts格式进行格式化
    23. "vetur.format.defaultFormatter.js": "vscode-typescript",
    24. // 保存时运行的代码ESLint操作类型。
    25. "editor.codeActionsOnSave": {
    26. // "source.fixAll.eslint": true
    27. "source.fixAll": true
    28. },
    29. // 添加emmet支持vue文件
    30. "emmet.includeLanguages": {
    31. "wxml": "html",
    32. "vue": "html"
    33. },
    34. // 两个选择器中是否换行
    35. "minapp-vscode.disableAutoConfig": true,
    36. //快速预览(右侧)
    37. "editor.minimap.enabled": true,
    38. // tab 代码补全
    39. "files.associations": {
    40. "*.wpy": "vue",
    41. "*.vue": "vue",
    42. "*.cjson": "jsonc",
    43. "*.wxss": "css",
    44. "*.wxs": "javascript"
    45. },
    46. // 用来配置如何使用ESLint CLI引擎API启动ESLint。 默认为空选项
    47. "eslint.options": {
    48. "extensions": [".js", ".vue"]
    49. },
    50. // 在onSave还是onType时执行linter。默认为onType。
    51. "eslint.run": "onType",
    52. // 启用ESLint作为已验证文件的格式化程序。
    53. "eslint.format.enable": true,
    54. // 语言标识符的数组,为此ESLint扩展应被激活,并应尝试验证文件。
    55. "eslint.probe": ["javascript", "javascriptreact", "vue-html", "vue", "html"],
    56. //关闭rg.exe进程 用cnpm导致会出现rg.exe占用内存很高
    57. "search.followSymlinks": false,
    58. // 给js-beautify-html设置属性隔断
    59. "vetur.format.defaultFormatterOptions": {
    60. "js-beautify-html": {
    61. "wrap_attributes": "force-aligned",
    62. "max_preserve_newlines": 0
    63. }
    64. },
    65. // style默认偏移一个indent
    66. "vetur.format.styleInitialIndent": true,
    67. // 定义匿名函数的函数关键字后面的空格处理。
    68. "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
    69. // 定义函数参数括号前的空格处理方式。
    70. "typescript.format.insertSpaceBeforeFunctionParenthesis": true,
    71. // 新版本消息
    72. "vsicons.dontShowNewVersionMessage": true,
    73. // 控制资源管理器是否在把文件删除到废纸篓时进行确认。
    74. "explorer.confirmDelete": true,
    75. // 使用eslint-plugin-vue验证<template>中的vue-html
    76. "vetur.validation.template": false,
    77. "workbench.colorTheme": "Darcula - WebStorm Edition",
    78. "workbench.iconTheme": "vscode-icons",
    79. "liveServer.settings.donotShowInfoMsg": true,
    80. "typescript.preferences.quoteStyle": "single",
    81. "[html]": {
    82. "editor.defaultFormatter": "vscode.html-language-features"
    83. },
    84. "[javascript]": {
    85. "editor.defaultFormatter": "dbaeumer.vscode-eslint"
    86. }
    87. }