问题
How do I alert jshint that I have globals, i.e. name them. I know you can do this, but I don't recall the syntax.
I defined a global here like this
(function(){window.glob1 = local_var;})()
and use later like this: ( a different IIFE )
(function(){glob1 // does something})()
jshint is saying it was used before it was defined.
It's not a flag, there is actually a way to list global variables by name.
回答1:
Do you mean the syntax
/* global window, console, jQuery */
... at the beginning of the each JS file?
来源:https://stackoverflow.com/questions/12574203/jslint-configuration-passing-globals