I'm using the node-jshint command line to lint all of my JS files. I'm doing a reassignment of the $ by:
$ = someWindowObj.document.id;
and its giving me the error "Read Only." I am using Mootools so I am setting the option mootools to true. When I turn the option off in the file itself, via /*jshint mootools:false*/
I'm still getting the error. Shouldn't disabling the mootools (or jquery) option also disable the error? When I remove the mootools option completely from the ~/.jshintrc and the JS file, the error doesn't report.
I'm not sure if this is a bug or the intended behavior so I thought I put it to SO before submitting a bug.
In October 2013 jshint added a way to ignore blocks of code like this: // Code here will be linted with JSHint. /* jshint ignore:start */ // Code here will be ignored by JSHint. /* jshint ignore:end */ // Code here will be linted with JSHint. Show activity on this post. Show activity on this post.
If the project settings overwrite in-file settings you should file a bug report for the node-jshint project. In the meantime, you can always do /*global $:true */
. This tells JSHint that it is okay to overwrite $
global variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With