vscode-Prettier plugin unified code style specification, save automatically formatted code

安装 Prettier - Code formatter

After prettier is installed, the shift+alt+fcode can be formatted after use .

If you need to save automatically, you "editor.formatOnSave": truecan 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.autoSaveIt can be configured into other options.

In addition, if the project is configured with .editorConfigfiles, after the configuration "editor.formatOnSave": true, if the project members do not install the Prettier plug-in, the .editorConfigfile will be read when saving, and the code can also be formatted. After enabling the Prettier plugin, .editorConfigthe configuration will be invalid and .prettierrc the configuration of the read file

 

Guess you like

Origin www.cnblogs.com/500m/p/12710166.html