安装 Prettier - Code formatter
After prettier is installed, the shift+alt+f
code can be formatted after use .
If you need to save automatically, you "editor.formatOnSave": true
can save it automatically by adding it in the system settings .
However, if "files.autoSave": "autoSaveDelay",
save and format are set at the same time, it will be invalid. files.autoSave
It can be configured into other options.
In addition, if the project is configured with .editorConfig
files, after the configuration "editor.formatOnSave": true
, if the project members do not install the Prettier plug-in, the .editorConfig
file will be read when saving, and the code can also be formatted. After enabling the Prettier plugin, .editorConfig
the configuration will be invalid and .prettierrc
the configuration of the read file