Requires returns are documented.
Will also report if multiple @returns
tags are present.
exemptedBy
- Array of tags (e.g.,['type']
) whose presence on the document block avoids the need for a@returns
. Defaults to an empty array.forceRequireReturn
- Set totrue
to always insist on@returns
documentation regardless of implicit or explicitreturn
's in the function. May be desired to flag that a project is aware of anundefined
/void
return. Defaults tofalse
.forceReturnsWithAsync
- By defaultasync
functions that do not explicitly return a value pass this rule. You can force allasync
functions to require return statements by settingforceReturnsWithAsync
totrue
on the options object. This may be useful as anasync
function will always return aPromise
, even if thePromise
returns void. Defaults tofalse
.
'jsdoc/require-jsdoc': ['error', {forceReturnsWithAsync: true}]
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | returns |
Aliases | return |
Options | exemptedBy , forceRequireReturn , forceReturnsWithAsync |
Settings | overrideReplacesDocs , augmentsExtendsReplacesDocs , implementsReplacesDocs |