Skip to content

Files

Latest commit

 

History

History
36 lines (29 loc) · 607 Bytes

require-yields.md

File metadata and controls

36 lines (29 loc) · 607 Bytes

Pattern: Missing yield documentation

Issue: -

Description

Generator functions that yield values must document those values with a @yields tag. Multiple @yields tags on the same function are not allowed.

Examples

Example of incorrect code:

function* getData() {
  yield "first";
  yield "second";
}

/**
 * @yields {string} First value
 * @yields {string} Second value
 */
function* getValues() {
  yield "value";
}

Example of correct code:

/**
 * @yields {string} Sequential string values
 */
function* getData() {
  yield "first";
  yield "second";
}