what prettier??

Prettier prettier is the most popular code formatting tool for editing code when saving it in an editor, where editing code automatically formatting code, especially when used with ESLint, saves time

Using a prettier

Linter /formatter,ESLint+Prettier when creating πŸ’° for VUE

1. Search for prettier in the plugin market for vscode to install

2. Prettierrc file in vscode, prettierrc file in json, prettier, prettier, prettier, prettier, prettier, prettier, prettier, prettier

3. Then configure the format in vscode.It is important to note that vscode configuration is divided into two parts: user and workspace. The user area represents that all projects will use your configuration after configuration, while workspace is effective for the current projectI recommend selecting the format on save option in the workspace, and vscode will generate a.vocode directory with a settings.json file that contains the format configuration for the current project.

4. After the above configuration, press Save to automatically format the code. If the code cannot be formatted, or the TS file cannot be formatted, please refer to this:

5. If you have used the webstore editor before, it will automatically save the code, very convenient, currently in vscode has a similar feature. For example, if I select the onWindowChange option, the code will automatically save when I switch Windows when the window loses focus.