Skip to content

Commit

Permalink
Docs: clarify requireReturn option for valid-jsdoc rule (fixes #4859)
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaub committed Jan 6, 2016
1 parent 3c6d818 commit f7b28b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/rules/valid-jsdoc.md
Expand Up @@ -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, {
Expand Down

0 comments on commit f7b28b7

Please sign in to comment.