{"record":{"id":"063c2372c028beba","repo":"oxc-project/oxc","slug":"missing-jsdoc-yields-description","errorCode":null,"errorMessage":"Missing JSDoc `@yields` description.","messagePattern":"Missing JSDoc `@yields` description\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/jsdoc/require_yields_description.rs","lineNumber":12,"sourceCode":"use oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::Span;\n\nuse crate::{\n    context::LintContext,\n    rule::Rule,\n    utils::{should_ignore_as_internal, should_ignore_as_private},\n};\n\nfn require_yields_description_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Missing JSDoc `@yields` description.\")\n        .with_help(\"Add description comment to `@yields` tag.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct RequireYieldsDescription;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Requires a description for `@yields` tags.\n    ///\n    /// ### Why is this bad?\n    ///\n    /// A `@yields` tag should explain what the generator yields.\n    ///\n    /// ### Examples\n    ///","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/jsdoc/require_yields_description.rs#L1-L30","documentation":"This is the oxlint `jsdoc/require-yields-description` diagnostic. It fires when a generator's `@yields` tag has no free-text description (e.g. only `@yields {Row}`). It mirrors `require-returns-description` but for generator yield values.","triggerScenarios":"A function's attached JSDoc contains a `@yields` tag with empty comment text after the tag/type. Private/internal-tagged blocks and custom skips are exempt per JSDoc settings.","commonSituations":"Teams that add `@yields {T}` types to satisfy `require-yields-type` but never write prose; enabling the whole jsdoc plugin's `require-*` family at once.","solutions":["Describe what is yielded: `@yields {Chunk} Decoded chunk of the stream.`","Exempt the block with `@private`/`@internal` when appropriate.","Disable `\"jsdoc/require-yields-description\"` if type-only yields docs are your convention."],"exampleFix":"// before\n/**\n * @yields {number}\n */\nfunction* fib() { /* ... */ }\n\n// after\n/**\n * @yields {number} The next Fibonacci number.\n */\nfunction* fib() { /* ... */ }","handlingStrategy":"validation","validationCode":"// Flag @yields tags with no description text\nconst src = require('fs').readFileSync(file, 'utf8');\nconst bare = /@yields?(?:\\s+\\{[^}]*\\})?\\s*$/m.exec(src);\nif (bare) console.error('jsdoc/require-yields-description will fire:', file);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write `@yields {Type} description` as a single habit so both yield rules pass.","Include yield docs in generator code-review checklists.","Keep oxlint wired into CI/pre-commit."],"tags":["jsdoc","generator","documentation","lint","oxlint"],"backgroundTag":"jsdoc-yields-tag-missing","analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}