需要添加的插件是ESLint,Vetur,Prettier
{
// 强制单引号
"prettier.singleQuote": true,
// 开启 eslint 支持
"prettier.eslintIntegration": true,
// 保存时自动fix
"eslint.autoFixOnSave": true,
// 添加 vue 支持
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "vue",
"autoFix": true
}
],
// 格式化插件的配置
"vetur.format.defaultFormatterOptions": {
"prettyhtml": {
"printWidth": 160, // No line exceeds 160 characters
"singleQuote": false // Prefer double quotes over single quotes
},
"prettier": {
"printWidth": 160,
"semi": false,
"singleQuote": true
}
},
"editor.formatOnSave": true,
"workbench.colorTheme": "Monokai",
"explorer.confirmDelete": false,
"git.enableSmartCommit": true,
"git.confirmSync": false,
"prettier.semi": false,
"editor.multiCursorModifier": "ctrlCmd",
"explorer.confirmDragAndDrop": false,
"git.autofetch": true
}