Skip to content

Commit

Permalink
feat: add public exports only option to require-jsdoc rule
Browse files Browse the repository at this point in the history
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
  • Loading branch information
Extersky authored and brettz9 committed May 24, 2019
1 parent 6d6e1fc commit 0b64389
Show file tree
Hide file tree
Showing 7 changed files with 1,441 additions and 143 deletions.
6 changes: 6 additions & 0 deletions .README/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ Finally, enable all of the rules that you would like to use.
above functions/methods with no parameters or return values (intended where
variable names are sufficient for themselves as documentation).

<a name="eslint-plugin-jsdoc-settings-requiring-jsdoc-comments-for-exported-functions-in-require-jsdoc"></a>
### Requiring JSDoc comments for exported functions in <code>require-jsdoc</code>

- `settings.jsdoc.publicFunctionsOnly` - Missing jsdoc blocks
are only reported for function bodies that are exported from the module.

### Alias Preference

Use `settings.jsdoc.tagNamePreference` to configure a preferred alias name for a JSDoc tag. The format of the configuration is: `<primary tag name>: <preferred alias name>`, e.g.
Expand Down
4 changes: 4 additions & 0 deletions .README/rules/require-jsdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ functions.
|Context|`ArrowFunctionExpression`, `ClassDeclaration`, `FunctionDeclaration`, `FunctionExpression`|
|Tags|N/A|
|Settings|`exemptEmptyFunctions`|
|Settings|`publicFunctionsOnly`|
|Settings|`publicFunctionsOnly.exports`|
|Settings|`publicFunctionsOnly.modules`|
|Settings|`publicFunctionsOnly.browserEnv`|

<!-- assertions requireJsdoc -->

0 comments on commit 0b64389

Please sign in to comment.