格式化代码 文件–>首选项–>设置–>setting.json
所以有三种方式更改默认的设置:
- 使用编辑器直接打开setting.json文件;
- 点击 VS Code 的 文件 > 首选项 > 设置 ,可以打开设置面板;
- 在 VS Code 中使用 Ctrl+Shift+P打开命令面板,输入Preferences: Open User Settings或Preferences: Open Workspace Settings。
vscode 安装下插件projectManager;eslint;prettier;vetur
image
image
{
"workbench.iconTheme": "material-icon-theme",
// #每次保存的时候自动格式化
"editor.formatOnSave": true,
"editor.wordWrap": "on",
"git.confirmSync": false,
"git.autofetch": true,
"terminal.integrated.rendererType": "dom",
"workbench.activityBar.visible": true,
"workbench.sideBar.location": "left",
"prettier.jsxBracketSameLine": true,
"prettier.trailingComma": "none",
"prettier.singleQuote": false,
"prettier.semi": true,
"files.autoSave": "off",
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
//"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"javascript.updateImportsOnFileMove.enabled": "always",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.updateImportsOnFileMove.enabled": "always",
"[javascript|react]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript|react]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"update.mode": "manual",
"diffEditor.ignoreTrimWhitespace": false
}
网友评论