jshint - firefox addon - 'self' is not defined -


i'm writing basic firefox addon , jshint complains self not being defined.

i use self in content script that:

self.port.emit("message", "payload"); 

i tried setup moz options in .jshint.rc file still error. should add 'self' in 'globals' in .jshint.rc or missing else?

assuming self global variable provided environment yes, need add globals directive. can either in .jshintrc config file:

{   "globals": {     "self": false   } } 

or inline in file itself:

/*globals self: false */ 

the false in examples above tell jshint variable read-only. attempt assign trigger warning. if need assign can use true instead.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -