I worked with JSLint today to clean up my local code. While cleaning, I encountered a parameter name that had underscore in its name. JSLint didn’t like this and complained. Since this parameter name was used to communicate with the server and could not be changed, I needed to set an exception in the JavaScript file. This led me to the options section of this page. All I had to do was adding the following line at the beginning of the JavaScript file and JSLint stopped complained about the issue:
/*jslint sub: true */
Cool site, love the info.
Thank you for sharing.
I also run into an issue where I write code using jQuery (and $) and linting keep reminding me that “$ is not defined”. I looked at the documentation and found the option “global” which in my case is placed in the top of the javascript file like this:
/*global jQuery, $ */
Then I do not get error messages about those two objects being defined.