Javascript undefined variables
I have .js files that depend on libraries–how do I make it so that JSLint/JSHint recognize that variables in my files have been defined in my libraries? I tried adding my libraries to my project as global libraries, and then making sure they are in the scope of my .js file, but it hasn't worked.
Please sign in to leave a comment.
So the only way is to let JSLint (JSHint) knows about all global variable names that are exported by a JavaScript library.
You can do this by filling "Predefined" field in JSLint/JSHint settings or by adding /*global */ comment in the header of a JavaScript file.