Skip to content
Permalink
Browse files

Docs: clarify `requireReturn` option for valid-jsdoc rule (fixes #4859)

  • Loading branch information...
tschaub committed Jan 6, 2016
1 parent 3c6d818 commit f7b28b714da66cb40d9b23532fb823d30c62c93e
Showing with 1 addition and 1 deletion.
  1. +1 −1 docs/rules/valid-jsdoc.md
@@ -140,7 +140,7 @@ With this configuration, ESLint will warn when it finds `@return` and recommend

#### requireReturn

By default ESLint requires you to specify `@return` for every documented function regardless of whether there is anything returned by the function. While using `@return {void}` or `@return {undefined}` stops it from asking for a description of the return value using the `requireReturn` option and setting it to false prevents an error from being logged unless there is a return in the function. Note that with this option set to `false`, if there is a return in the function, an error will still be logged and if there is a `@return` specified and there are no `return` statements in the function an error will also be logged. This option is purely to prevent the forced addition of `@return {void}` to an entire codebase not to turn off JSDoc return checking.
By default ESLint requires you to document every function with a `@return` tag regardless of whether there is anything returned by the function. If instead you want to enforce that only functions with a `return` statement are documented with a `@return` tag, set the `requireReturn` option to `false`. When `requireReturn` is `false`, every function documented with a `@return` tag must have a `return` statement, and every function with a `return` statement must have a `@return` tag.

```json
"valid-jsdoc": [2, {

0 comments on commit f7b28b7

Please sign in to comment.
You can’t perform that action at this time.