How to disable the warning 'define' is not defined using JSHint and RequireJS

前端 未结 8 1626
温柔的废话
温柔的废话 2020-11-29 19:21

I uses RequireJS AMD in my project. When i run jshint on my project, it throws error like

In AMD Scripts

 \'define\' is not defined.
<
相关标签:
8条回答
  • 2020-11-29 19:53

    If you're trying to run JSHint in WebStorm with Mocha, as I am, go into:

    WebStorm > Preferences > Languages & Frameworks > JavaScript > Code Quality Tools > JSHint

    Scroll down to "Environments" and make sure you have selected the checkbox to enable "Mocha" which will set up the definitions for JSHint for Mocha for you.

    0 讨论(0)
  • 2020-11-29 19:54
    jshint: {
      options: {
        mocha: true,
      }
    }
    

    is what you want

    0 讨论(0)
提交回复
热议问题