-
-
Notifications
You must be signed in to change notification settings - Fork 167
Open
Labels
Description
Motivation
It is useful to declare types for @throws
and @yields
, @next
. For example:
/**
* @throws {TypeError} if `n` is not a number.
*/
function addOne(n) {
if (typeof n !== "number") throw new TypeError("param n is not a number");
return n + 1;
}
/**
* @yields {number}
* @next {string}
*/
function* gen() {
}
Current behavior
It doesn't care if it declares the type for @throws
and @yields
, @next
.
Desired behavior
Force the jsdoc to declare the type for @throws
and @yields
, @next
(or not).
Alternatives considered
These rules can be added by new rules (similar to require-param-type
, require-returns-type
, and require-property-type
), or just add an option type
to require-throws
and require-yields
because it is simpler.