Home > Development Tools > VSCode > body text

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

青灯夜游
Release: 2021-11-12 19:31:59
forward
4790 people have browsed it

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!

Related labels:
source:juejin.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!