The following JS:
(function() {
\"use strict\";
$(\"#target\").click(function(){
console.log(\"clicked\");
});
}());
Yields:
All you need to do is set "jquery": true
in your .jshintrc
.
Per the JSHint options reference:
jquery
This option defines globals exposed by the jQuery JavaScript library.
You can also add two lines to your .jshintrc
"globals": {
"$": false,
"jQuery": false
}
This tells jshint that there are two global variables.
You probably want to do the following,
const $ = window.$
to avoid it throwing linting error.