introductionIt is okay to add or not add a semicolon at the end of a js code sentence. Generally, when developing a team, a unified standard is required, either adding a semicolon or not. However, sometimes we can remember to add a semicolon, and sometimes we can't remember to add it. This will cause some of our codes to have semicolons and some not, which will be messy. To solve this problem, we can use a formatter to help us automatically add or remove semicolons at the end of sentences. The specific operation method is to type some js code first, and then use it to see the effect. If you have downloaded a lot of plug-ins and have a bunch of js formatters, then you need to configure the default formatter. Select Configure Default Formatter Select the js formatter that comes with VSCode Open Settings Open the settings json file Add a This attribute has three values. The first type "javascript.format.semicolons": "ignore", This is the default value of this property. When formatting, do not delete or add semicolons. It does not matter what happens. It is the same as when there is no configuration. I will not demonstrate it. The second "javascript.format.semicolons": "insert", When formatting, add a semicolon at the end of the sentence, the effect is as follows: The third type "javascript.format.semicolons": "remove", When formatting, no semicolon is added at the end of the sentence, and the effect is as follows: If you need other code formatting related configurations, you can send me a private message in the comment area. I may write a few more articles about formatting configuration in the future. This is the end of this article about how to automatically add or remove semicolons in VSCode formatted JS. For more information about VSCode formatted JS, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Docker executes a command in a container outside the container
>>: Using HTML web page examples to explain the meaning of the head area code
Let's take a look at the code file structure ...
Preface In fact, the humble "!" has man...
Usage Environment In cmd mode, enter mysql --vers...
Table of contents 1. Problem Description 2. Probl...
In the process of making web pages, it is inevita...
Table of contents 1. What is the use of provide/i...
Table of contents 1. Related configuration Case 1...
The operating system for the following content is...
Step 1: Install Stow In this example, we are usin...
Effective solution for Ubuntu in virtual machine ...
There is a question that has troubled web designe...
Pseudo-elements and pseudo-classes Speaking of th...
Process 1: with return value: drop procedure if e...
Preface When making a page, we often encounter co...
Mysql commonly used display commands 1. Display t...