When working with more than one .js file e.g. if I have a separate .js file that contains unit tests I start to see lots of warnings (I'm using the Eclipse plug-in) like the following where a .js file is referencing elements from another:
'<variable name>' is not defined
I can satisfy the warning and not break my code by including the following for any variables being used but are not within the physical .js file:
var myVariableReference = myVariableFromOtherFile || {};
The downside of course is that I have to keep repeating code such as the above in my unit tests files. For example as I am using a unit testing framework I would have to keep adding the inline variable 'references' for the functions that I'm using from the framework e.g:
var assertEquals = assertEquals || {};
var TestCase = TestCase || {};
Is there a way of configuring within eclipse so JsLint4Java scans the files as a whole? Or setting up 'Ignore' rules would be good so that I could avoid the repetitive variables as previously described.