I have a module that I'm using elsewhere, but I keep getting "module is not defined." It works if I use the global directive but that implies that the module is defined elsewhere. Is there any way to fix this issue? Thank you
In module.js
/* exported module */
var module = (function($){
...
return {method: method};
})($);
$(module.method);
In foo.js
var foo = function() {
function bar() {
module.method();
}
};
$(foo);
In my case didn't work, thus, I injected next piece of code:
/* globals module: false */
You can also do the following in your jshint.rc
"jshint_options":
{
"globals": {
"module": false
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With