Skip to content

Commit abd2170

Browse files
Exterskybrettz9
authored andcommitted
feat: add public exports only option to require-jsdoc rule
* When enabled, require all exported function bodies to have JSDoc block * Fixes #192
1 parent 3a36e88 commit abd2170

File tree

7 files changed

+1443
-144
lines changed

7 files changed

+1443
-144
lines changed

.README/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,17 @@ Finally, enable all of the rules that you would like to use.
118118
above functions/methods with no parameters or return values (intended where
119119
variable names are sufficient for themselves as documentation).
120120

121+
### Requiring JSDoc comments for exported functions in <code>require-jsdoc</code>
122+
123+
- `settings.jsdoc.publicFunctionsOnly` - Missing jsdoc blocks
124+
are only reported for function bodies that are exported from the module.
125+
126+
This setting object supports the following keys:
127+
128+
- `exports`
129+
- `modules`
130+
- `browserEnv`
131+
121132
### Alias Preference
122133

123134
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.

.README/rules/require-jsdoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ functions.
77
|---|---|
88
|Context|`ArrowFunctionExpression`, `ClassDeclaration`, `FunctionDeclaration`, `FunctionExpression`|
99
|Tags|N/A|
10-
|Settings|`exemptEmptyFunctions`|
10+
|Settings|`exemptEmptyFunctions`, `publicFunctionsOnly`|
1111

1212
<!-- assertions requireJsdoc -->

0 commit comments

Comments
 (0)