Home >Development Tools >VSCode >vscode automatically formats code

vscode automatically formats code

王林
王林Original
2020-02-07 14:45:376702browse

vscode automatically formats code

First install Prettier -Code formatter [code formatter] in code

vscode automatically formats code

The second step is to open it in the menu bar Settings

vscode automatically formats code

The third step is to search prettier in the search bar, click to edit in settings

vscode automatically formats code

The fourth step is to add one Statement for formatting code when saving

"editor.formatOnSave": true

vscode automatically formats code

If an error occurs, it may be in the previous one There is no comma at the end of the statement

Just add it

vscode automatically formats code

Recommended related articles and tutorials: vscode tutorial

The above is the detailed content of vscode automatically formats code. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn