jsdoc/require-yields-check
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/require-yields-check": "error",
},
},
];Ensures that if a @yields is present that a yield (or yield with a value) is present in the function body (or that if a @next is present that there is a yield with a return value present).
/**
* @yields
*/
function * quux (foo) {/**
* @yields Foo.
*/
function * quux () {Examples from the ESLint documentation.
jsdoc/require-yields-check
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/require-yields-check": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Requires a return statement in function body if a @returns tag is specified in JSDoc comment(and reports if multiple @returns tags are present).
Reports invalid alignment of JSDoc block asterisks.
Controls how and whether JSDoc blocks can be expressed as single or multiple line blocks.
Requires that all function parameters are documented with a @param tag.
Reports types deemed invalid (customizable and with defaults, for preventing and/or recommending replacements).
This rule checks the values for a handful of tags: @version, @since, @license and @author.