Home >Development Tools >VSCode >What should I do if vscode automatically completes commas when saving and reports an error? Brief analysis of solutions

What should I do if vscode automatically completes commas when saving and reports an error? Brief analysis of solutions

青灯夜游
青灯夜游forward
2021-11-11 10:58:524886browse

vscode will automatically complete commas at the end of some codes when saving, but this will report an error in some cases. How to solve such a problem? The following article will share a solution, I hope it will be helpful to everyone!

What should I do if vscode automatically completes commas when saving and reports an error? Brief analysis of solutions

Question:

Sometimes vscode will automatically complete commas at the end of some codes when saving. But this will cause an error in eslint strict mode! [Recommended learning: "vscode tutorial"]

Solution:

Add ## in setting.json #"trailingComma": "none"

(Similarly, adding and deleting semicolons/single quotes to double quotes can be set here)

ctrl shift p in vscode —— Search for 'User Settings' - Search for 'setting.json' - Click 'Edit in settings.json' (as shown in the picture) - Then add it (as shown in the picture)

What should I do if vscode automatically completes commas when saving and reports an error? Brief analysis of solutions

What should I do if vscode automatically completes commas when saving and reports an error? Brief analysis of solutions

For more programming-related knowledge, please visit:

Introduction to Programming! !

The above is the detailed content of What should I do if vscode automatically completes commas when saving and reports an error? Brief analysis of solutions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.cn. If there is any infringement, please contact admin@php.cn delete