vs code 代码格式化

淺唱寂寞╮ 提交于 2019-12-18 12:06:52

1.打开vs code > 文件 > 首选项 > 设置 > 将下面一段粘贴在右侧即可

 

// Place your settings in this file to overwrite the default settings
{
"python.formatting.provider": "yapf",
"view-in-browser.customBrowser": "chrome",
 
"files.associations": {
"*.vue": "vue"
},
"eslint.options": {
"extensions": [
".js",
".vue"
]
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true
},
"emmet.syntaxProfiles": {
"javascript": "jsx",
"vue": "html",
"vue-html": "html"
},
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
// 窗口失去焦点自动保存
"files.autoSave": "off",
// 编辑粘贴自动格式化
"editor.formatOnPaste": true,
// 控制字体系列。
// "editor.fontFamily": "pingfang,Menlo, Monaco, 'Courier New', monospace",
 
// 通过使用鼠标滚轮同时按住 Ctrl 可缩放编辑器的字体
"editor.mouseWheelZoom": false,
// 行太长自动换行
"editor.wordWrap": "on",
//Windows bash终端"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
// 主体
"workbench.colorTheme": "Monokai",
"workbench.iconTheme": "vs-seti",
// eslint设置
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
"vue",
{
"language": "vue",
"autoFix": true
}
],
// 保存自动修复
"eslint.autoFixOnSave": true,
// tab锁紧
"editor.tabSize": 2,
// 保存自动化
"editor.formatOnSave": true,
// 空格变成......
"editor.renderWhitespace": "all",
"window.zoomLevel": 0,
"vetur.format.defaultFormatter.html": "js-beautify-html"
}

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!