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

前端 未结 8 1688
温柔的废话
温柔的废话 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.

提交回复
热议问题