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

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

This is the error I get when using const:



        
17条回答
  •  粉色の甜心
    2020-12-12 09:02

    If you're using VSCode:

    1.

    • Go to preferences -> settings (cmd + ,)
    • Type jshint.options into the search bar
    • Hover over it and click on the pencil icon
    • Its now appended on the right side.
    • Add "esversion": 6 to the options object.

    2.

    Or simply add this to your user settings:

    "jshint.options": {
        "esversion": 6
    }
    

    [UPDATE] new vscode settings

    • Go to preferences -> settings (cmd + ,)
    • type jshint into search

    • continue with step 2.

提交回复
热议问题