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

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


Just to expand a bit, here's a .jshintrc setup for Mocha:

{  ....  "globals"   : {    /* MOCHA */    "describe"   : false,    "it"         : false,    "before"     : false,    "beforeEach" : false,    "after"      : false,    "afterEach"  : false  }}

From the JSHint Docs - the false (the default) means the variable is read-only.

If you are defining globals only for a specific file, you can do this:

/*global describe, it, before, beforeEach, after, afterEach */


jshint: {  options: {    mocha: true,  }}

is what you want


To avoid the not defined warning in jshint for the javascript add comments like:

/*global describe:true*/

Options