Use default
Prettier vscode save code auto format plug-in used by vscode
select formatonsave in vscode settings or modify it in setting.json
"editor.formatOnSave": true,
Use eslint for automatic formatting
Sometimes your front-end project uses eslint, which has automatic formatting configuration. We want to use the project’s own eslint configuration. We can use the format of eslint when saving automatically.
Let’s install the eslint plug-in first
Then set it in vscode
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
Add this configuration. In this way, the eslint configuration of the project itself will be used when saving.
Read More:
- Configure eslint in vscode to automatically repair and save the code
- After vscode installs ts, TSC compiles and generates JS, and an error is reported (repeated variables, etc.)
- The vscode installation plug-in liveserver specified browser reported an error and could not be found
- An error is reported when installing the package directly in pycharm, but it can be installed through the terminal. Error non zero exit code (2)
- Apache2 cannot be started and an error is reported for apache2.service failed because the control process exited with error code.
- When the mybatis field contains an expression, an error is reported when it is stored in the database
- An error of 500 is reported when an item is assigned to a role
- An error is reported when the less file is introduced into main.js
- When react devtools is enabled, an error is reported for the project
- Idea2021 reports an error. Default operand size is 64 sets the startup task to automatically add the registry
- An error is reported when executing MVN. The diamond operator is not supported in source-1.5
- After node.js is installed, use the instruction node version in vscode to show that it is not an external or internal instruction. The solution is as follows:
- An error is reported when you open HTTPS with the following error code: SSL_ error_ ssl_ Disabled) (solved)
- An error is reported when passing data pages using Ajax: Vue is not defined
- The imported package is gray and an error is reported
- When the spring MVC project is running on idea, an error is reported when the controller is a null pointer
- Exception record. When eclipse starts, an error is reported when workspace is opened
- When using freemaker template to get values, an error is reported when the attribute is empty
- An import error is reported in the python. The solution to setting. Pylintrc is invalid
- Vue failed to log in. F12 reported an error: request failed with status code 404