Skip to content

Convention for documenting async functions #26

@mattcollier

Description

@mattcollier

Example code:

/**
 * cool documentation here
 *
 * @returns {object} The data returned with an `access_token`.
 */
async function getAuthToken(

@aljones15 says:

JsDoc automatically marks aync functions async when creating documents so the promise is redundant here.

This is a very cool JsDoc feature, but since we have very few modules with actually generated JsDocs, I am personally much more likely to read the docs directly in the code.

Does anyone else prefer the explicit/redundant syntax?

 * @returns {Promise<object>} The data returned with an `access_token`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions