eslint-plugin-jsdoc 46.4.6 → 46.5.0

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 (187) 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/package.json +14 -12
  5. package/dist/WarnSettings.d.ts +0 -17
  6. package/dist/WarnSettings.d.ts.map +0 -1
  7. package/dist/alignTransform.d.ts +0 -32
  8. package/dist/alignTransform.d.ts.map +0 -1
  9. package/dist/defaultTagOrder.d.ts +0 -5
  10. package/dist/defaultTagOrder.d.ts.map +0 -1
  11. package/dist/exportParser.d.ts +0 -41
  12. package/dist/exportParser.d.ts.map +0 -1
  13. package/dist/getDefaultTagStructureForMode.d.ts +0 -11
  14. package/dist/getDefaultTagStructureForMode.d.ts.map +0 -1
  15. package/dist/index.d.ts +0 -10
  16. package/dist/index.d.ts.map +0 -1
  17. package/dist/iterateJsdoc.d.ts +0 -460
  18. package/dist/iterateJsdoc.d.ts.map +0 -1
  19. package/dist/jsdocUtils.d.ts +0 -421
  20. package/dist/jsdocUtils.d.ts.map +0 -1
  21. package/dist/rules/checkAccess.d.ts +0 -3
  22. package/dist/rules/checkAccess.d.ts.map +0 -1
  23. package/dist/rules/checkAlignment.d.ts +0 -3
  24. package/dist/rules/checkAlignment.d.ts.map +0 -1
  25. package/dist/rules/checkExamples.d.ts +0 -4
  26. package/dist/rules/checkExamples.d.ts.map +0 -1
  27. package/dist/rules/checkIndentation.d.ts +0 -3
  28. package/dist/rules/checkIndentation.d.ts.map +0 -1
  29. package/dist/rules/checkLineAlignment.d.ts +0 -10
  30. package/dist/rules/checkLineAlignment.d.ts.map +0 -1
  31. package/dist/rules/checkParamNames.d.ts +0 -3
  32. package/dist/rules/checkParamNames.d.ts.map +0 -1
  33. package/dist/rules/checkPropertyNames.d.ts +0 -3
  34. package/dist/rules/checkPropertyNames.d.ts.map +0 -1
  35. package/dist/rules/checkSyntax.d.ts +0 -3
  36. package/dist/rules/checkSyntax.d.ts.map +0 -1
  37. package/dist/rules/checkTagNames.d.ts +0 -3
  38. package/dist/rules/checkTagNames.d.ts.map +0 -1
  39. package/dist/rules/checkTypes.d.ts +0 -3
  40. package/dist/rules/checkTypes.d.ts.map +0 -1
  41. package/dist/rules/checkValues.d.ts +0 -3
  42. package/dist/rules/checkValues.d.ts.map +0 -1
  43. package/dist/rules/emptyTags.d.ts +0 -3
  44. package/dist/rules/emptyTags.d.ts.map +0 -1
  45. package/dist/rules/implementsOnClasses.d.ts +0 -3
  46. package/dist/rules/implementsOnClasses.d.ts.map +0 -1
  47. package/dist/rules/importsAsDependencies.d.ts +0 -3
  48. package/dist/rules/importsAsDependencies.d.ts.map +0 -1
  49. package/dist/rules/informativeDocs.d.ts +0 -3
  50. package/dist/rules/informativeDocs.d.ts.map +0 -1
  51. package/dist/rules/matchDescription.d.ts +0 -3
  52. package/dist/rules/matchDescription.d.ts.map +0 -1
  53. package/dist/rules/matchName.d.ts +0 -3
  54. package/dist/rules/matchName.d.ts.map +0 -1
  55. package/dist/rules/multilineBlocks.d.ts +0 -3
  56. package/dist/rules/multilineBlocks.d.ts.map +0 -1
  57. package/dist/rules/noBadBlocks.d.ts +0 -3
  58. package/dist/rules/noBadBlocks.d.ts.map +0 -1
  59. package/dist/rules/noBlankBlockDescriptions.d.ts +0 -3
  60. package/dist/rules/noBlankBlockDescriptions.d.ts.map +0 -1
  61. package/dist/rules/noBlankBlocks.d.ts +0 -3
  62. package/dist/rules/noBlankBlocks.d.ts.map +0 -1
  63. package/dist/rules/noDefaults.d.ts +0 -3
  64. package/dist/rules/noDefaults.d.ts.map +0 -1
  65. package/dist/rules/noMissingSyntax.d.ts +0 -10
  66. package/dist/rules/noMissingSyntax.d.ts.map +0 -1
  67. package/dist/rules/noMultiAsterisks.d.ts +0 -3
  68. package/dist/rules/noMultiAsterisks.d.ts.map +0 -1
  69. package/dist/rules/noRestrictedSyntax.d.ts +0 -3
  70. package/dist/rules/noRestrictedSyntax.d.ts.map +0 -1
  71. package/dist/rules/noTypes.d.ts +0 -3
  72. package/dist/rules/noTypes.d.ts.map +0 -1
  73. package/dist/rules/noUndefinedTypes.d.ts +0 -3
  74. package/dist/rules/noUndefinedTypes.d.ts.map +0 -1
  75. package/dist/rules/requireAsteriskPrefix.d.ts +0 -3
  76. package/dist/rules/requireAsteriskPrefix.d.ts.map +0 -1
  77. package/dist/rules/requireDescription.d.ts +0 -3
  78. package/dist/rules/requireDescription.d.ts.map +0 -1
  79. package/dist/rules/requireDescriptionCompleteSentence.d.ts +0 -3
  80. package/dist/rules/requireDescriptionCompleteSentence.d.ts.map +0 -1
  81. package/dist/rules/requireExample.d.ts +0 -3
  82. package/dist/rules/requireExample.d.ts.map +0 -1
  83. package/dist/rules/requireFileOverview.d.ts +0 -3
  84. package/dist/rules/requireFileOverview.d.ts.map +0 -1
  85. package/dist/rules/requireHyphenBeforeParamDescription.d.ts +0 -3
  86. package/dist/rules/requireHyphenBeforeParamDescription.d.ts.map +0 -1
  87. package/dist/rules/requireJsdoc.d.ts +0 -9
  88. package/dist/rules/requireJsdoc.d.ts.map +0 -1
  89. package/dist/rules/requireParam.d.ts +0 -4
  90. package/dist/rules/requireParam.d.ts.map +0 -1
  91. package/dist/rules/requireParamDescription.d.ts +0 -3
  92. package/dist/rules/requireParamDescription.d.ts.map +0 -1
  93. package/dist/rules/requireParamName.d.ts +0 -3
  94. package/dist/rules/requireParamName.d.ts.map +0 -1
  95. package/dist/rules/requireParamType.d.ts +0 -3
  96. package/dist/rules/requireParamType.d.ts.map +0 -1
  97. package/dist/rules/requireProperty.d.ts +0 -3
  98. package/dist/rules/requireProperty.d.ts.map +0 -1
  99. package/dist/rules/requirePropertyDescription.d.ts +0 -3
  100. package/dist/rules/requirePropertyDescription.d.ts.map +0 -1
  101. package/dist/rules/requirePropertyName.d.ts +0 -3
  102. package/dist/rules/requirePropertyName.d.ts.map +0 -1
  103. package/dist/rules/requirePropertyType.d.ts +0 -3
  104. package/dist/rules/requirePropertyType.d.ts.map +0 -1
  105. package/dist/rules/requireReturns.d.ts +0 -3
  106. package/dist/rules/requireReturns.d.ts.map +0 -1
  107. package/dist/rules/requireReturnsCheck.d.ts +0 -3
  108. package/dist/rules/requireReturnsCheck.d.ts.map +0 -1
  109. package/dist/rules/requireReturnsDescription.d.ts +0 -3
  110. package/dist/rules/requireReturnsDescription.d.ts.map +0 -1
  111. package/dist/rules/requireReturnsType.d.ts +0 -3
  112. package/dist/rules/requireReturnsType.d.ts.map +0 -1
  113. package/dist/rules/requireThrows.d.ts +0 -3
  114. package/dist/rules/requireThrows.d.ts.map +0 -1
  115. package/dist/rules/requireYields.d.ts +0 -3
  116. package/dist/rules/requireYields.d.ts.map +0 -1
  117. package/dist/rules/requireYieldsCheck.d.ts +0 -3
  118. package/dist/rules/requireYieldsCheck.d.ts.map +0 -1
  119. package/dist/rules/sortTags.d.ts +0 -3
  120. package/dist/rules/sortTags.d.ts.map +0 -1
  121. package/dist/rules/tagLines.d.ts +0 -3
  122. package/dist/rules/tagLines.d.ts.map +0 -1
  123. package/dist/rules/textEscaping.d.ts +0 -3
  124. package/dist/rules/textEscaping.d.ts.map +0 -1
  125. package/dist/rules/validTypes.d.ts +0 -3
  126. package/dist/rules/validTypes.d.ts.map +0 -1
  127. package/dist/tagNames.d.ts +0 -16
  128. package/dist/tagNames.d.ts.map +0 -1
  129. package/dist/utils/hasReturnValue.d.ts +0 -20
  130. package/dist/utils/hasReturnValue.d.ts.map +0 -1
  131. package/docs/advanced.md +0 -102
  132. package/docs/rules/check-access.md +0 -193
  133. package/docs/rules/check-alignment.md +0 -169
  134. package/docs/rules/check-examples.md +0 -784
  135. package/docs/rules/check-indentation.md +0 -296
  136. package/docs/rules/check-line-alignment.md +0 -1002
  137. package/docs/rules/check-param-names.md +0 -1035
  138. package/docs/rules/check-property-names.md +0 -244
  139. package/docs/rules/check-syntax.md +0 -80
  140. package/docs/rules/check-tag-names.md +0 -1132
  141. package/docs/rules/check-types.md +0 -1198
  142. package/docs/rules/check-values.md +0 -409
  143. package/docs/rules/empty-tags.md +0 -220
  144. package/docs/rules/implements-on-classes.md +0 -219
  145. package/docs/rules/imports-as-dependencies.md +0 -99
  146. package/docs/rules/informative-docs.md +0 -400
  147. package/docs/rules/match-description.md +0 -1008
  148. package/docs/rules/match-name.md +0 -249
  149. package/docs/rules/multiline-blocks.md +0 -398
  150. package/docs/rules/no-bad-blocks.md +0 -174
  151. package/docs/rules/no-blank-block-descriptions.md +0 -91
  152. package/docs/rules/no-blank-blocks.md +0 -98
  153. package/docs/rules/no-defaults.md +0 -207
  154. package/docs/rules/no-missing-syntax.md +0 -275
  155. package/docs/rules/no-multi-asterisks.md +0 -278
  156. package/docs/rules/no-restricted-syntax.md +0 -383
  157. package/docs/rules/no-types.md +0 -168
  158. package/docs/rules/no-undefined-types.md +0 -789
  159. package/docs/rules/require-asterisk-prefix.md +0 -297
  160. package/docs/rules/require-description-complete-sentence.md +0 -820
  161. package/docs/rules/require-description.md +0 -585
  162. package/docs/rules/require-example.md +0 -390
  163. package/docs/rules/require-file-overview.md +0 -324
  164. package/docs/rules/require-hyphen-before-param-description.md +0 -281
  165. package/docs/rules/require-jsdoc.md +0 -1857
  166. package/docs/rules/require-param-description.md +0 -238
  167. package/docs/rules/require-param-name.md +0 -163
  168. package/docs/rules/require-param-type.md +0 -227
  169. package/docs/rules/require-param.md +0 -1820
  170. package/docs/rules/require-property-description.md +0 -88
  171. package/docs/rules/require-property-name.md +0 -79
  172. package/docs/rules/require-property-type.md +0 -79
  173. package/docs/rules/require-property.md +0 -128
  174. package/docs/rules/require-returns-check.md +0 -1053
  175. package/docs/rules/require-returns-description.md +0 -181
  176. package/docs/rules/require-returns-type.md +0 -144
  177. package/docs/rules/require-returns.md +0 -1191
  178. package/docs/rules/require-throws.md +0 -326
  179. package/docs/rules/require-yields-check.md +0 -544
  180. package/docs/rules/require-yields.md +0 -823
  181. package/docs/rules/sort-tags.md +0 -635
  182. package/docs/rules/tag-lines.md +0 -551
  183. package/docs/rules/text-escaping.md +0 -177
  184. package/docs/rules/valid-types.md +0 -881
  185. package/docs/settings.md +0 -362
  186. package/tsconfig-prod.json +0 -20
  187. package/tsconfig.json +0 -21
@@ -1,1008 +0,0 @@
1
- <a name="user-content-match-description"></a>
2
- <a name="match-description"></a>
3
- # <code>match-description</code>
4
-
5
- * [Options](#user-content-match-description-options)
6
- * [`matchDescription`](#user-content-match-description-options-matchdescription)
7
- * [`message`](#user-content-match-description-options-message)
8
- * [`nonemptyTags`](#user-content-match-description-options-nonemptytags)
9
- * [`tags`](#user-content-match-description-options-tags)
10
- * [`mainDescription`](#user-content-match-description-options-maindescription)
11
- * [`contexts`](#user-content-match-description-options-contexts)
12
- * [Context and settings](#user-content-match-description-context-and-settings)
13
- * [Failing examples](#user-content-match-description-failing-examples)
14
- * [Passing examples](#user-content-match-description-passing-examples)
15
-
16
-
17
- Enforces a regular expression pattern on descriptions.
18
-
19
- The default is this basic expression to match English sentences (Support
20
- for Unicode upper case may be added in a future version when it can be handled
21
- by our supported Node versions):
22
-
23
- ``^\n?([A-Z`\\d_][\\s\\S]*[.?!`]\\s*)?$``
24
-
25
- Applies by default to the jsdoc block description and to the following tags:
26
-
27
- - `@description`/`@desc`
28
- - `@summary`
29
- - `@file`/`@fileoverview`/`@overview`
30
- - `@classdesc`
31
-
32
- In addition, the `tags` option (see below) may be used to match other tags.
33
-
34
- The default (and all regex options) defaults to using (only) the `u` flag, so
35
- to add your own flags, encapsulate your expression as a string, but like a
36
- literal, e.g., `/[A-Z].*\\./ui`.
37
-
38
- Note that `/` delimiters are optional, but necessary to add flags (besides
39
- `u`).
40
-
41
- Also note that the default or optional regular expressions is *not*
42
- case-insensitive unless one opts in to add the `i` flag.
43
-
44
- You can add the `s` flag if you want `.` to match newlines. Note, however,
45
- that the trailing newlines of a description will not be matched.
46
-
47
- <a name="user-content-match-description-options"></a>
48
- <a name="match-description-options"></a>
49
- ## Options
50
-
51
- <a name="user-content-match-description-options-matchdescription"></a>
52
- <a name="match-description-options-matchdescription"></a>
53
- ### <code>matchDescription</code>
54
-
55
- You can supply your own expression to override the default, passing a
56
- `matchDescription` string on the options object.
57
-
58
- ```js
59
- {
60
- 'jsdoc/match-description': ['error', {matchDescription: '[A-Z].*\\.'}]
61
- }
62
- ```
63
-
64
- <a name="user-content-match-description-options-message"></a>
65
- <a name="match-description-options-message"></a>
66
- ### <code>message</code>
67
-
68
- You may provide a custom default message by using the following format:
69
-
70
- ```js
71
- {
72
- 'jsdoc/match-description': ['error', {
73
- message: 'The default description should begin with a capital letter.'
74
- }]
75
- }
76
- ```
77
-
78
- This can be overridden per tag or for the main block description by setting
79
- `message` within `tags` or `mainDescription`, respectively.
80
-
81
- <a name="user-content-match-description-options-nonemptytags"></a>
82
- <a name="match-description-options-nonemptytags"></a>
83
- ### <code>nonemptyTags</code>
84
-
85
- If not set to `false`, will enforce that the following tags have at least
86
- some content:
87
-
88
- - `@copyright`
89
- - `@example`
90
- - `@see`
91
- - `@todo`
92
-
93
- If you supply your own tag description for any of the above tags in `tags`,
94
- your description will take precedence.
95
-
96
- <a name="user-content-match-description-options-tags"></a>
97
- <a name="match-description-options-tags"></a>
98
- ### <code>tags</code>
99
-
100
- If you want different regular expressions to apply to tags, you may use
101
- the `tags` option object:
102
-
103
- ```js
104
- {
105
- 'jsdoc/match-description': ['error', {tags: {
106
- param: '\\- [A-Z].*\\.',
107
- returns: '[A-Z].*\\.'
108
- }}]
109
- }
110
- ```
111
-
112
- In place of a string, you can also add `true` to indicate that a particular
113
- tag should be linted with the `matchDescription` value (or the default).
114
-
115
- ```js
116
- {
117
- 'jsdoc/match-description': ['error', {tags: {
118
- param: true,
119
- returns: true
120
- }}]
121
- }
122
- ```
123
-
124
- Alternatively, you may supply an object with a `message` property to indicate
125
- the error message for that tag.
126
-
127
- ```js
128
- {
129
- 'jsdoc/match-description': ['error', {tags: {
130
- param: {message: 'Begin with a hyphen', match: '\\- [A-Z].*\\.'},
131
- returns: {message: 'Capitalize for returns (the default)', match: true}
132
- }}]
133
- }
134
- ```
135
-
136
- The tags `@param`/`@arg`/`@argument` and `@property`/`@prop` will be properly
137
- parsed to ensure that the matched "description" text includes only the text
138
- after the name.
139
-
140
- All other tags will treat the text following the tag name, a space, and
141
- an optional curly-bracketed type expression (and another space) as part of
142
- its "description" (e.g., for `@returns {someType} some description`, the
143
- description is `some description` while for `@some-tag xyz`, the description
144
- is `xyz`).
145
-
146
- <a name="user-content-match-description-options-maindescription"></a>
147
- <a name="match-description-options-maindescription"></a>
148
- ### <code>mainDescription</code>
149
-
150
- If you wish to override the main block description without changing the
151
- default `match-description` (which can cascade to the `tags` with `true`),
152
- you may use `mainDescription`:
153
-
154
- ```js
155
- {
156
- 'jsdoc/match-description': ['error', {
157
- mainDescription: '[A-Z].*\\.',
158
- tags: {
159
- param: true,
160
- returns: true
161
- }
162
- }]
163
- }
164
- ```
165
-
166
- There is no need to add `mainDescription: true`, as by default, the main
167
- block description (and only the main block description) is linted, though you
168
- may disable checking it by setting it to `false`.
169
-
170
- You may also provide an object with `message`:
171
-
172
- ```js
173
- {
174
- 'jsdoc/match-description': ['error', {
175
- mainDescription: {
176
- message: 'Capitalize first word of JSDoc block descriptions',
177
- match: '[A-Z].*\\.'
178
- },
179
- tags: {
180
- param: true,
181
- returns: true
182
- }
183
- }]
184
- }
185
- ```
186
-
187
- <a name="user-content-match-description-options-contexts"></a>
188
- <a name="match-description-options-contexts"></a>
189
- ### <code>contexts</code>
190
-
191
- Set this to an array of strings representing the AST context (or an object with
192
- `context` and `comment` properties) where you wish the rule to be applied.
193
- (e.g., `ClassDeclaration` for ES6
194
- classes). Overrides the default contexts (see below). Set to `"any"` if you
195
- want the rule to apply to any jsdoc block throughout your files.
196
-
197
- See the ["AST and Selectors"](#user-content-eslint-plugin-jsdoc-advanced-ast-and-selectors)
198
- section of our README for more on the expected format.
199
-
200
- <a name="user-content-match-description-context-and-settings"></a>
201
- <a name="match-description-context-and-settings"></a>
202
- ## Context and settings
203
-
204
- |||
205
- |---|---|
206
- |Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled|
207
- |Tags|docblock and `@description` by default but more with `tags`|
208
- |Aliases|`@desc`|
209
- |Recommended|false|
210
- |Settings||
211
- |Options|`contexts`, `mainDescription`, `matchDescription`, `message`, `nonemptyTags`, `tags`|
212
-
213
- <a name="user-content-match-description-failing-examples"></a>
214
- <a name="match-description-failing-examples"></a>
215
- ## Failing examples
216
-
217
- The following patterns are considered problems:
218
-
219
- ````js
220
- /**
221
- * foo.
222
- */
223
- const q = class {
224
-
225
- }
226
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["ClassExpression"]}]
227
- // Message: JSDoc description does not satisfy the regex pattern.
228
-
229
- /**
230
- * foo.
231
- */
232
- const q = class {
233
-
234
- }
235
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["ClassExpression"],"message":"Needs to begin with a capital letter and end with an end mark."}]
236
- // Message: Needs to begin with a capital letter and end with an end mark.
237
-
238
- /**
239
- * foo.
240
- */
241
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["any"]}]
242
- // Message: JSDoc description does not satisfy the regex pattern.
243
-
244
- /**
245
- * foo.
246
- */
247
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["any"]}]
248
- // Message: JSDoc description does not satisfy the regex pattern.
249
-
250
- /**
251
- * foo.
252
- */
253
- const q = {
254
-
255
- };
256
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["ObjectExpression"]}]
257
- // Message: JSDoc description does not satisfy the regex pattern.
258
-
259
- /**
260
- * foo.
261
- */
262
- function quux () {
263
-
264
- }
265
- // Message: JSDoc description does not satisfy the regex pattern.
266
-
267
- /**
268
- * Foo)
269
- */
270
- function quux () {
271
-
272
- }
273
- // Message: JSDoc description does not satisfy the regex pattern.
274
-
275
- /**
276
- * тест.
277
- */
278
- function quux () {
279
-
280
- }
281
- // "jsdoc/match-description": ["error"|"warn", {"matchDescription":"[А-Я][А-я]+\\."}]
282
- // Message: JSDoc description does not satisfy the regex pattern.
283
-
284
- /**
285
- * тест.
286
- */
287
- function quux () {
288
-
289
- }
290
- // "jsdoc/match-description": ["error"|"warn", {"matchDescription":"[А-Я][А-я]+\\.","message":"Needs to begin with a capital letter and end with an end mark."}]
291
- // Message: Needs to begin with a capital letter and end with an end mark.
292
-
293
- /**
294
- * Abc.
295
- */
296
- function quux () {
297
-
298
- }
299
- // "jsdoc/match-description": ["error"|"warn", {"mainDescription":"[А-Я][А-я]+\\.","tags":{"param":true}}]
300
- // Message: JSDoc description does not satisfy the regex pattern.
301
-
302
- /**
303
- * Abc.
304
- */
305
- function quux () {
306
-
307
- }
308
- // "jsdoc/match-description": ["error"|"warn", {"mainDescription":{"match":"[А-Я][А-я]+\\.","message":"Needs to begin with a Cyrillic capital letter and end with a period."},"tags":{"param":true}}]
309
- // Message: Needs to begin with a Cyrillic capital letter and end with a period.
310
-
311
- /**
312
- * Foo
313
- */
314
- function quux () {
315
-
316
- }
317
- // Message: JSDoc description does not satisfy the regex pattern.
318
-
319
- /**
320
- * Foo.
321
- *
322
- * @param foo foo.
323
- */
324
- function quux (foo) {
325
-
326
- }
327
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"param":true}}]
328
- // Message: JSDoc description does not satisfy the regex pattern.
329
-
330
- /**
331
- * Foo.
332
- *
333
- * @template Abc, Def foo.
334
- */
335
- function quux (foo) {
336
-
337
- }
338
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"template":true}}]
339
- // Message: JSDoc description does not satisfy the regex pattern.
340
-
341
- /**
342
- * Foo.
343
- *
344
- * @prop foo foo.
345
- */
346
- function quux (foo) {
347
-
348
- }
349
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"prop":true}}]
350
- // Message: JSDoc description does not satisfy the regex pattern.
351
-
352
- /**
353
- * Foo.
354
- *
355
- * @summary foo.
356
- */
357
- function quux () {
358
-
359
- }
360
- // Message: JSDoc description does not satisfy the regex pattern.
361
-
362
- /**
363
- * Foo.
364
- *
365
- * @author
366
- */
367
- function quux () {
368
-
369
- }
370
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"author":".+"}}]
371
- // Message: JSDoc description does not satisfy the regex pattern.
372
-
373
- /**
374
- * Foo.
375
- *
376
- * @x-tag
377
- */
378
- function quux () {
379
-
380
- }
381
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"x-tag":".+"}}]
382
- // Message: JSDoc description does not satisfy the regex pattern.
383
-
384
- /**
385
- * Foo.
386
- *
387
- * @description foo foo.
388
- */
389
- function quux (foo) {
390
-
391
- }
392
- // Message: JSDoc description does not satisfy the regex pattern.
393
-
394
- /**
395
- * Foo
396
- *
397
- * @param foo foo.
398
- */
399
- function quux (foo) {
400
-
401
- }
402
- // "jsdoc/match-description": ["error"|"warn", {"mainDescription":"^[a-zA-Z]*\\s*$","tags":{"param":true}}]
403
- // Message: JSDoc description does not satisfy the regex pattern.
404
-
405
- /**
406
- * Foo
407
- *
408
- * @param foo foo.
409
- */
410
- function quux (foo) {
411
-
412
- }
413
- // "jsdoc/match-description": ["error"|"warn", {"mainDescription":{"match":"^[a-zA-Z]*\\s*$","message":"Letters only"},"tags":{"param":{"match":true,"message":"Needs to begin with a capital letter and end with a period."}}}]
414
- // Message: Needs to begin with a capital letter and end with a period.
415
-
416
- /**
417
- * Foo
418
- *
419
- * @param foo foo.
420
- */
421
- function quux (foo) {
422
-
423
- }
424
- // "jsdoc/match-description": ["error"|"warn", {"mainDescription":false,"tags":{"param":true}}]
425
- // Message: JSDoc description does not satisfy the regex pattern.
426
-
427
- /**
428
- * Foo.
429
- *
430
- * @param foo bar
431
- */
432
- function quux (foo) {
433
-
434
- }
435
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"param":true}}]
436
- // Message: JSDoc description does not satisfy the regex pattern.
437
-
438
- /**
439
- * {@see Foo.bar} buz
440
- */
441
- function quux (foo) {
442
-
443
- }
444
- // Message: JSDoc description does not satisfy the regex pattern.
445
-
446
- /**
447
- * Foo.
448
- *
449
- * @returns {number} foo
450
- */
451
- function quux (foo) {
452
-
453
- }
454
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"returns":true}}]
455
- // Message: JSDoc description does not satisfy the regex pattern.
456
-
457
- /**
458
- * Foo.
459
- *
460
- * @returns foo.
461
- */
462
- function quux (foo) {
463
-
464
- }
465
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"returns":true}}]
466
- // Message: JSDoc description does not satisfy the regex pattern.
467
-
468
- /**
469
- * lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque elit diam,
470
- * iaculis eu dignissim sed, ultrices sed nisi. nulla at ligula auctor, consectetur neque sed,
471
- * tincidunt nibh. vivamus sit amet vulputate ligula. vivamus interdum elementum nisl,
472
- * vitae rutrum tortor semper ut. morbi porta ante vitae dictum fermentum.
473
- * proin ut nulla at quam convallis gravida in id elit. sed dolor mauris, blandit quis ante at,
474
- * consequat auctor magna. duis pharetra purus in porttitor mollis.
475
- */
476
- function longDescription (foo) {
477
-
478
- }
479
- // Message: JSDoc description does not satisfy the regex pattern.
480
-
481
- /**
482
- * @arg {number} foo - Foo
483
- */
484
- function quux (foo) {
485
-
486
- }
487
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"arg":true}}]
488
- // Message: JSDoc description does not satisfy the regex pattern.
489
-
490
- /**
491
- * @argument {number} foo - Foo
492
- */
493
- function quux (foo) {
494
-
495
- }
496
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"argument":true}}]
497
- // Message: JSDoc description does not satisfy the regex pattern.
498
-
499
- /**
500
- * @return {number} foo
501
- */
502
- function quux (foo) {
503
-
504
- }
505
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"return":true}}]
506
- // Message: JSDoc description does not satisfy the regex pattern.
507
-
508
- /**
509
- * Returns bar.
510
- *
511
- * @return {number} bar
512
- */
513
- function quux (foo) {
514
-
515
- }
516
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"return":true}}]
517
- // Message: JSDoc description does not satisfy the regex pattern.
518
-
519
- /**
520
- * @param notRet
521
- * @returns Тест.
522
- */
523
- function quux () {
524
-
525
- }
526
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"param":"[А-Я][А-я]+\\."}}]
527
- // Message: JSDoc description does not satisfy the regex pattern.
528
-
529
- /**
530
- * @description notRet
531
- * @returns Тест.
532
- */
533
- function quux () {
534
-
535
- }
536
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"description":"[А-Я][А-я]+\\."}}]
537
- // Message: JSDoc description does not satisfy the regex pattern.
538
-
539
- /**
540
- * foo.
541
- */
542
- class quux {
543
-
544
- }
545
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["ClassDeclaration"]}]
546
- // Message: JSDoc description does not satisfy the regex pattern.
547
-
548
- class MyClass {
549
- /**
550
- * Abc
551
- */
552
- myClassField = 1
553
- }
554
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["PropertyDefinition"]}]
555
- // Message: JSDoc description does not satisfy the regex pattern.
556
-
557
- /**
558
- * foo.
559
- */
560
- interface quux {
561
-
562
- }
563
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["TSInterfaceDeclaration"]}]
564
- // Message: JSDoc description does not satisfy the regex pattern.
565
-
566
- const myObject = {
567
- /**
568
- * Bad description
569
- */
570
- myProp: true
571
- };
572
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["Property"]}]
573
- // Message: JSDoc description does not satisfy the regex pattern.
574
-
575
- /**
576
- * @param foo Foo bar
577
- */
578
- function quux (foo) {
579
-
580
- }
581
- // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
582
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"param":true}}]
583
- // Message: JSDoc description does not satisfy the regex pattern.
584
-
585
- /**
586
- * Foo bar
587
- */
588
- function quux (foo) {
589
-
590
- }
591
- // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
592
- // Message: JSDoc description does not satisfy the regex pattern.
593
-
594
- /**
595
- * Description with extra new line
596
- *
597
- */
598
- function quux () {
599
-
600
- }
601
- // "jsdoc/match-description": ["error"|"warn", {"matchDescription":"[\\s\\S]*\\S$"}]
602
- // Message: JSDoc description does not satisfy the regex pattern.
603
-
604
- /**
605
- *
606
- * This function does lots of things.
607
- */
608
- function quux () {
609
-
610
- }
611
- // "jsdoc/match-description": ["error"|"warn", {"matchDescription":"^\\S[\\s\\S]*\\S$"}]
612
- // Message: JSDoc description does not satisfy the regex pattern.
613
-
614
- /**
615
- *
616
- * @param
617
- */
618
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["any"],"matchDescription":"^\\S[\\s\\S]*\\S$"}]
619
- // Message: JSDoc description does not satisfy the regex pattern.
620
-
621
- /** Does something very important. */
622
- function foo(): string;
623
- // "jsdoc/match-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[endLine=0]"}],"matchDescription":"^\\S[\\s\\S]*\\S$"}]
624
- // Message: JSDoc description does not satisfy the regex pattern.
625
-
626
- /**
627
- * @copyright
628
- */
629
- function quux () {
630
- }
631
- // Message: JSDoc description must not be empty.
632
- ````
633
-
634
-
635
-
636
- <a name="user-content-match-description-passing-examples"></a>
637
- <a name="match-description-passing-examples"></a>
638
- ## Passing examples
639
-
640
- The following patterns are not considered problems:
641
-
642
- ````js
643
- /**
644
- *
645
- */
646
-
647
- /**
648
- *
649
- */
650
- function quux () {
651
-
652
- }
653
-
654
- /**
655
- * @param foo - Foo.
656
- */
657
- function quux () {
658
-
659
- }
660
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"param":true}}]
661
-
662
- /**
663
- * Foo.
664
- */
665
- function quux () {
666
-
667
- }
668
-
669
- /**
670
- * Foo.
671
- * Bar.
672
- */
673
- function quux () {
674
-
675
- }
676
-
677
- /**
678
- * Foo.
679
- *
680
- * Bar.
681
- */
682
- function quux () {
683
-
684
- }
685
-
686
- /**
687
- * Foo.
688
- *
689
- * Bar.
690
- */
691
- function quux () {
692
-
693
- }
694
- // "jsdoc/match-description": ["error"|"warn", {"message":"This won't be shown"}]
695
-
696
- /**
697
- * Тест.
698
- */
699
- function quux () {
700
-
701
- }
702
- // "jsdoc/match-description": ["error"|"warn", {"matchDescription":"[А-Я][А-я]+\\."}]
703
-
704
- /**
705
- * @param notRet
706
- * @returns Тест.
707
- */
708
- function quux () {
709
-
710
- }
711
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"returns":"[А-Я][А-я]+\\."}}]
712
-
713
- /**
714
- * @param notRet
715
- * @description Тест.
716
- */
717
- function quux () {
718
-
719
- }
720
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"description":"[А-Я][А-я]+\\."}}]
721
-
722
- /**
723
- * Foo
724
- * bar.
725
- */
726
- function quux () {
727
-
728
- }
729
-
730
- /**
731
- * @returns Foo bar.
732
- */
733
- function quux () {
734
-
735
- }
736
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"returns":true}}]
737
-
738
- /**
739
- * @returns {type1} Foo bar.
740
- */
741
- function quux () {
742
-
743
- }
744
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"returns":true}}]
745
-
746
- /**
747
- * @description Foo bar.
748
- */
749
- function quux () {
750
-
751
- }
752
-
753
- /**
754
- * @description Foo
755
- * bar.
756
- * @param
757
- */
758
- function quux () {
759
-
760
- }
761
-
762
- /** @description Foo bar. */
763
- function quux () {
764
-
765
- }
766
-
767
- /**
768
- * @description Foo
769
- * bar.
770
- */
771
- function quux () {
772
-
773
- }
774
-
775
- /**
776
- * Foo. {@see Math.sin}.
777
- */
778
- function quux () {
779
-
780
- }
781
-
782
- /**
783
- * Foo {@see Math.sin} bar.
784
- */
785
- function quux () {
786
-
787
- }
788
-
789
- /**
790
- * Foo?
791
- *
792
- * Bar!
793
- *
794
- * Baz:
795
- * 1. Foo.
796
- * 2. Bar.
797
- */
798
- function quux () {
799
-
800
- }
801
-
802
- /**
803
- * Hello:
804
- * World.
805
- */
806
- function quux () {
807
-
808
- }
809
-
810
- /**
811
- * Hello: world.
812
- */
813
- function quux () {
814
-
815
- }
816
-
817
- /**
818
- * Foo
819
- * Bar.
820
- */
821
- function quux () {
822
-
823
- }
824
-
825
- /**
826
- * Foo.
827
- *
828
- * foo.
829
- */
830
- function quux () {
831
-
832
- }
833
-
834
- /**
835
- * foo.
836
- */
837
- function quux () {
838
-
839
- }
840
- // "jsdoc/match-description": ["error"|"warn", {"mainDescription":false}]
841
-
842
- /**
843
- * foo.
844
- */
845
- class quux {
846
-
847
- }
848
-
849
- /**
850
- * foo.
851
- */
852
- class quux {
853
-
854
- }
855
- // "jsdoc/match-description": ["error"|"warn", {"mainDescription":true}]
856
-
857
- class MyClass {
858
- /**
859
- * Abc.
860
- */
861
- myClassField = 1
862
- }
863
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["PropertyDefinition"]}]
864
-
865
- /**
866
- * Foo.
867
- */
868
- interface quux {
869
-
870
- }
871
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["TSInterfaceDeclaration"]}]
872
-
873
- const myObject = {
874
- /**
875
- * Bad description
876
- */
877
- myProp: true
878
- };
879
- // "jsdoc/match-description": ["error"|"warn", {"contexts":[]}]
880
-
881
- /**
882
- * foo.
883
- */
884
- const q = class {
885
-
886
- }
887
- // "jsdoc/match-description": ["error"|"warn", {"contexts":[]}]
888
-
889
- /**
890
- * foo.
891
- */
892
- const q = {
893
-
894
- };
895
- // "jsdoc/match-description": ["error"|"warn", {"contexts":[]}]
896
-
897
- /**
898
- * @deprecated foo.
899
- */
900
- function quux () {
901
-
902
- }
903
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"param":true}}]
904
-
905
- /**
906
- * Foo.
907
- *
908
- * @summary Foo.
909
- */
910
- function quux () {
911
-
912
- }
913
-
914
- /**
915
- * Foo.
916
- *
917
- * @author Somebody
918
- */
919
- function quux () {
920
-
921
- }
922
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"author":".+"}}]
923
-
924
- /**
925
- * Foo.
926
- *
927
- * @x-tag something
928
- */
929
- function quux () {
930
-
931
- }
932
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"x-tag":".+"}}]
933
-
934
- /**
935
- * Foo.
936
- *
937
- * @prop foo Foo.
938
- */
939
- function quux (foo) {
940
-
941
- }
942
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"prop":true}}]
943
-
944
- /**
945
- * @param foo Foo bar.
946
- */
947
- function quux (foo) {
948
-
949
- }
950
- // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
951
-
952
- /**
953
- *
954
- */
955
- function quux () {
956
-
957
- }
958
- // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
959
-
960
- /**
961
- * Foo.
962
- *
963
- * @template Abc, Def Foo.
964
- */
965
- function quux (foo) {
966
-
967
- }
968
- // "jsdoc/match-description": ["error"|"warn", {"tags":{"template":true}}]
969
-
970
- /**
971
- * Enable or disable plugin.
972
- *
973
- * When enabling with this function, the script will be attached to the `document` if:.
974
- * - the script runs in browser context.
975
- * - the `document` doesn't have the script already attached.
976
- * - the `loadScript` option is set to `true`.
977
- * @param enabled `true` to enable, `false` to disable. Default: `true`.
978
- */
979
- // "jsdoc/match-description": ["error"|"warn", {"contexts":["any"],"mainDescription":"/^[A-Z`-].*\\.$/us","matchDescription":"^([A-Z`-].*(\\.|:)|-\\s.*)$","tags":{"param":true,"returns":true}}]
980
-
981
- /**
982
- * @constructor
983
- * @todo Ok.
984
- */
985
- function quux () {
986
- }
987
- // "jsdoc/match-description": ["error"|"warn", {"mainDescription":false,"tags":{"todo":true}}]
988
-
989
- /** Does something very important. */
990
- function foo(): string;
991
- // "jsdoc/match-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[endLine!=0]"}],"matchDescription":"^\\S[\\s\\S]*\\S$"}]
992
-
993
- /**
994
- * This is my favorite function, foo.
995
- *
996
- * @returns Nothing.
997
- */
998
- function foo(): void;
999
- // "jsdoc/match-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[endLine!=0]:not(:has(JsdocTag))"}],"matchDescription":"^\\S[\\s\\S]*\\S$"}]
1000
-
1001
- /**
1002
- * @copyright
1003
- */
1004
- function quux () {
1005
- }
1006
- // "jsdoc/match-description": ["error"|"warn", {"nonemptyTags":false}]
1007
- ````
1008
-