解决了vscode编写vue快捷键格式化代码的相关问题
setting.json配置文件
{
“git.ignoreWindowsGit27Warning”: true,
“editor.fontSize”: 20,
“liveServer.settings.donotShowInfoMsg”: true,
// #每次保存的时候自动格式化
“editor.formatOnSave”: true,
“sass-loader”: “^7.3.1”,
“[json]”: {
“editor.quickSuggestions”: {
“strings”: true
},
“editor.suggest.insertMode”: “replace”
},
“terminal.integrated.shell.windows”: “C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe”,
“explorer.confirmDelete”: false,
“vetur.experimental.templateInterpolationService”: false,
“vetur.ignoreProjectWarning”: true,
“vetur.validation.template”: false,
“window.zoomLevel”: 1,
“workbench.colorTheme”: “Monokai”,
“editor.tabSize”: 2,
“typescript.format.insertSpaceBeforeFunctionParenthesis”: false,
// 让函数(名)和后面的括号之间加个空格
“[javascript]”: {
“editor.defaultFormatter”: “vscode.typescript-language-features”
},
“javascript.format.insertSpaceBeforeFunctionParenthesis”: true,
“tslint.autoFixOnSave”: true,
“vetur.completion.autoImport”: true,
“vetur.format.defaultFormatter.html”: “js-beautify-html”,
“vetur.format.defaultFormatter.js”: “vscode-typescript”
}
.prettierrc文件:
{
“semi”: false,
“singleQuote”: true,
“printWidth”: 200, // 超过最大值换行
“htmlWhitespaceSensitivity”: “ignore”,
“trailingComma”: “none”,
“jsxBracketSameLine”: true,
“stylelintIntegration”: false,
}
很开心