javascript - In VSCode, JSHint warns about missing semicolons - Stack Overflow

I am working on a JavaScript project. Visual Studio Code is my IDE and I see warnings about missing sem

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.

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.

Share Improve this question asked Sep 3, 2019 at 10:35 AbdollahAbdollah 5,1973 gold badges33 silver badges52 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743837803a4515708.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信