How Can I Use Jslint For A Segment Of Code Which Depends On Jquery?
I'm relatively new to Javascript, and I'd like to run the piece of code I spent the weekend playing with through JSLint so that it can point out where I was being a total idiot :)
Solution 1:
If you're using the web version of jslint, you can simply add the $ object in the predefined option:

If you're using a local copy of jslint, you'd want to set the predef option to $ in the options object.
Solution 2:
In addition to Daniel's answer, you can "declare" $ on a per-file basis by including the following comment:
/*global $*/(Note: no space is allowed between /* and global.)
For web stuff you'll often also want to include window, i.e.
/*global $, window*/
Post a Comment for "How Can I Use Jslint For A Segment Of Code Which Depends On Jquery?"