Skip to content

JSDoc support for @yields #23857

Open
Open
@SergioMorchon

Description

@SergioMorchon

It would be nice to be able to use the @yields JSDoc tag.

We work with JS and JSDoc, but taking advantage of TSC and VSCode.
We also use the valid-jsdoc eslint rule.

We have:

/** @typedef Thing (...) */

function* walkThings() {
//... some yield here and there
}

We want to

/**
 * @yields {Thing}
 */
function* walkThings() {
//... some yield here and there
}

We can't do

/**
 * @returns {IterableIterator<Something>}
 */
function* walkThings() {
//... some yield here and there
}

Because it doesn't return, but yields, and eslint complains about it. We can disable the rule here, but it is not the desirable scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureDomain: JSDocRelates to JSDoc parsing and type generationSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions