Skip to content

Don't require @returns when an async function is returning a Promise (require-returns) #452

Closed
@yvele

Description

@yvele

This function is returning a Promise and is already defined as async:

/**
 * @param {array} a
 */
async function foo(a) {
  return Promise.all(a);
}

I get the following error:

Missing JSDoc @returns declaration

That doesn't make any sense.. all async functions are "returning" a Promise anyway... I don't want to add an anemic @returns {Promise} declaration. This is redundant with async anyway.

Is it possible to handle this use case?

Note that the legacy native ESLint JSDoc rule was handing this use case

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions