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

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

This is the error I get when using const:



        
17条回答
  •  伪装坚强ぢ
    2020-12-12 09:02

    For SublimeText 3 on Mac:

    1. Create a .jshintrc file in your root directory (or wherever you prefer) and specify the esversion:
        # .jshintrc
        {
          "esversion": 6
        }
    
    1. Reference the pwd of the file you just created in SublimeLinter user settings (Sublime Text > Preference > Package Settings > SublimeLinter > Settings)
        // SublimeLinter Settings - User
        {
          "linters": {
            "jshint": {
              "args": ["--config", "/Users/[your_username]/.jshintrc"]
            }
          }
        }
    
    1. Quit and relaunch SublimeText

提交回复
热议问题