Home>Article>Development Tools> How to format code in vscode
The method for vscode to format the code is:
First install Prettier -Code formatter in code[code formatter]
The second step is to open settings in the menu bar
The third step is to search Search prettier
Click to edit in settings
The fourth step is to add a statement to format the code when saving
"editor. formatOnSave": true
If an error occurs, it may be that there is no comma at the end of the previous statement
Just add it
Recommended tutorial: "vscode introductory tutorial"
The above is the detailed content of How to format code in vscode. For more information, please follow other related articles on the PHP Chinese website!