jshint-globals
Use predefined jshint globals.
Problem
If you have many Javascript projects and need to define jshint globals and use them in a grunt task e.g. grunt-contrib-jshint. There should be a much easier way to reuse these globals between projects. And there should be an option to download already pre-defined globals.
Solution
With jshint-globals
you can easily use predefined or reuse you old globals.
Install jshint-globals
:
npm install jshint-globals --save-dev
Just require jshint-globals
:
var jshintGlobals = ;
insert into the globals properties in your grunt-contrib-jshint
task option:
jshint : options : globals :
the above equals:
jshint : options : globals : variable1 : true variable2 : true nestedVariable1 : true nestedVariable2 : true
Use array instead of object:
jshint : options : globals :
the above equals:
jshint : options : globals : variable1 : true variable2 : true nestedObjectVariable1 : true nestedObjectVariable2 : true nestedArrayVariable1 : true nestedArrayVariable2 : true
Use pre-defined globals
var jshintGlobals = ;var browser = jshintGlobalsbrowser; ... jshint : options : globals :
the above equals:
jshint : options : globals : variable1 : true variable2 : true open : true document : true navigator : true ...
Available globals
var browser = browser;var _requirejs = requirejs;var mocha = mocha
Please check the source for all globals defined in each category