I use PhpStorm and it is giving me warnings when I define a parameter as a type jQuery with JSDoc.
I've tried to configure jQuery as a library, but it didn't seem to work.
This is my code:
/**
* @param {jQuery} $button
*/
function setActive($button)
{
// The code is working fine, but PhpStorm is giving the warning
// "Unresolved function or method addClass()" here.
$button.addClass("active");
// If I try to do this, no warning is displayed.
$("#test").addClass("test");
}
EDIT:
Some methods appear in the intellisense (I'm not sure why), but unfortunately addClass
isn't one of them.
$('body').
will it autocomplete with jQuery functions?