Question

In JSHint I would like to use the undef option. The issue I'm having is I have a variable that is declared in one file but is actually used in another piece. The variable holds an object of analytic tracking elements that I pass as a parameter to my code that initalizes the tracking code. The tracking code is a library that I would like to keep separate. The idea is just include this tracking code library. You then setup your element tracking object in your main js file and pass it as a parameter to the initlize method. JSHint flags this this tracking object as a defined but not used. How can I tell JSHint that the tracking object is actually used?

Was it helpful?

Solution

You need to add the exported directive

/*exported variableName */
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top