Reputation: 5177
I am working on a JavaScript project. Visual Studio Code is my IDE and I see warnings about missing semicolons at the end of lines. The warnings are generated by JSHint. Since having semicolons at the end of lines is optional, I want to get rid of these warnings.
Upvotes: 4
Views: 6126
Reputation: 5177
JSHint has an option that suppresses warnings about missing semicolons called asi
. Open VSCode settings (Ctrl + ,), search jshint options
and click on Edit in settings.json
Add the following to settings.json
:
"jshint.options": {
"asi": true
}
If you already have "jsint.options"
in your settings.json
, simply just add "asi": true
inside it.
Note:
You can edit settings.json
for User
or Workspace
. In the image, you see that User
tab (indicated by a red 1) is selected. In this mode, any change in settings.json
affects all VSCode projects. If you want to apply this change only on this project, first select Workspace
tab (indicated by a red 2) and then click on Edit in settings.json
.
Upvotes: 11