关于vscode配置相关文章(方便作者之后复习):
1-1 下载Beautify插件
该插件已停止维护,输入下载其他插件
1-2 在setting.json文件中完成相关配置
1、 打开setting.json文件
2、 在setting.json进行配置
"beautify.language": {
"js": {
"type": [
"javascript",
"json",
],
"filename": [".jshintrc", ".jsbeautifyrc"]
},
"css": [
"css",
"less",
"scss"
],
"html": [
"htm",
"html",
"vue"
]
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.format.enable": true,
"eslint.validate": [
"javascript",
"vue",
"html"
],
"vetur.format.defaultFormatter.js": "none",
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
}
3、 记得重启vscode!!! 4、 按快捷键alt+shift+f格式化代码就可以了
1-3 记录12.24的setting.json配置
{
"eslint.options": {
"extensions": [
".js",
".vue"
]
},
"eslint.validate": [
"javascript",
{
"language": "vue",
"autoFix": true
},
"html",
"vue"
],
"eslint.autoFixOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.codeAction.disableRuleComment": {},
"eslint.alwaysShowStatus": true,
"window.zoomLevel": -2,
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"workbench.colorTheme": "Default Light+",
"beautify.language": {
"js": {
"type": [
"javascript",
"json",
],
"filename": [".jshintrc", ".jsbeautifyrc"]
},
"css": [
"css",
"less",
"scss"
],
"html": [
"htm",
"html",
"vue"
]
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.format.enable": true,
"eslint.validate": [
"javascript",
"vue",
"html"
],
"vetur.format.defaultFormatter.js": "none",
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}
|