Why does JSHint throw a warning if I am using const?

后端 未结 17 2971
眼角桃花
眼角桃花 2020-12-12 08:18

This is the error I get when using const:



        
17条回答
  •  一整个雨季
    2020-12-12 08:50

    You can add a file named .jshintrc in your app's root with the following content to apply this setting for the whole solution:

    {
        "esversion": 6
    }
    

    James' answer suggests that you can add a comment /*jshint esversion: 6 */ for each file, but it is more work than necessary if you need to control many files.

提交回复
热议问题