Why this matters
Clarifies error handling and correct consumption patterns.
For async functions or functions returning Promise, document resolve value, rejection conditions, and usage with await; include @throws or @returns {Promise<Type>}.
Clarifies error handling and correct consumption patterns.
Side-by-side examples engineers can pattern-match during review.
/* Fetch user */
export async function getUser(id) { ... }/
* Get a user by ID.
* @param {string} id External user ID.
* @returns {Promise<User>} Resolves with user; rejects with NotFoundError.
/
export async function getUser(id) { ... }/* @returns {Promise<string>} /
export async function token(){ return 't'; }/* @returns {string} /
export async function token(){ return 't'; }From the same buckets as this rule.