Home >Development Tools >VSCode >How vscode automatically formats code

How vscode automatically formats code

王林
王林Original
2020-01-10 14:48:287730browse

How vscode automatically formats code

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

How vscode automatically formats code

2. Open settings

How vscode automatically formats code

3. Search for prettier in the search bar and click to edit in settings

How vscode automatically formats code

4. Add a formatting code when saving Statement

"editor.formatOnSave": true

How vscode automatically formats code

If an error occurs, it may be that there is no comma at the end of the previous statement, just add it

How vscode automatically formats code

Recommended related article tutorials: vscode tutorial

The above is the detailed content of How 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