1. Cancel automatic saving and set manual saving
ctrl+s
2. Save with automatic formatting and automatic correction
Based on the vscode plug-in ESLint highlights errors and automatically helps us fix them through configuration.
Open the settings page, click this to manually edit the settings, open setting.json, and add the following code
// 当保存的时候,eslint自动帮我们修复错误
"editor.codeActionsOnSave": {
"source.fixAll": true
},
// 保存代码,不自动格式化
"editor.formatOnSave": false
3. Demo
Not saved, not formatted
Saved, automatically formatted