eslint-plugin-jsdoc 46.4.6 → 46.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +31 -0
  2. package/dist/index.js +21 -10
  3. package/dist/index.js.map +1 -1
  4. package/dist/jsdocUtils.js +1 -1
  5. package/dist/jsdocUtils.js.map +1 -1
  6. package/dist/rules/matchDescription.js +1 -1
  7. package/dist/rules/matchDescription.js.map +1 -1
  8. package/package.json +14 -12
  9. package/dist/WarnSettings.d.ts +0 -17
  10. package/dist/WarnSettings.d.ts.map +0 -1
  11. package/dist/alignTransform.d.ts +0 -32
  12. package/dist/alignTransform.d.ts.map +0 -1
  13. package/dist/defaultTagOrder.d.ts +0 -5
  14. package/dist/defaultTagOrder.d.ts.map +0 -1
  15. package/dist/exportParser.d.ts +0 -41
  16. package/dist/exportParser.d.ts.map +0 -1
  17. package/dist/getDefaultTagStructureForMode.d.ts +0 -11
  18. package/dist/getDefaultTagStructureForMode.d.ts.map +0 -1
  19. package/dist/index.d.ts +0 -10
  20. package/dist/index.d.ts.map +0 -1
  21. package/dist/iterateJsdoc.d.ts +0 -460
  22. package/dist/iterateJsdoc.d.ts.map +0 -1
  23. package/dist/jsdocUtils.d.ts +0 -421
  24. package/dist/jsdocUtils.d.ts.map +0 -1
  25. package/dist/rules/checkAccess.d.ts +0 -3
  26. package/dist/rules/checkAccess.d.ts.map +0 -1
  27. package/dist/rules/checkAlignment.d.ts +0 -3
  28. package/dist/rules/checkAlignment.d.ts.map +0 -1
  29. package/dist/rules/checkExamples.d.ts +0 -4
  30. package/dist/rules/checkExamples.d.ts.map +0 -1
  31. package/dist/rules/checkIndentation.d.ts +0 -3
  32. package/dist/rules/checkIndentation.d.ts.map +0 -1
  33. package/dist/rules/checkLineAlignment.d.ts +0 -10
  34. package/dist/rules/checkLineAlignment.d.ts.map +0 -1
  35. package/dist/rules/checkParamNames.d.ts +0 -3
  36. package/dist/rules/checkParamNames.d.ts.map +0 -1
  37. package/dist/rules/checkPropertyNames.d.ts +0 -3
  38. package/dist/rules/checkPropertyNames.d.ts.map +0 -1
  39. package/dist/rules/checkSyntax.d.ts +0 -3
  40. package/dist/rules/checkSyntax.d.ts.map +0 -1
  41. package/dist/rules/checkTagNames.d.ts +0 -3
  42. package/dist/rules/checkTagNames.d.ts.map +0 -1
  43. package/dist/rules/checkTypes.d.ts +0 -3
  44. package/dist/rules/checkTypes.d.ts.map +0 -1
  45. package/dist/rules/checkValues.d.ts +0 -3
  46. package/dist/rules/checkValues.d.ts.map +0 -1
  47. package/dist/rules/emptyTags.d.ts +0 -3
  48. package/dist/rules/emptyTags.d.ts.map +0 -1
  49. package/dist/rules/implementsOnClasses.d.ts +0 -3
  50. package/dist/rules/implementsOnClasses.d.ts.map +0 -1
  51. package/dist/rules/importsAsDependencies.d.ts +0 -3
  52. package/dist/rules/importsAsDependencies.d.ts.map +0 -1
  53. package/dist/rules/informativeDocs.d.ts +0 -3
  54. package/dist/rules/informativeDocs.d.ts.map +0 -1
  55. package/dist/rules/matchDescription.d.ts +0 -3
  56. package/dist/rules/matchDescription.d.ts.map +0 -1
  57. package/dist/rules/matchName.d.ts +0 -3
  58. package/dist/rules/matchName.d.ts.map +0 -1
  59. package/dist/rules/multilineBlocks.d.ts +0 -3
  60. package/dist/rules/multilineBlocks.d.ts.map +0 -1
  61. package/dist/rules/noBadBlocks.d.ts +0 -3
  62. package/dist/rules/noBadBlocks.d.ts.map +0 -1
  63. package/dist/rules/noBlankBlockDescriptions.d.ts +0 -3
  64. package/dist/rules/noBlankBlockDescriptions.d.ts.map +0 -1
  65. package/dist/rules/noBlankBlocks.d.ts +0 -3
  66. package/dist/rules/noBlankBlocks.d.ts.map +0 -1
  67. package/dist/rules/noDefaults.d.ts +0 -3
  68. package/dist/rules/noDefaults.d.ts.map +0 -1
  69. package/dist/rules/noMissingSyntax.d.ts +0 -10
  70. package/dist/rules/noMissingSyntax.d.ts.map +0 -1
  71. package/dist/rules/noMultiAsterisks.d.ts +0 -3
  72. package/dist/rules/noMultiAsterisks.d.ts.map +0 -1
  73. package/dist/rules/noRestrictedSyntax.d.ts +0 -3
  74. package/dist/rules/noRestrictedSyntax.d.ts.map +0 -1
  75. package/dist/rules/noTypes.d.ts +0 -3
  76. package/dist/rules/noTypes.d.ts.map +0 -1
  77. package/dist/rules/noUndefinedTypes.d.ts +0 -3
  78. package/dist/rules/noUndefinedTypes.d.ts.map +0 -1
  79. package/dist/rules/requireAsteriskPrefix.d.ts +0 -3
  80. package/dist/rules/requireAsteriskPrefix.d.ts.map +0 -1
  81. package/dist/rules/requireDescription.d.ts +0 -3
  82. package/dist/rules/requireDescription.d.ts.map +0 -1
  83. package/dist/rules/requireDescriptionCompleteSentence.d.ts +0 -3
  84. package/dist/rules/requireDescriptionCompleteSentence.d.ts.map +0 -1
  85. package/dist/rules/requireExample.d.ts +0 -3
  86. package/dist/rules/requireExample.d.ts.map +0 -1
  87. package/dist/rules/requireFileOverview.d.ts +0 -3
  88. package/dist/rules/requireFileOverview.d.ts.map +0 -1
  89. package/dist/rules/requireHyphenBeforeParamDescription.d.ts +0 -3
  90. package/dist/rules/requireHyphenBeforeParamDescription.d.ts.map +0 -1
  91. package/dist/rules/requireJsdoc.d.ts +0 -9
  92. package/dist/rules/requireJsdoc.d.ts.map +0 -1
  93. package/dist/rules/requireParam.d.ts +0 -4
  94. package/dist/rules/requireParam.d.ts.map +0 -1
  95. package/dist/rules/requireParamDescription.d.ts +0 -3
  96. package/dist/rules/requireParamDescription.d.ts.map +0 -1
  97. package/dist/rules/requireParamName.d.ts +0 -3
  98. package/dist/rules/requireParamName.d.ts.map +0 -1
  99. package/dist/rules/requireParamType.d.ts +0 -3
  100. package/dist/rules/requireParamType.d.ts.map +0 -1
  101. package/dist/rules/requireProperty.d.ts +0 -3
  102. package/dist/rules/requireProperty.d.ts.map +0 -1
  103. package/dist/rules/requirePropertyDescription.d.ts +0 -3
  104. package/dist/rules/requirePropertyDescription.d.ts.map +0 -1
  105. package/dist/rules/requirePropertyName.d.ts +0 -3
  106. package/dist/rules/requirePropertyName.d.ts.map +0 -1
  107. package/dist/rules/requirePropertyType.d.ts +0 -3
  108. package/dist/rules/requirePropertyType.d.ts.map +0 -1
  109. package/dist/rules/requireReturns.d.ts +0 -3
  110. package/dist/rules/requireReturns.d.ts.map +0 -1
  111. package/dist/rules/requireReturnsCheck.d.ts +0 -3
  112. package/dist/rules/requireReturnsCheck.d.ts.map +0 -1
  113. package/dist/rules/requireReturnsDescription.d.ts +0 -3
  114. package/dist/rules/requireReturnsDescription.d.ts.map +0 -1
  115. package/dist/rules/requireReturnsType.d.ts +0 -3
  116. package/dist/rules/requireReturnsType.d.ts.map +0 -1
  117. package/dist/rules/requireThrows.d.ts +0 -3
  118. package/dist/rules/requireThrows.d.ts.map +0 -1
  119. package/dist/rules/requireYields.d.ts +0 -3
  120. package/dist/rules/requireYields.d.ts.map +0 -1
  121. package/dist/rules/requireYieldsCheck.d.ts +0 -3
  122. package/dist/rules/requireYieldsCheck.d.ts.map +0 -1
  123. package/dist/rules/sortTags.d.ts +0 -3
  124. package/dist/rules/sortTags.d.ts.map +0 -1
  125. package/dist/rules/tagLines.d.ts +0 -3
  126. package/dist/rules/tagLines.d.ts.map +0 -1
  127. package/dist/rules/textEscaping.d.ts +0 -3
  128. package/dist/rules/textEscaping.d.ts.map +0 -1
  129. package/dist/rules/validTypes.d.ts +0 -3
  130. package/dist/rules/validTypes.d.ts.map +0 -1
  131. package/dist/tagNames.d.ts +0 -16
  132. package/dist/tagNames.d.ts.map +0 -1
  133. package/dist/utils/hasReturnValue.d.ts +0 -20
  134. package/dist/utils/hasReturnValue.d.ts.map +0 -1
  135. package/docs/advanced.md +0 -102
  136. package/docs/rules/check-access.md +0 -193
  137. package/docs/rules/check-alignment.md +0 -169
  138. package/docs/rules/check-examples.md +0 -784
  139. package/docs/rules/check-indentation.md +0 -296
  140. package/docs/rules/check-line-alignment.md +0 -1002
  141. package/docs/rules/check-param-names.md +0 -1035
  142. package/docs/rules/check-property-names.md +0 -244
  143. package/docs/rules/check-syntax.md +0 -80
  144. package/docs/rules/check-tag-names.md +0 -1132
  145. package/docs/rules/check-types.md +0 -1198
  146. package/docs/rules/check-values.md +0 -409
  147. package/docs/rules/empty-tags.md +0 -220
  148. package/docs/rules/implements-on-classes.md +0 -219
  149. package/docs/rules/imports-as-dependencies.md +0 -99
  150. package/docs/rules/informative-docs.md +0 -400
  151. package/docs/rules/match-description.md +0 -1008
  152. package/docs/rules/match-name.md +0 -249
  153. package/docs/rules/multiline-blocks.md +0 -398
  154. package/docs/rules/no-bad-blocks.md +0 -174
  155. package/docs/rules/no-blank-block-descriptions.md +0 -91
  156. package/docs/rules/no-blank-blocks.md +0 -98
  157. package/docs/rules/no-defaults.md +0 -207
  158. package/docs/rules/no-missing-syntax.md +0 -275
  159. package/docs/rules/no-multi-asterisks.md +0 -278
  160. package/docs/rules/no-restricted-syntax.md +0 -383
  161. package/docs/rules/no-types.md +0 -168
  162. package/docs/rules/no-undefined-types.md +0 -789
  163. package/docs/rules/require-asterisk-prefix.md +0 -297
  164. package/docs/rules/require-description-complete-sentence.md +0 -820
  165. package/docs/rules/require-description.md +0 -585
  166. package/docs/rules/require-example.md +0 -390
  167. package/docs/rules/require-file-overview.md +0 -324
  168. package/docs/rules/require-hyphen-before-param-description.md +0 -281
  169. package/docs/rules/require-jsdoc.md +0 -1857
  170. package/docs/rules/require-param-description.md +0 -238
  171. package/docs/rules/require-param-name.md +0 -163
  172. package/docs/rules/require-param-type.md +0 -227
  173. package/docs/rules/require-param.md +0 -1820
  174. package/docs/rules/require-property-description.md +0 -88
  175. package/docs/rules/require-property-name.md +0 -79
  176. package/docs/rules/require-property-type.md +0 -79
  177. package/docs/rules/require-property.md +0 -128
  178. package/docs/rules/require-returns-check.md +0 -1053
  179. package/docs/rules/require-returns-description.md +0 -181
  180. package/docs/rules/require-returns-type.md +0 -144
  181. package/docs/rules/require-returns.md +0 -1191
  182. package/docs/rules/require-throws.md +0 -326
  183. package/docs/rules/require-yields-check.md +0 -544
  184. package/docs/rules/require-yields.md +0 -823
  185. package/docs/rules/sort-tags.md +0 -635
  186. package/docs/rules/tag-lines.md +0 -551
  187. package/docs/rules/text-escaping.md +0 -177
  188. package/docs/rules/valid-types.md +0 -881
  189. package/docs/settings.md +0 -362
  190. package/tsconfig-prod.json +0 -20
  191. package/tsconfig.json +0 -21
@@ -1,1857 +0,0 @@
1
- <a name="user-content-require-jsdoc"></a>
2
- <a name="require-jsdoc"></a>
3
- # <code>require-jsdoc</code>
4
-
5
- * [Fixer](#user-content-require-jsdoc-fixer)
6
- * [Options](#user-content-require-jsdoc-options)
7
- * [`publicOnly`](#user-content-require-jsdoc-options-publiconly)
8
- * [`require`](#user-content-require-jsdoc-options-require)
9
- * [`contexts`](#user-content-require-jsdoc-options-contexts)
10
- * [`exemptEmptyConstructors`](#user-content-require-jsdoc-options-exemptemptyconstructors)
11
- * [`exemptEmptyFunctions`](#user-content-require-jsdoc-options-exemptemptyfunctions)
12
- * [`checkConstructors`](#user-content-require-jsdoc-options-checkconstructors)
13
- * [`checkGetters`](#user-content-require-jsdoc-options-checkgetters)
14
- * [`checkSetters`](#user-content-require-jsdoc-options-checksetters)
15
- * [`enableFixer`](#user-content-require-jsdoc-options-enablefixer)
16
- * [`minLineCount`](#user-content-require-jsdoc-options-minlinecount)
17
- * [Context and settings](#user-content-require-jsdoc-context-and-settings)
18
- * [Failing examples](#user-content-require-jsdoc-failing-examples)
19
- * [Passing examples](#user-content-require-jsdoc-passing-examples)
20
-
21
-
22
- Checks for presence of jsdoc comments, on class declarations as well as
23
- functions.
24
-
25
- <a name="user-content-require-jsdoc-fixer"></a>
26
- <a name="require-jsdoc-fixer"></a>
27
- ## Fixer
28
-
29
- Adds an empty JSDoc block unless `enableFixer` is set to `false`. See
30
- the `contexts` option for how `inlineCommentBlock` can control the style
31
- of the generated JSDoc block.
32
-
33
- <a name="user-content-require-jsdoc-options"></a>
34
- <a name="require-jsdoc-options"></a>
35
- ## Options
36
-
37
- Accepts one optional options object with the following optional keys.
38
-
39
- <a name="user-content-require-jsdoc-options-publiconly"></a>
40
- <a name="require-jsdoc-options-publiconly"></a>
41
- ### <code>publicOnly</code>
42
-
43
- This option will insist that missing jsdoc blocks are only reported for
44
- function bodies / class declarations that are exported from the module.
45
- May be a boolean or object. If set to `true`, the defaults below will be
46
- used. If unset, jsdoc block reporting will not be limited to exports.
47
-
48
- This object supports the following optional boolean keys (`false` unless
49
- otherwise noted):
50
-
51
- - `ancestorsOnly` - Only check node ancestors to check if node is exported
52
- - `esm` - ESM exports are checked for JSDoc comments (Defaults to `true`)
53
- - `cjs` - CommonJS exports are checked for JSDoc comments (Defaults to `true`)
54
- - `window` - Window global exports are checked for JSDoc comments
55
-
56
- <a name="user-content-require-jsdoc-options-require"></a>
57
- <a name="require-jsdoc-options-require"></a>
58
- ### <code>require</code>
59
-
60
- An object with the following optional boolean keys which all default to
61
- `false` except as noted, indicating the contexts where the rule will apply:
62
-
63
- - `ArrowFunctionExpression`
64
- - `ClassDeclaration`
65
- - `ClassExpression`
66
- - `FunctionDeclaration` (defaults to `true`)
67
- - `FunctionExpression`
68
- - `MethodDefinition`
69
-
70
- <a name="user-content-require-jsdoc-options-contexts"></a>
71
- <a name="require-jsdoc-options-contexts"></a>
72
- ### <code>contexts</code>
73
-
74
- Set this to an array of strings or objects representing the additional AST
75
- contexts where you wish the rule to be applied (e.g., `Property` for
76
- properties). If specified as an object, it should have a `context` property
77
- and can have an `inlineCommentBlock` property which, if set to `true`, will
78
- add an inline `/** */` instead of the regular, multi-line, indented jsdoc
79
- block which will otherwise be added. Defaults to an empty array. Contexts
80
- may also have their own `minLineCount` property.
81
-
82
- Note that you may need to disable `require` items (e.g., `MethodDefinition`)
83
- if you are specifying a more precise form in `contexts` (e.g., `MethodDefinition:not([accessibility="private"] > FunctionExpression`).
84
-
85
- See the ["AST and Selectors"](#user-content-eslint-plugin-jsdoc-advanced-ast-and-selectors)
86
- section of our README for more on the expected format.
87
-
88
- <a name="user-content-require-jsdoc-options-exemptemptyconstructors"></a>
89
- <a name="require-jsdoc-options-exemptemptyconstructors"></a>
90
- ### <code>exemptEmptyConstructors</code>
91
-
92
- Default: true
93
-
94
- When `true`, the rule will not report missing jsdoc blocks above constructors
95
- with no parameters or return values (this is enabled by default as the class
96
- name or description should be seen as sufficient to convey intent).
97
-
98
- <a name="user-content-require-jsdoc-options-exemptemptyfunctions"></a>
99
- <a name="require-jsdoc-options-exemptemptyfunctions"></a>
100
- ### <code>exemptEmptyFunctions</code>
101
-
102
- Default: false.
103
-
104
- When `true`, the rule will not report missing jsdoc blocks above
105
- functions/methods with no parameters or return values (intended where
106
- function/method names are sufficient for themselves as documentation).
107
-
108
- <a name="user-content-require-jsdoc-options-checkconstructors"></a>
109
- <a name="require-jsdoc-options-checkconstructors"></a>
110
- ### <code>checkConstructors</code>
111
-
112
- A value indicating whether `constructor`s should be checked. Defaults to
113
- `true`. When `true`, `exemptEmptyConstructors` may still avoid reporting when
114
- no parameters or return values are found.
115
-
116
- <a name="user-content-require-jsdoc-options-checkgetters"></a>
117
- <a name="require-jsdoc-options-checkgetters"></a>
118
- ### <code>checkGetters</code>
119
-
120
- A value indicating whether getters should be checked. Besides setting as a
121
- boolean, this option can be set to the string `"no-setter"` to indicate that
122
- getters should be checked but only when there is no setter. This may be useful
123
- if one only wishes documentation on one of the two accessors. Defaults to
124
- `false`.
125
-
126
- <a name="user-content-require-jsdoc-options-checksetters"></a>
127
- <a name="require-jsdoc-options-checksetters"></a>
128
- ### <code>checkSetters</code>
129
-
130
- A value indicating whether setters should be checked. Besides setting as a
131
- boolean, this option can be set to the string `"no-getter"` to indicate that
132
- setters should be checked but only when there is no getter. This may be useful
133
- if one only wishes documentation on one of the two accessors. Defaults to
134
- `false`.
135
-
136
- <a name="user-content-require-jsdoc-options-enablefixer"></a>
137
- <a name="require-jsdoc-options-enablefixer"></a>
138
- ### <code>enableFixer</code>
139
-
140
- A boolean on whether to enable the fixer (which adds an empty jsdoc block).
141
- Defaults to `true`.
142
-
143
- <a name="user-content-require-jsdoc-options-minlinecount"></a>
144
- <a name="require-jsdoc-options-minlinecount"></a>
145
- ### <code>minLineCount</code>
146
-
147
- An integer to indicate a minimum number of lines expected for a node in order
148
- for it to require documentation. Defaults to `undefined`. This option will
149
- apply to any context; see `contexts` for line counts per context.
150
-
151
- <a name="user-content-require-jsdoc-context-and-settings"></a>
152
- <a name="require-jsdoc-context-and-settings"></a>
153
- ## Context and settings
154
-
155
- |||
156
- |---|---|
157
- |Context|`ArrowFunctionExpression`, `ClassDeclaration`, `ClassExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
158
- |Tags|N/A|
159
- |Recommended|true|
160
- |Options|`publicOnly`, `require`, `contexts`, `exemptEmptyConstructors`, `exemptEmptyFunctions`, `enableFixer`, `minLineCount`|
161
-
162
- <a name="user-content-require-jsdoc-failing-examples"></a>
163
- <a name="require-jsdoc-failing-examples"></a>
164
- ## Failing examples
165
-
166
- The following patterns are considered problems:
167
-
168
- ````js
169
- /** This is comment */
170
- export interface Foo {
171
- /** This is comment x2 */
172
- tom: string;
173
- catchJerry(): boolean;
174
- }
175
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true},"require":{"ClassDeclaration":true,"ClassExpression":true,"MethodDefinition":true}}]
176
- // Message: Missing JSDoc comment.
177
-
178
- /** This is comment */
179
- export interface Foo {
180
- /** This is comment x2 */
181
- tom: string;
182
- jerry: number;
183
- }
184
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true},"require":{"ClassDeclaration":true,"ClassExpression":true,"MethodDefinition":true}}]
185
- // Message: Missing JSDoc comment.
186
-
187
- /** This is comment */
188
- export interface Foo {
189
- bar(): string;
190
- }
191
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true}}]
192
- // Message: Missing JSDoc comment.
193
-
194
- /** This is comment */
195
- export interface Foo {
196
- bar: string;
197
- }
198
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true,"esm":true}}]
199
- // Message: Missing JSDoc comment.
200
-
201
- /**
202
- * Foo interface documentation.
203
- */
204
- export interface Foo extends Bar {
205
- /**
206
- * baz method documentation.
207
- */
208
- baz(): void;
209
-
210
- meow(): void;
211
- }
212
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSMethodSignature"],"publicOnly":{"ancestorsOnly":true}}]
213
- // Message: Missing JSDoc comment.
214
-
215
- function quux (foo) {
216
-
217
- }
218
- // Message: Missing JSDoc comment.
219
-
220
- /**
221
- * @func myFunction
222
- */
223
- function myFunction() {
224
-
225
- }
226
- // Settings: {"jsdoc":{"maxLines":3,"minLines":2}}
227
- // Message: Missing JSDoc comment.
228
-
229
- /**
230
- * @func myFunction
231
- */
232
-
233
-
234
- function myFunction() {
235
-
236
- }
237
- // Settings: {"jsdoc":{"maxLines":2}}
238
- // Message: Missing JSDoc comment.
239
-
240
- /** @func myFunction */ function myFunction() {
241
-
242
- }
243
- // Settings: {"jsdoc":{"minLines":1}}
244
- // Message: Missing JSDoc comment.
245
-
246
- function myFunction() {
247
-
248
- }
249
- // "jsdoc/require-jsdoc": ["error"|"warn", {"enableFixer":false}]
250
- // Message: Missing JSDoc comment.
251
-
252
- export var test = function () {
253
-
254
- };
255
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
256
- // Message: Missing JSDoc comment.
257
-
258
- function test () {
259
-
260
- }
261
- export var test2 = test;
262
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionDeclaration":true}}]
263
- // Message: Missing JSDoc comment.
264
-
265
- export const test = () => {
266
-
267
- };
268
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":true}}]
269
- // Message: Missing JSDoc comment.
270
-
271
- export const test = () => {
272
-
273
- };
274
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["ArrowFunctionExpression"],"publicOnly":true}]
275
- // Message: Missing JSDoc comment.
276
-
277
- export const test = () => {
278
-
279
- };
280
- // Settings: {"jsdoc":{"contexts":["ArrowFunctionExpression"]}}
281
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true}]
282
- // Message: Missing JSDoc comment.
283
-
284
- export const test = () => {
285
-
286
- };
287
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":[{"context":"ArrowFunctionExpression"}],"publicOnly":true}]
288
- // Message: Missing JSDoc comment.
289
-
290
- export let test = class {
291
-
292
- };
293
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ClassExpression":true}}]
294
- // Message: Missing JSDoc comment.
295
-
296
- export default function () {}
297
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"FunctionDeclaration":true}}]
298
- // Message: Missing JSDoc comment.
299
-
300
- export default () => {}
301
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"ArrowFunctionExpression":true}}]
302
- // Message: Missing JSDoc comment.
303
-
304
- export default (function () {})
305
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"FunctionExpression":true}}]
306
- // Message: Missing JSDoc comment.
307
-
308
- export default class {}
309
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"ClassDeclaration":true}}]
310
- // Message: Missing JSDoc comment.
311
-
312
- function quux (foo) {
313
-
314
- }
315
- // Message: Missing JSDoc comment.
316
-
317
- function quux (foo) {
318
-
319
- }
320
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyFunctions":true}]
321
- // Message: Missing JSDoc comment.
322
-
323
- function quux (foo) {
324
-
325
- }
326
- // Settings: {"jsdoc":{"minLines":2}}
327
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyFunctions":true}]
328
- // Message: Missing JSDoc comment.
329
-
330
- function myFunction() {}
331
- // Message: Missing JSDoc comment.
332
-
333
- /**
334
- * Description for A.
335
- */
336
- class A {
337
- constructor(xs) {
338
- this.a = xs;
339
- }
340
- }
341
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"MethodDefinition":true}}]
342
- // Message: Missing JSDoc comment.
343
-
344
- class A {
345
- /**
346
- * Description for constructor.
347
- * @param {object[]} xs - xs
348
- */
349
- constructor(xs) {
350
- this.a = xs;
351
- }
352
- }
353
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"MethodDefinition":true}}]
354
- // Message: Missing JSDoc comment.
355
-
356
- class A extends B {
357
- /**
358
- * Description for constructor.
359
- * @param {object[]} xs - xs
360
- */
361
- constructor(xs) {
362
- this.a = xs;
363
- }
364
- }
365
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"MethodDefinition":true}}]
366
- // Message: Missing JSDoc comment.
367
-
368
- export class A extends B {
369
- /**
370
- * Description for constructor.
371
- * @param {object[]} xs - xs
372
- */
373
- constructor(xs) {
374
- this.a = xs;
375
- }
376
- }
377
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"MethodDefinition":true}}]
378
- // Message: Missing JSDoc comment.
379
-
380
- export default class A extends B {
381
- /**
382
- * Description for constructor.
383
- * @param {object[]} xs - xs
384
- */
385
- constructor(xs) {
386
- this.a = xs;
387
- }
388
- }
389
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"MethodDefinition":true}}]
390
- // Message: Missing JSDoc comment.
391
-
392
- var myFunction = () => {}
393
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":true}}]
394
- // Message: Missing JSDoc comment.
395
-
396
- var myFunction = () => () => {}
397
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":true}}]
398
- // Message: Missing JSDoc comment.
399
-
400
- var foo = function() {}
401
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionExpression":true}}]
402
- // Message: Missing JSDoc comment.
403
-
404
- const foo = {bar() {}}
405
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionExpression":true}}]
406
- // Message: Missing JSDoc comment.
407
-
408
- var foo = {bar: function() {}}
409
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionExpression":true}}]
410
- // Message: Missing JSDoc comment.
411
-
412
- function foo (abc) {}
413
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyFunctions":false}]
414
- // Message: Missing JSDoc comment.
415
-
416
- function foo () {
417
- return true;
418
- }
419
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyFunctions":false}]
420
- // Message: Missing JSDoc comment.
421
-
422
- module.exports = function quux () {
423
-
424
- }
425
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
426
- // Message: Missing JSDoc comment.
427
-
428
- module.exports = function quux () {
429
-
430
- }
431
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"FunctionExpression":true}}]
432
- // Message: Missing JSDoc comment.
433
-
434
- module.exports = {
435
- method: function() {
436
-
437
- }
438
- }
439
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
440
- // Message: Missing JSDoc comment.
441
-
442
- module.exports = {
443
- test: {
444
- test2: function() {
445
-
446
- }
447
- }
448
- }
449
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
450
- // Message: Missing JSDoc comment.
451
-
452
- module.exports = {
453
- test: {
454
- test2: function() {
455
-
456
- }
457
- }
458
- }
459
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"FunctionExpression":true}}]
460
- // Message: Missing JSDoc comment.
461
-
462
- const test = module.exports = function () {
463
-
464
- }
465
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
466
- // Message: Missing JSDoc comment.
467
-
468
- /**
469
- *
470
- */
471
- const test = module.exports = function () {
472
-
473
- }
474
-
475
- test.prototype.method = function() {}
476
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
477
- // Message: Missing JSDoc comment.
478
-
479
- const test = function () {
480
-
481
- }
482
- module.exports = {
483
- test: test
484
- }
485
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
486
- // Message: Missing JSDoc comment.
487
-
488
- const test = () => {
489
-
490
- }
491
- module.exports = {
492
- test: test
493
- }
494
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":true}}]
495
- // Message: Missing JSDoc comment.
496
-
497
- class Test {
498
- method() {
499
-
500
- }
501
- }
502
- module.exports = Test;
503
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"MethodDefinition":true}}]
504
- // Message: Missing JSDoc comment.
505
-
506
- export default function quux () {
507
-
508
- }
509
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
510
- // Message: Missing JSDoc comment.
511
-
512
- export default function quux () {
513
-
514
- }
515
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"FunctionExpression":true}}]
516
- // Message: Missing JSDoc comment.
517
-
518
- function quux () {
519
-
520
- }
521
- export default quux;
522
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
523
- // Message: Missing JSDoc comment.
524
-
525
- export function test() {
526
-
527
- }
528
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
529
- // Message: Missing JSDoc comment.
530
-
531
- export function test() {
532
-
533
- }
534
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"FunctionExpression":true}}]
535
- // Message: Missing JSDoc comment.
536
-
537
- var test = function () {
538
-
539
- }
540
- var test2 = 2;
541
- export { test, test2 }
542
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
543
- // Message: Missing JSDoc comment.
544
-
545
- var test = function () {
546
-
547
- }
548
- export { test as test2 }
549
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
550
- // Message: Missing JSDoc comment.
551
-
552
- export default class A {
553
-
554
- }
555
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ClassDeclaration":true}}]
556
- // Message: Missing JSDoc comment.
557
-
558
- export default class A {
559
-
560
- }
561
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"ClassDeclaration":true}}]
562
- // Message: Missing JSDoc comment.
563
-
564
- var test = function () {
565
-
566
- }
567
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"window":true},"require":{"FunctionExpression":true}}]
568
- // Message: Missing JSDoc comment.
569
-
570
- window.test = function () {
571
-
572
- }
573
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"window":true},"require":{"FunctionExpression":true}}]
574
- // Message: Missing JSDoc comment.
575
-
576
- function test () {
577
-
578
- }
579
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"window":true}}]
580
- // Message: Missing JSDoc comment.
581
-
582
- module.exports = function() {
583
-
584
- }
585
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":true,"esm":false,"window":false},"require":{"FunctionExpression":true}}]
586
- // Message: Missing JSDoc comment.
587
-
588
- export function someMethod() {
589
-
590
- }
591
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"FunctionDeclaration":true}}]
592
- // Message: Missing JSDoc comment.
593
-
594
- export function someMethod() {
595
-
596
- }
597
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"FunctionDeclaration":true}}]
598
- // Message: Missing JSDoc comment.
599
-
600
- const myObject = {
601
- myProp: true
602
- };
603
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["Property"]}]
604
- // Message: Missing JSDoc comment.
605
-
606
- /**
607
- * Foo interface documentation.
608
- */
609
- export interface Foo extends Bar {
610
- /**
611
- * baz method documentation.
612
- */
613
- baz(): void;
614
-
615
- meow(): void;
616
- }
617
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSMethodSignature"]}]
618
- // Message: Missing JSDoc comment.
619
-
620
- class MyClass {
621
- someProperty: boolean; // Flow type annotation.
622
- }
623
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyFunctions":true,"require":{"ClassDeclaration":true}}]
624
- // Message: Missing JSDoc comment.
625
-
626
- export default class Test {
627
- constructor(a) {
628
- this.a = a;
629
- }
630
- }
631
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":false,"ClassDeclaration":false,"ClassExpression":false,"FunctionDeclaration":false,"FunctionExpression":false,"MethodDefinition":true}}]
632
- // Message: Missing JSDoc comment.
633
-
634
- export default class Test {
635
- constructor(a) {
636
- this.a = a;
637
- }
638
- private abc(a) {
639
- this.a = a;
640
- }
641
- }
642
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["MethodDefinition > FunctionExpression"],"publicOnly":true,"require":{"ArrowFunctionExpression":false,"ClassDeclaration":false,"ClassExpression":false,"FunctionDeclaration":false,"FunctionExpression":false,"MethodDefinition":false}}]
643
- // Message: Missing JSDoc comment.
644
-
645
- e = function () {
646
- };
647
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionDeclaration":false,"FunctionExpression":true}}]
648
- // Message: Missing JSDoc comment.
649
-
650
- /**
651
- *
652
- */
653
- export class Class {
654
- test = 1;
655
-
656
- foo() {
657
- this.test = 2;
658
- }
659
- }
660
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionDeclaration":false,"MethodDefinition":true}}]
661
- // Message: Missing JSDoc comment.
662
-
663
- class Dog {
664
- eat() {
665
-
666
- }
667
- }
668
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionDeclaration":false,"MethodDefinition":true}}]
669
- // Message: Missing JSDoc comment.
670
-
671
- const hello = name => {
672
- document.body.textContent = "Hello, " + name + "!";
673
- };
674
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":true,"FunctionDeclaration":false}}]
675
- // Message: Missing JSDoc comment.
676
-
677
- export const loginSuccessAction = (): BaseActionPayload => ({ type: LOGIN_SUCCESSFUL });
678
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":true,"FunctionDeclaration":false}}]
679
- // Message: Missing JSDoc comment.
680
-
681
- export type Container = {
682
- constants?: ObjByString;
683
- enums?: { [key in string]: TypescriptEnum };
684
- helpers?: { [key in string]: AnyFunction };
685
- };
686
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSTypeAliasDeclaration",{"context":"TSPropertySignature","inlineCommentBlock":true}]}]
687
- // Message: Missing JSDoc comment.
688
-
689
- class Foo {
690
- constructor() {}
691
-
692
- bar() {}
693
- }
694
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["MethodDefinition[key.name!=\"constructor\"]"],"require":{"ClassDeclaration":true}}]
695
- // Message: Missing JSDoc comment.
696
-
697
- class Example extends React.PureComponent {
698
- componentDidMount() {}
699
-
700
- render() {}
701
-
702
- someOtherMethod () {}
703
- }
704
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["MethodDefinition:not([key.name=\"componentDidMount\"]):not([key.name=\"render\"])"],"require":{"ClassDeclaration":true}}]
705
- // Message: Missing JSDoc comment.
706
-
707
- function foo(arg: boolean): boolean {
708
- return arg;
709
- }
710
-
711
- function bar(arg: true): true;
712
- function bar(arg: false): false;
713
- function bar(arg: boolean): boolean {
714
- return arg;
715
- }
716
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSDeclareFunction:not(TSDeclareFunction + TSDeclareFunction)","FunctionDeclaration:not(TSDeclareFunction + FunctionDeclaration)"],"require":{"FunctionDeclaration":false}}]
717
- // Message: Missing JSDoc comment.
718
-
719
- export function foo(arg: boolean): boolean {
720
- return arg;
721
- }
722
-
723
- export function bar(arg: true): true;
724
- export function bar(arg: false): false;
725
- export function bar(arg: boolean): boolean {
726
- return arg;
727
- }
728
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["ExportNamedDeclaration[declaration.type=\"TSDeclareFunction\"]:not(ExportNamedDeclaration[declaration.type=\"TSDeclareFunction\"] + ExportNamedDeclaration[declaration.type=\"TSDeclareFunction\"])","ExportNamedDeclaration[declaration.type=\"FunctionDeclaration\"]:not(ExportNamedDeclaration[declaration.type=\"TSDeclareFunction\"] + ExportNamedDeclaration[declaration.type=\"FunctionDeclaration\"])"],"require":{"FunctionDeclaration":false}}]
729
- // Message: Missing JSDoc comment.
730
-
731
- module.exports.foo = (bar) => {
732
- return bar + "biz"
733
- }
734
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":false,"require":{"ArrowFunctionExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}]
735
- // Message: Missing JSDoc comment.
736
-
737
- class Animal {
738
-
739
- #name: string;
740
-
741
- private species: string;
742
-
743
- public color: string;
744
-
745
- @SomeAnnotation('optionalParameter')
746
- tail: boolean;
747
- }
748
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition"]}]
749
- // Message: Missing JSDoc comment.
750
-
751
- @Entity('users')
752
- export class User {}
753
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true}}]
754
- // Message: Missing JSDoc comment.
755
-
756
- /**
757
- *
758
- */
759
- class Foo {
760
- constructor() {}
761
- }
762
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyConstructors":false,"require":{"MethodDefinition":true}}]
763
- // Message: Missing JSDoc comment.
764
-
765
- /**
766
- *
767
- */
768
- class Foo {
769
- constructor(notEmpty) {}
770
- }
771
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyConstructors":true,"require":{"MethodDefinition":true}}]
772
- // Message: Missing JSDoc comment.
773
-
774
- /**
775
- *
776
- */
777
- class Foo {
778
- constructor() {
779
- const notEmpty = true;
780
- return notEmpty;
781
- }
782
- }
783
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyConstructors":true,"require":{"MethodDefinition":true}}]
784
- // Message: Missing JSDoc comment.
785
-
786
- /**
787
- *
788
- */
789
- function quux() {
790
-
791
- }
792
- // Settings: {"jsdoc":{"structuredTags":{"see":{"name":false,"required":["name"]}}}}
793
- // Message: Cannot add "name" to `require` with the tag's `name` set to `false`
794
-
795
- class Test {
796
- aFunc() {}
797
- }
798
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkConstructors":false,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":false,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}]
799
- // Message: Missing JSDoc comment.
800
-
801
- class Test {
802
- aFunc = () => {}
803
- anotherFunc() {}
804
- }
805
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":true,"ClassDeclaration":false,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}]
806
- // Message: Missing JSDoc comment.
807
-
808
- export enum testEnum {
809
- A, B
810
- }
811
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSEnumDeclaration"],"publicOnly":true}]
812
- // Message: Missing JSDoc comment.
813
-
814
- export interface Test {
815
- aFunc: () => void;
816
- aVar: string;
817
- }
818
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration"],"publicOnly":true}]
819
- // Message: Missing JSDoc comment.
820
-
821
- export type testType = string | number;
822
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSTypeAliasDeclaration"],"publicOnly":true}]
823
- // Message: Missing JSDoc comment.
824
-
825
- export interface Foo {
826
- bar: number;
827
- baz: string;
828
- quux(): void;
829
- }
830
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSPropertySignature","TSMethodSignature"],"publicOnly":true}]
831
- // Message: Missing JSDoc comment.
832
-
833
- export class MyComponentComponent {
834
- @Output()
835
- public changed = new EventEmitter();
836
-
837
- public test = 'test';
838
-
839
- @Input()
840
- public value = new EventEmitter();
841
- }
842
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition > Decorator[expression.callee.name=\"Input\"]"]}]
843
- // Message: Missing JSDoc comment.
844
-
845
- requestAnimationFrame(draw)
846
-
847
- function bench() {
848
- }
849
- // Message: Missing JSDoc comment.
850
-
851
- class Foo {
852
- set aName (val) {}
853
- }
854
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkSetters":"no-getter","contexts":["MethodDefinition > FunctionExpression"]}]
855
- // Message: Missing JSDoc comment.
856
-
857
- class Foo {
858
- get aName () {}
859
- }
860
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkGetters":"no-setter","contexts":["MethodDefinition > FunctionExpression"]}]
861
- // Message: Missing JSDoc comment.
862
-
863
- const obj = {
864
- get aName () {},
865
- }
866
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkGetters":"no-setter","contexts":["Property > FunctionExpression"]}]
867
- // Message: Missing JSDoc comment.
868
-
869
- function comment () {
870
- return "comment";
871
- }
872
- // "jsdoc/require-jsdoc": ["error"|"warn", {"enableFixer":true,"fixerMessage":" TODO: add comment"}]
873
- // Message: Missing JSDoc comment.
874
-
875
- function comment () {
876
- return "comment";
877
- }
878
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["any",{"context":"FunctionDeclaration","inlineCommentBlock":true}],"fixerMessage":"TODO: add comment "}]
879
- // Message: Missing JSDoc comment.
880
-
881
- function comment () {
882
- return "comment";
883
- }
884
- // "jsdoc/require-jsdoc": ["error"|"warn", {"enableFixer":false,"fixerMessage":" TODO: add comment"}]
885
- // Message: Missing JSDoc comment.
886
-
887
- export class InovaAutoCompleteComponent {
888
- public disabled = false;
889
- }
890
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition"],"publicOnly":true}]
891
- // Message: Missing JSDoc comment.
892
-
893
- export default (arg) => arg;
894
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}]
895
- // Message: Missing JSDoc comment.
896
-
897
- export function outer() {
898
- function inner() {
899
- console.log('foo');
900
- }
901
-
902
- inner();
903
- }
904
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}]
905
- // Message: Missing JSDoc comment.
906
-
907
- export const outer = () => {
908
- const inner = () => {
909
- console.log('foo');
910
- };
911
-
912
- inner();
913
- };
914
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}]
915
- // Message: Missing JSDoc comment.
916
-
917
- /**
918
- *
919
- */
920
- export class InovaAutoCompleteComponent {
921
- public disabled = false;
922
- }
923
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition"],"publicOnly":true}]
924
- // Message: Missing JSDoc comment.
925
-
926
- /**
927
- * Some comment.
928
- */
929
- export class Component {
930
- public foo?: number;
931
- }
932
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkConstructors":false,"contexts":["PropertyDefinition"],"publicOnly":true}]
933
- // Message: Missing JSDoc comment.
934
-
935
- class Utility {
936
- /**
937
- *
938
- */
939
- mthd() {
940
- return false;
941
- }
942
- }
943
-
944
- module.exports = Utility;
945
- // "jsdoc/require-jsdoc": ["error"|"warn", {"enableFixer":false,"publicOnly":true,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}]
946
- // Message: Missing JSDoc comment.
947
-
948
- /**
949
- *
950
- */
951
- module.exports = class Utility {
952
- mthd() {
953
- return false;
954
- }
955
- };
956
- // "jsdoc/require-jsdoc": ["error"|"warn", {"enableFixer":false,"publicOnly":true,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}]
957
- // Message: Missing JSDoc comment.
958
-
959
- function quux () {
960
- return 3;
961
- }
962
-
963
- function b () {}
964
- // "jsdoc/require-jsdoc": ["error"|"warn", {"minLineCount":2}]
965
- // Message: Missing JSDoc comment.
966
-
967
- function quux () {
968
- return 3;
969
- }
970
-
971
- var a = {};
972
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":[{"context":"FunctionDeclaration","minLineCount":2},{"context":"VariableDeclaration","minLineCount":2}],"require":{"FunctionDeclaration":false}}]
973
- // Message: Missing JSDoc comment.
974
-
975
- function quux () {
976
- return 3;
977
- }
978
-
979
- var a = {
980
- b: 1,
981
- c: 2
982
- };
983
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":[{"context":"FunctionDeclaration","minLineCount":4},{"context":"VariableDeclaration","minLineCount":2}],"require":{"FunctionDeclaration":false}}]
984
- // Message: Missing JSDoc comment.
985
-
986
- class A {
987
- setId(newId: number): void {
988
- this.id = id;
989
- }
990
- }
991
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":[{"context":"MethodDefinition","minLineCount":3}],"require":{"ClassDeclaration":false,"FunctionExpression":false,"MethodDefinition":false}}]
992
- // Message: Missing JSDoc comment.
993
-
994
- export class MyClass {
995
-
996
- public myPublicProperty: number = 1;
997
- /* ^ Missing JSDoc comment. eslint(jsdoc/require-jsdoc) - expected ✅ */
998
-
999
- private myPrivateProp: number = -1;
1000
- /* ^ Missing JSDoc comment. eslint(jsdoc/require-jsdoc) - unexpected ❌ */
1001
-
1002
- // ...
1003
- }
1004
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition"],"publicOnly":true}]
1005
- // Message: Missing JSDoc comment.
1006
- ````
1007
-
1008
-
1009
-
1010
- <a name="user-content-require-jsdoc-passing-examples"></a>
1011
- <a name="require-jsdoc-passing-examples"></a>
1012
- ## Passing examples
1013
-
1014
- The following patterns are not considered problems:
1015
-
1016
- ````js
1017
- interface FooBar {
1018
- fooBar: string;
1019
- }
1020
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true}}]
1021
-
1022
- /** This is comment */
1023
- interface FooBar {
1024
- fooBar: string;
1025
- }
1026
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true}}]
1027
-
1028
- /** This is comment */
1029
- export class Foo {
1030
- someMethod() {
1031
- interface FooBar {
1032
- fooBar: string;
1033
- }
1034
- }
1035
- }
1036
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true}}]
1037
-
1038
- /** This is comment */
1039
- function someFunction() {
1040
- interface FooBar {
1041
- fooBar: string;
1042
- }
1043
- }
1044
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true}}]
1045
-
1046
- /** This is comment */
1047
- export function foo() {
1048
- interface bar {
1049
- fooBar: string;
1050
- }
1051
- }
1052
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration","TSMethodSignature","TSPropertySignature"],"publicOnly":{"ancestorsOnly":true}}]
1053
-
1054
- /**
1055
- *
1056
- */
1057
-
1058
- var array = [1,2,3];
1059
- array.forEach(function() {});
1060
-
1061
- /**
1062
- * @class MyClass
1063
- **/
1064
- function MyClass() {}
1065
-
1066
- /**
1067
- Function doing something
1068
- */
1069
- function myFunction() {}
1070
- /**
1071
- Function doing something
1072
- */
1073
- var myFunction = function() {};
1074
- /**
1075
- Function doing something
1076
- */
1077
- Object.myFunction = function () {};
1078
- var obj = {
1079
- /**
1080
- * Function doing something
1081
- **/
1082
- myFunction: function () {} };
1083
-
1084
- /**
1085
- @func myFunction
1086
- */
1087
- function myFunction() {}
1088
- /**
1089
- @method myFunction
1090
- */
1091
- function myFunction() {}
1092
- /**
1093
- @function myFunction
1094
- */
1095
- function myFunction() {}
1096
-
1097
- /**
1098
- @func myFunction
1099
- */
1100
- var myFunction = function () {}
1101
- /**
1102
- @method myFunction
1103
- */
1104
- var myFunction = function () {}
1105
- /**
1106
- @function myFunction
1107
- */
1108
- var myFunction = function () {}
1109
-
1110
- /**
1111
- @func myFunction
1112
- */
1113
- Object.myFunction = function() {}
1114
- /**
1115
- @method myFunction
1116
- */
1117
- Object.myFunction = function() {}
1118
- /**
1119
- @function myFunction
1120
- */
1121
- Object.myFunction = function() {}
1122
- (function(){})();
1123
-
1124
- var object = {
1125
- /**
1126
- * @func myFunction - Some function
1127
- */
1128
- myFunction: function() {} }
1129
- var object = {
1130
- /**
1131
- * @method myFunction - Some function
1132
- */
1133
- myFunction: function() {} }
1134
- var object = {
1135
- /**
1136
- * @function myFunction - Some function
1137
- */
1138
- myFunction: function() {} }
1139
-
1140
- var array = [1,2,3];
1141
- array.filter(function() {});
1142
- Object.keys(this.options.rules || {}).forEach(function(name) {}.bind(this));
1143
- var object = { name: 'key'};
1144
- Object.keys(object).forEach(function() {})
1145
-
1146
- /**
1147
- * @func myFunction
1148
- */
1149
-
1150
- function myFunction() {
1151
-
1152
- }
1153
- // Settings: {"jsdoc":{"maxLines":2,"minLines":0}}
1154
-
1155
- /**
1156
- * @func myFunction
1157
- */
1158
-
1159
-
1160
- function myFunction() {
1161
-
1162
- }
1163
- // Settings: {"jsdoc":{"maxLines":3,"minLines":0}}
1164
-
1165
- /** @func myFunction */ function myFunction() {
1166
-
1167
- }
1168
- // Settings: {"jsdoc":{"maxLines":0,"minLines":0}}
1169
-
1170
- /**
1171
- * @func myFunction
1172
- */
1173
-
1174
- function myFunction() {
1175
-
1176
- }
1177
- // Settings: {"jsdoc":{"maxLines":3,"minLines":2}}
1178
-
1179
- function myFunction() {}
1180
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"FunctionDeclaration":false,"MethodDefinition":true}}]
1181
-
1182
- var myFunction = function() {}
1183
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"FunctionDeclaration":false,"MethodDefinition":true}}]
1184
-
1185
- /**
1186
- * Description for A.
1187
- */
1188
- class A {
1189
- /**
1190
- * Description for constructor.
1191
- * @param {object[]} xs - xs
1192
- */
1193
- constructor(xs) {
1194
- this.a = xs;
1195
- }
1196
- }
1197
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"MethodDefinition":true}}]
1198
-
1199
- /**
1200
- * Description for A.
1201
- */
1202
- class App extends Component {
1203
- /**
1204
- * Description for constructor.
1205
- * @param {object[]} xs - xs
1206
- */
1207
- constructor(xs) {
1208
- this.a = xs;
1209
- }
1210
- }
1211
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"MethodDefinition":true}}]
1212
-
1213
- /**
1214
- * Description for A.
1215
- */
1216
- export default class App extends Component {
1217
- /**
1218
- * Description for constructor.
1219
- * @param {object[]} xs - xs
1220
- */
1221
- constructor(xs) {
1222
- this.a = xs;
1223
- }
1224
- }
1225
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"MethodDefinition":true}}]
1226
-
1227
- /**
1228
- * Description for A.
1229
- */
1230
- export class App extends Component {
1231
- /**
1232
- * Description for constructor.
1233
- * @param {object[]} xs - xs
1234
- */
1235
- constructor(xs) {
1236
- this.a = xs;
1237
- }
1238
- }
1239
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true,"MethodDefinition":true}}]
1240
-
1241
- class A {
1242
- constructor(xs) {
1243
- this.a = xs;
1244
- }
1245
- }
1246
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":false,"MethodDefinition":false}}]
1247
-
1248
- /**
1249
- * Function doing something
1250
- */
1251
- var myFunction = () => {}
1252
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":true}}]
1253
-
1254
- /**
1255
- * Function doing something
1256
- */
1257
- var myFunction = function () {}
1258
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":true}}]
1259
-
1260
- /**
1261
- * Function doing something
1262
- */
1263
- var myFunction = () => {}
1264
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":false}}]
1265
-
1266
- /**
1267
- Function doing something
1268
- */
1269
- var myFunction = () => () => {}
1270
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":true}}]
1271
-
1272
- setTimeout(() => {}, 10);
1273
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":true}}]
1274
-
1275
- /**
1276
- JSDoc Block
1277
- */
1278
- var foo = function() {}
1279
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionExpression":true}}]
1280
-
1281
- const foo = {/**
1282
- JSDoc Block
1283
- */
1284
- bar() {}}
1285
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionExpression":true}}]
1286
-
1287
- var foo = {/**
1288
- JSDoc Block
1289
- */
1290
- bar: function() {}}
1291
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionExpression":true}}]
1292
-
1293
- var foo = { [function() {}]: 1 };
1294
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"FunctionExpression":true}}]
1295
-
1296
- function foo () {}
1297
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyFunctions":true}]
1298
-
1299
- function foo () {
1300
- return;
1301
- }
1302
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyFunctions":true}]
1303
-
1304
- const test = {};
1305
- /**
1306
- * test
1307
- */
1308
- test.method = function () {
1309
-
1310
- }
1311
- module.exports = {
1312
- prop: { prop2: test.method }
1313
- }
1314
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1315
-
1316
- /**
1317
- *
1318
- */
1319
- function test() {
1320
-
1321
- }
1322
-
1323
- module.exports = {
1324
- prop: { prop2: test }
1325
- }
1326
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1327
-
1328
- /**
1329
- *
1330
- */
1331
- test = function() {
1332
-
1333
- }
1334
-
1335
- module.exports = {
1336
- prop: { prop2: test }
1337
- }
1338
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":true,"esm":false,"window":false},"require":{"FunctionExpression":true}}]
1339
-
1340
- /**
1341
- *
1342
- */
1343
- test = function() {
1344
-
1345
- }
1346
-
1347
- exports.someMethod = {
1348
- prop: { prop2: test }
1349
- }
1350
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"FunctionExpression":true}}]
1351
-
1352
- /**
1353
- *
1354
- */
1355
- const test = () => {
1356
-
1357
- }
1358
-
1359
- module.exports = {
1360
- prop: { prop2: test }
1361
- }
1362
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":true}}]
1363
-
1364
- const test = () => {
1365
-
1366
- }
1367
- module.exports = {
1368
- prop: { prop2: test }
1369
- }
1370
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"ArrowFunctionExpression":true}}]
1371
-
1372
- /**
1373
- *
1374
- */
1375
- window.test = function() {
1376
-
1377
- }
1378
-
1379
- module.exports = {
1380
- prop: window
1381
- }
1382
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1383
-
1384
- test = function() {
1385
-
1386
- }
1387
-
1388
- /**
1389
- *
1390
- */
1391
- test = function() {
1392
-
1393
- }
1394
-
1395
- module.exports = {
1396
- prop: { prop2: test }
1397
- }
1398
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1399
-
1400
- test = function() {
1401
-
1402
- }
1403
-
1404
- test = 2;
1405
-
1406
- module.exports = {
1407
- prop: { prop2: test }
1408
- }
1409
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1410
-
1411
- /**
1412
- *
1413
- */
1414
- function test() {
1415
-
1416
- }
1417
-
1418
- /**
1419
- *
1420
- */
1421
- test.prototype.method = function() {
1422
-
1423
- }
1424
-
1425
- module.exports = {
1426
- prop: { prop2: test }
1427
- }
1428
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1429
-
1430
- class Test {
1431
- /**
1432
- * Test
1433
- */
1434
- method() {
1435
-
1436
- }
1437
- }
1438
- module.exports = Test;
1439
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"MethodDefinition":true}}]
1440
-
1441
- /**
1442
- *
1443
- */
1444
- export default function quux () {
1445
-
1446
- }
1447
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1448
-
1449
- /**
1450
- *
1451
- */
1452
- export default function quux () {
1453
-
1454
- }
1455
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"FunctionExpression":true}}]
1456
-
1457
- /**
1458
- *
1459
- */
1460
- function quux () {
1461
-
1462
- }
1463
- export default quux;
1464
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1465
-
1466
- function quux () {
1467
-
1468
- }
1469
- export default quux;
1470
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"FunctionExpression":true}}]
1471
-
1472
- /**
1473
- *
1474
- */
1475
- export function test() {
1476
-
1477
- }
1478
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1479
-
1480
- /**
1481
- *
1482
- */
1483
- export function test() {
1484
-
1485
- }
1486
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"FunctionExpression":true}}]
1487
-
1488
- /**
1489
- *
1490
- */
1491
- var test = function () {
1492
-
1493
- }
1494
- var test2 = 2;
1495
- export { test, test2 }
1496
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1497
-
1498
- /**
1499
- *
1500
- */
1501
- var test = function () {
1502
-
1503
- }
1504
- export { test as test2 }
1505
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1506
-
1507
- /**
1508
- *
1509
- */
1510
- export default class A {
1511
-
1512
- }
1513
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"ancestorsOnly":true},"require":{"ClassDeclaration":true}}]
1514
-
1515
- /**
1516
- *
1517
- */
1518
- var test = function () {
1519
-
1520
- }
1521
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"window":true},"require":{"FunctionExpression":true}}]
1522
-
1523
- let test = function () {
1524
-
1525
- }
1526
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"window":true},"require":{"FunctionExpression":true}}]
1527
-
1528
- let test = class {
1529
-
1530
- }
1531
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ClassExpression":false}}]
1532
-
1533
- /**
1534
- *
1535
- */
1536
- let test = class {
1537
-
1538
- }
1539
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ClassExpression":true}}]
1540
-
1541
- export function someMethod() {
1542
-
1543
- }
1544
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":true,"esm":false,"window":false},"require":{"FunctionDeclaration":true}}]
1545
-
1546
- export function someMethod() {
1547
-
1548
- }
1549
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":true,"esm":false,"window":false},"require":{"FunctionDeclaration":true}}]
1550
-
1551
- exports.someMethod = function() {
1552
-
1553
- }
1554
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":{"cjs":false,"esm":true,"window":false},"require":{"FunctionExpression":true}}]
1555
-
1556
- const myObject = {
1557
- myProp: true
1558
- };
1559
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":[]}]
1560
-
1561
- function bear() {}
1562
- /**
1563
- *
1564
- */
1565
- function quux () {
1566
- }
1567
- export default quux;
1568
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"FunctionExpression":true}}]
1569
-
1570
- /**
1571
- * This example interface is great!
1572
- */
1573
- export interface Example {
1574
- /**
1575
- * My super test string!
1576
- */
1577
- test: string
1578
- }
1579
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration"]}]
1580
-
1581
- /**
1582
- * This example interface is great!
1583
- */
1584
- interface Example {
1585
- /**
1586
- * My super test string!
1587
- */
1588
- test: string
1589
- }
1590
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSInterfaceDeclaration"]}]
1591
-
1592
- /**
1593
- * This example type is great!
1594
- */
1595
- export type Example = {
1596
- /**
1597
- * My super test string!
1598
- */
1599
- test: string
1600
- };
1601
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSTypeAliasDeclaration"]}]
1602
-
1603
- /**
1604
- * This example type is great!
1605
- */
1606
- type Example = {
1607
- /**
1608
- * My super test string!
1609
- */
1610
- test: string
1611
- };
1612
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSTypeAliasDeclaration"]}]
1613
-
1614
- /**
1615
- * This example enum is great!
1616
- */
1617
- export enum Example {
1618
- /**
1619
- * My super test enum!
1620
- */
1621
- test = 123
1622
- }
1623
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSEnumDeclaration"]}]
1624
-
1625
- /**
1626
- * This example enum is great!
1627
- */
1628
- enum Example {
1629
- /**
1630
- * My super test enum!
1631
- */
1632
- test = 123
1633
- }
1634
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSEnumDeclaration"]}]
1635
-
1636
- const foo = {...{}};
1637
- function bar() {}
1638
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyFunctions":false,"publicOnly":true,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":false,"MethodDefinition":true}}]
1639
-
1640
- /**
1641
- * Class documentation
1642
- */
1643
- @logged
1644
- export default class Foo {
1645
- // ....
1646
- }
1647
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyFunctions":false,"require":{"ClassDeclaration":true}}]
1648
-
1649
- const a = {};
1650
- const b = {
1651
- ...a
1652
- };
1653
-
1654
- export default b;
1655
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["ObjectExpression"],"exemptEmptyFunctions":false,"publicOnly":true}]
1656
-
1657
- /**
1658
- * Foo interface documentation.
1659
- */
1660
- export interface Foo extends Bar {
1661
- /**
1662
- * baz method documentation.
1663
- */
1664
- baz(): void;
1665
-
1666
- /**
1667
- * meow method documentation.
1668
- */
1669
- meow(): void;
1670
- }
1671
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSMethodSignature"]}]
1672
-
1673
- export default class Test {
1674
- private abc(a) {
1675
- this.a = a;
1676
- }
1677
- }
1678
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["MethodDefinition > FunctionExpression"],"publicOnly":true,"require":{"ArrowFunctionExpression":false,"ClassDeclaration":false,"ClassExpression":false,"FunctionDeclaration":false,"FunctionExpression":false,"MethodDefinition":false}}]
1679
-
1680
- /**
1681
- * Basic application controller.
1682
- */
1683
- @Controller()
1684
- export class AppController {
1685
- /**
1686
- * Returns the application information.
1687
- *
1688
- * @returns ...
1689
- */
1690
- @Get('/info')
1691
- public getInfo(): string {
1692
- return 'OK';
1693
- }
1694
- }
1695
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":false,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":false,"MethodDefinition":true}}]
1696
-
1697
- /**
1698
- * Entity to represent a user in the system.
1699
- */
1700
- @Entity('users')
1701
- export class User {
1702
- }
1703
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":false,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":false,"MethodDefinition":true}}]
1704
-
1705
- /**
1706
- * Entity to represent a user in the system.
1707
- */
1708
- @Entity('users', getVal())
1709
- export class User {
1710
- }
1711
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ArrowFunctionExpression":false,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":false,"MethodDefinition":true}}]
1712
-
1713
- /**
1714
- *
1715
- */
1716
- class Foo {
1717
- constructor() {}
1718
- }
1719
- // "jsdoc/require-jsdoc": ["error"|"warn", {"exemptEmptyConstructors":true,"require":{"MethodDefinition":true}}]
1720
-
1721
- /**
1722
- *
1723
- */
1724
- class Foo {
1725
- constructor() {}
1726
- }
1727
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkConstructors":false,"require":{"MethodDefinition":true}}]
1728
-
1729
- class Foo {
1730
- get aName () {}
1731
- set aName (val) {}
1732
- }
1733
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkGetters":"no-setter","checkSetters":false,"contexts":["MethodDefinition > FunctionExpression"]}]
1734
-
1735
- const obj = {
1736
- get aName () {},
1737
- set aName (val) {}
1738
- }
1739
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkGetters":"no-setter","checkSetters":false,"contexts":["Property > FunctionExpression"]}]
1740
-
1741
- class Foo {
1742
- set aName (val) {}
1743
- }
1744
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkSetters":false,"contexts":["MethodDefinition > FunctionExpression"]}]
1745
-
1746
- class Foo {
1747
- get aName () {}
1748
- }
1749
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkGetters":false,"contexts":["MethodDefinition > FunctionExpression"]}]
1750
-
1751
- class Foo {
1752
- /**
1753
- *
1754
- */
1755
- set aName (val) {}
1756
- }
1757
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkSetters":"no-getter","contexts":["MethodDefinition > FunctionExpression"]}]
1758
-
1759
- class Foo {
1760
- /**
1761
- *
1762
- */
1763
- get aName () {}
1764
- }
1765
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkGetters":"no-setter","contexts":["MethodDefinition > FunctionExpression"]}]
1766
-
1767
- class Foo {
1768
- get aName () {}
1769
- set aName (val) {}
1770
- }
1771
- // "jsdoc/require-jsdoc": ["error"|"warn", {"checkGetters":false,"checkSetters":"no-getter","contexts":["MethodDefinition > FunctionExpression"]}]
1772
-
1773
- class Base {
1774
- constructor() {
1775
- }
1776
- }
1777
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["MethodDefinition"],"exemptEmptyConstructors":true}]
1778
-
1779
- /**
1780
- * This is a text.
1781
- */
1782
- export function a(); // Reports an error
1783
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSDeclareFunction"],"require":{"FunctionDeclaration":true}}]
1784
-
1785
- /**
1786
- * Foo
1787
- */
1788
- export function foo(): void {
1789
- function bar(): void {
1790
- console.log('bar');
1791
- }
1792
-
1793
- console.log('foo');
1794
- }
1795
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true}]
1796
-
1797
- const foo = {
1798
- bar: () => {
1799
- // ...
1800
- }
1801
- }
1802
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":[":not(Property) > ArrowFunctionExpression"],"require":{"ArrowFunctionExpression":false,"ClassDeclaration":true,"ClassExpression":true}}]
1803
-
1804
- /** Defines the current user's settings. */
1805
- @Injectable({
1806
- providedIn: 'root',
1807
- })
1808
- @State<Partial<UserSettingsStateModel>>
1809
- ({
1810
- name: 'userSettings',
1811
- defaults: {
1812
- isDev: !environment.production,
1813
- },
1814
- })
1815
- export class UserSettingsState { }
1816
- // "jsdoc/require-jsdoc": ["error"|"warn", {"require":{"ClassDeclaration":true}}]
1817
-
1818
- /**
1819
- * Entity to represent a user in the system.
1820
- */
1821
- @Entity('users')
1822
- export class User {
1823
- }
1824
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["Decorator"],"require":{"FunctionDeclaration":false}}]
1825
-
1826
- function quux () {
1827
- return 3;
1828
- }
1829
-
1830
- function b () {}
1831
- // "jsdoc/require-jsdoc": ["error"|"warn", {"minLineCount":4}]
1832
-
1833
- function quux () {
1834
- return 3;
1835
- }
1836
-
1837
- var a = {
1838
- b: 1,
1839
- c: 2
1840
- };
1841
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["ClassDeclaration",{"context":"FunctionDeclaration","minLineCount":4},{"context":"VariableDeclaration","minLineCount":5}],"require":{"FunctionDeclaration":false}}]
1842
-
1843
- class A {
1844
- setId(newId: number): void {
1845
- this.id = id;
1846
- }
1847
- }
1848
- // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":[{"context":"MethodDefinition","minLineCount":4}],"require":{"ClassDeclaration":false,"FunctionExpression":false,"MethodDefinition":false}}]
1849
-
1850
- export default class Test {
1851
- private abc(a) {
1852
- this.a = a;
1853
- }
1854
- }
1855
- // "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":false,"ClassDeclaration":false,"ClassExpression":false,"FunctionDeclaration":false,"FunctionExpression":false,"MethodDefinition":true}}]
1856
- ````
1857
-