Problem background
When using vscode to automatically save, it is found that there is a problem with each save format.
Solution:
There are only a few storage formats
The saving format of vscode itself uses the saving format configured by eslint
so after analysis, the problem is clear at a glance.
After investigation,
it was originally set in vscode settings.json
"editor.formatOnSave": true,
Also set
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
In this way, the first save takes effect, but the second save uses other configurations, resulting in inconsistency between the two
handle
"editor.formatOnSave": true,
Just delete this configuration. When saving, you can only format it according to the eslint configuration.