Skip to content

jsdoc/require-returns Pedantic

What it does

Requires that return statements are documented. Will also report if multiple @returns tags are present.

Why is this bad?

The rule is intended to prevent the omission of @returns tag when necessary.

Examples

Examples of incorrect code for this rule:

javascript
/** Foo. */
function quux() {
  return foo;
}

/**
 * @returns Foo!
 * @returns Foo?
 */
function quux() {
  return foo;
}

Examples of correct code for this rule:

javascript
/** @returns Foo. */
function quux() {
  return foo;
}

References

Released under the MIT License.