eslint/doctrine

Uncaught `param` syntax error

Closed this issue · 1 comments

When I try to use the library to parse this syntax it doesn't thow any error:

/**
* @param fields [Array]
*/
function crashIt() {
     return "";
}

But for the below syntax it does throw an syntax error:

/**
* @returns fields [Array]
*/
function crashIt() {
     return "";
}

Is the top @param syntax correct?

You should place type before the name like this:

/**
 * @param {Array} fields
 */
function crashIt() {
    return "";
}

Here you can read full documentation for @param, the same for @returns