jslint configuration | passing globals

故事扮演 提交于 2019-12-23 11:56:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!