-->

How can I get JSDoc to mark my param as a jQuery o

2020-08-09 08:13发布

问题:

I'm attempting to thoroughly comment my JavaScript and I'm using JSDoc. I have a function that consumes a jQuery object and I'd like to mark the parameter as such.

Currently, I have this:

/**
 * Initializes a login object.
 * @param formEl {JQuery} The login form element on the page.
 */
var login = function(formEl){ ... }

But JSDoc doesn't recognize (or properly format) "JQuery" as a variable type. Any help?

回答1:

According to http://code.google.com/p/jsdoc-toolkit/wiki/TagParam it should be

Param type before param name.

/**
 * Initializes a login object.
 * @param {jQuery} formEl The login form element on the page.
 */
var login = function(formEl){ ... }