eslint-plugin-jsdoc 46.4.5 → 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 (66) hide show
  1. package/README.md +31 -0
  2. package/dist/alignTransform.js +5 -5
  3. package/dist/alignTransform.js.map +1 -1
  4. package/dist/index.js +21 -10
  5. package/dist/index.js.map +1 -1
  6. package/dist/iterateJsdoc.js +1 -1
  7. package/dist/iterateJsdoc.js.map +1 -1
  8. package/dist/rules/checkExamples.js +12 -6
  9. package/dist/rules/checkExamples.js.map +1 -1
  10. package/package.json +19 -15
  11. package/docs/advanced.md +0 -102
  12. package/docs/rules/check-access.md +0 -193
  13. package/docs/rules/check-alignment.md +0 -169
  14. package/docs/rules/check-examples.md +0 -784
  15. package/docs/rules/check-indentation.md +0 -296
  16. package/docs/rules/check-line-alignment.md +0 -1002
  17. package/docs/rules/check-param-names.md +0 -1035
  18. package/docs/rules/check-property-names.md +0 -244
  19. package/docs/rules/check-syntax.md +0 -80
  20. package/docs/rules/check-tag-names.md +0 -1132
  21. package/docs/rules/check-types.md +0 -1198
  22. package/docs/rules/check-values.md +0 -409
  23. package/docs/rules/empty-tags.md +0 -220
  24. package/docs/rules/implements-on-classes.md +0 -219
  25. package/docs/rules/imports-as-dependencies.md +0 -99
  26. package/docs/rules/informative-docs.md +0 -400
  27. package/docs/rules/match-description.md +0 -1008
  28. package/docs/rules/match-name.md +0 -249
  29. package/docs/rules/multiline-blocks.md +0 -398
  30. package/docs/rules/no-bad-blocks.md +0 -174
  31. package/docs/rules/no-blank-block-descriptions.md +0 -91
  32. package/docs/rules/no-blank-blocks.md +0 -98
  33. package/docs/rules/no-defaults.md +0 -207
  34. package/docs/rules/no-missing-syntax.md +0 -275
  35. package/docs/rules/no-multi-asterisks.md +0 -278
  36. package/docs/rules/no-restricted-syntax.md +0 -383
  37. package/docs/rules/no-types.md +0 -168
  38. package/docs/rules/no-undefined-types.md +0 -789
  39. package/docs/rules/require-asterisk-prefix.md +0 -297
  40. package/docs/rules/require-description-complete-sentence.md +0 -820
  41. package/docs/rules/require-description.md +0 -585
  42. package/docs/rules/require-example.md +0 -390
  43. package/docs/rules/require-file-overview.md +0 -324
  44. package/docs/rules/require-hyphen-before-param-description.md +0 -281
  45. package/docs/rules/require-jsdoc.md +0 -1857
  46. package/docs/rules/require-param-description.md +0 -238
  47. package/docs/rules/require-param-name.md +0 -163
  48. package/docs/rules/require-param-type.md +0 -227
  49. package/docs/rules/require-param.md +0 -1820
  50. package/docs/rules/require-property-description.md +0 -88
  51. package/docs/rules/require-property-name.md +0 -79
  52. package/docs/rules/require-property-type.md +0 -79
  53. package/docs/rules/require-property.md +0 -128
  54. package/docs/rules/require-returns-check.md +0 -1053
  55. package/docs/rules/require-returns-description.md +0 -181
  56. package/docs/rules/require-returns-type.md +0 -144
  57. package/docs/rules/require-returns.md +0 -1191
  58. package/docs/rules/require-throws.md +0 -326
  59. package/docs/rules/require-yields-check.md +0 -544
  60. package/docs/rules/require-yields.md +0 -823
  61. package/docs/rules/sort-tags.md +0 -635
  62. package/docs/rules/tag-lines.md +0 -551
  63. package/docs/rules/text-escaping.md +0 -177
  64. package/docs/rules/valid-types.md +0 -881
  65. package/docs/settings.md +0 -362
  66. package/tsconfig.json +0 -22
@@ -1,585 +0,0 @@
1
- <a name="user-content-require-description"></a>
2
- <a name="require-description"></a>
3
- # <code>require-description</code>
4
-
5
- * [Options](#user-content-require-description-options)
6
- * [Context and settings](#user-content-require-description-context-and-settings)
7
- * [Failing examples](#user-content-require-description-failing-examples)
8
- * [Passing examples](#user-content-require-description-passing-examples)
9
-
10
-
11
- Requires that all functions (or optionally other structures) with a JSDoc block
12
- have a description.
13
-
14
- * All functions must have an implicit description (e.g., text above tags) or
15
- have the option `descriptionStyle` set to `tag` (requiring `@description`
16
- (or `@desc` if that is set as your preferred tag name)).
17
- * Every jsdoc block description (or `@description` tag if `descriptionStyle`
18
- is `"tag"`) must have a non-empty description that explains the purpose of
19
- the method.
20
-
21
- <a name="user-content-require-description-options"></a>
22
- <a name="require-description-options"></a>
23
- ## Options
24
-
25
- An options object may have any of the following properties:
26
-
27
- - `contexts` - Set to an array of strings representing the AST context
28
- where you wish the rule to be applied (e.g., `ClassDeclaration` for ES6
29
- classes). Overrides the default contexts (see below). Set to `"any"` if
30
- you want the rule to apply to any jsdoc block throughout your files.
31
- - `exemptedBy` - Array of tags (e.g., `['type']`) whose presence on the
32
- document block avoids the need for a `@description`. Defaults to an
33
- array with `inheritdoc`. If you set this array, it will overwrite the
34
- default, so be sure to add back `inheritdoc` if you wish its presence
35
- to cause exemption of the rule.
36
- - `descriptionStyle` - Whether to accept implicit descriptions (`"body"`) or
37
- `@description` tags (`"tag"`) as satisfying the rule. Set to `"any"` to
38
- accept either style. Defaults to `"body"`.
39
- - `checkConstructors` - A value indicating whether `constructor`s should be
40
- checked. Defaults to `true`.
41
- - `checkGetters` - A value indicating whether getters should be checked.
42
- Defaults to `true`.
43
- - `checkSetters` - A value indicating whether setters should be checked.
44
- Defaults to `true`.
45
-
46
- <a name="user-content-require-description-context-and-settings"></a>
47
- <a name="require-description-context-and-settings"></a>
48
- ## Context and settings
49
-
50
- | | |
51
- | -------- | ---------------------- |
52
- | Context | `ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`; others when `contexts` option enabled |
53
- | Tags | `description` or jsdoc block |
54
- | Aliases | `desc` |
55
- | Recommended | false |
56
- | Options |`checkConstructors`, `checkGetters`, `checkSetters`, `contexts`, `descriptionStyle`, `exemptedBy`|
57
- | Settings | `ignoreReplacesDocs`, `overrideReplacesDocs`, `augmentsExtendsReplacesDocs`, `implementsReplacesDocs` |
58
-
59
- <a name="user-content-require-description-failing-examples"></a>
60
- <a name="require-description-failing-examples"></a>
61
- ## Failing examples
62
-
63
- The following patterns are considered problems:
64
-
65
- ````js
66
- /**
67
- *
68
- */
69
- function quux () {
70
-
71
- }
72
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
73
- // Message: Missing JSDoc @description declaration.
74
-
75
- /**
76
- *
77
- */
78
- function quux () {
79
-
80
- }
81
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"any"}]
82
- // Message: Missing JSDoc block description or @description declaration.
83
-
84
- /**
85
- *
86
- */
87
- function quux () {
88
-
89
- }
90
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"body"}]
91
- // Message: Missing JSDoc block description.
92
-
93
- /**
94
- * @desc Not a blank description
95
- */
96
- function quux () {
97
-
98
- }
99
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"body"}]
100
- // Message: Remove the @desc tag to leave a plain block description or add additional description text above the @desc line.
101
-
102
- /**
103
- * @description Not a blank description
104
- */
105
- function quux () {
106
-
107
- }
108
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"body"}]
109
- // Message: Remove the @description tag to leave a plain block description or add additional description text above the @description line.
110
-
111
- /**
112
- *
113
- */
114
- class quux {
115
-
116
- }
117
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassDeclaration"],"descriptionStyle":"tag"}]
118
- // Message: Missing JSDoc @description declaration.
119
-
120
- /**
121
- *
122
- */
123
- class quux {
124
-
125
- }
126
- // Settings: {"jsdoc":{"contexts":["ClassDeclaration"]}}
127
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
128
- // Message: Missing JSDoc @description declaration.
129
-
130
- /**
131
- *
132
- */
133
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["any"],"descriptionStyle":"tag"}]
134
- // Message: Missing JSDoc @description declaration.
135
-
136
- /**
137
- *
138
- */
139
- class quux {
140
-
141
- }
142
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassDeclaration"],"descriptionStyle":"tag"}]
143
- // Message: Missing JSDoc @description declaration.
144
-
145
- /**
146
- *
147
- */
148
- class quux {
149
-
150
- }
151
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassDeclaration"],"descriptionStyle":"tag"}]
152
- // Message: Missing JSDoc @description declaration.
153
-
154
- /**
155
- * @description
156
- */
157
- function quux () {
158
-
159
- }
160
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
161
- // Message: Missing JSDoc @description description.
162
-
163
- /**
164
- *
165
- */
166
- interface quux {
167
-
168
- }
169
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["TSInterfaceDeclaration"],"descriptionStyle":"tag"}]
170
- // Message: Missing JSDoc @description declaration.
171
-
172
- /**
173
- *
174
- */
175
- var quux = class {
176
-
177
- };
178
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassExpression"],"descriptionStyle":"tag"}]
179
- // Message: Missing JSDoc @description declaration.
180
-
181
- /**
182
- *
183
- */
184
- var quux = {
185
-
186
- };
187
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ObjectExpression"],"descriptionStyle":"tag"}]
188
- // Message: Missing JSDoc @description declaration.
189
-
190
- /**
191
- * @someDesc
192
- */
193
- function quux () {
194
-
195
- }
196
- // Settings: {"jsdoc":{"tagNamePreference":{"description":{"message":"Please avoid `{{tagName}}`; use `{{replacement}}` instead","replacement":"someDesc"}}}}
197
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
198
- // Message: Missing JSDoc @someDesc description.
199
-
200
- /**
201
- * @description
202
- */
203
- function quux () {
204
-
205
- }
206
- // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
207
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
208
- // Message: Unexpected tag `@description`
209
-
210
- /**
211
- * @description
212
- */
213
- function quux () {
214
-
215
- }
216
- // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
217
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"any"}]
218
- // Message: Missing JSDoc block description or @description declaration.
219
-
220
- /**
221
- *
222
- */
223
- function quux () {
224
- }
225
- // "jsdoc/require-description": ["error"|"warn", {"exemptedBy":["notPresent"]}]
226
- // Message: Missing JSDoc block description.
227
-
228
- class TestClass {
229
- /**
230
- *
231
- */
232
- constructor() { }
233
- }
234
- // Message: Missing JSDoc block description.
235
-
236
- class TestClass {
237
- /**
238
- *
239
- */
240
- constructor() { }
241
- }
242
- // "jsdoc/require-description": ["error"|"warn", {"checkConstructors":true}]
243
- // Message: Missing JSDoc block description.
244
-
245
- class TestClass {
246
- /**
247
- *
248
- */
249
- get Test() { }
250
- }
251
- // Message: Missing JSDoc block description.
252
-
253
- class TestClass {
254
- /**
255
- *
256
- */
257
- get Test() { }
258
- }
259
- // "jsdoc/require-description": ["error"|"warn", {"checkGetters":true}]
260
- // Message: Missing JSDoc block description.
261
-
262
- class TestClass {
263
- /**
264
- *
265
- */
266
- set Test(value) { }
267
- }
268
- // Message: Missing JSDoc block description.
269
-
270
- class TestClass {
271
- /**
272
- *
273
- */
274
- set Test(value) { }
275
- }
276
- // "jsdoc/require-description": ["error"|"warn", {"checkSetters":true}]
277
- // Message: Missing JSDoc block description.
278
-
279
- /**
280
- *
281
- */
282
- class Foo {
283
- /**
284
- *
285
- */
286
- constructor() {}
287
-
288
- /**
289
- *
290
- */
291
- bar() {}
292
- }
293
- // "jsdoc/require-description": ["error"|"warn", {"checkConstructors":false,"contexts":["MethodDefinition"]}]
294
- // Message: Missing JSDoc block description.
295
-
296
- /**
297
- * @implements {Bar}
298
- */
299
- class quux {
300
-
301
- }
302
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
303
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"Bar\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
304
- // Message: Missing JSDoc @description declaration.
305
-
306
- /**
307
- * Has some
308
- * description already.
309
- * @implements {Bar}
310
- */
311
- class quux {
312
-
313
- }
314
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
315
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"Bar\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
316
- // Message: Missing JSDoc @description declaration.
317
-
318
- /**
319
- * @implements {Bar
320
- * | Foo}
321
- */
322
- class quux {
323
-
324
- }
325
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
326
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTypeUnion > JsdocTypeName[value=\"Bar\"]:nth-child(1))","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
327
- // Message: Missing JSDoc @description declaration.
328
-
329
- /**
330
- * @implements {Bar}
331
- */
332
- class quux {
333
-
334
- }
335
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
336
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[tag=\"implements\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
337
- // Message: Missing JSDoc @description declaration.
338
-
339
- /**
340
- * @implements {Bar}
341
- */
342
- class quux {
343
-
344
- }
345
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
346
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[tag=\"implements\"])","context":"any"}],"descriptionStyle":"tag"}]
347
- // Message: Missing JSDoc @description declaration.
348
- ````
349
-
350
-
351
-
352
- <a name="user-content-require-description-passing-examples"></a>
353
- <a name="require-description-passing-examples"></a>
354
- ## Passing examples
355
-
356
- The following patterns are not considered problems:
357
-
358
- ````js
359
- /**
360
- *
361
- */
362
-
363
- /**
364
- * @description
365
- * // arbitrary description content
366
- */
367
- function quux () {
368
-
369
- }
370
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
371
-
372
- /**
373
- * @description
374
- * quux(); // does something useful
375
- */
376
- function quux () {
377
-
378
- }
379
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
380
-
381
- /**
382
- * @description <caption>Valid usage</caption>
383
- * quux(); // does something useful
384
- *
385
- * @description <caption>Invalid usage</caption>
386
- * quux('random unwanted arg'); // results in an error
387
- */
388
- function quux () {
389
-
390
- }
391
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
392
-
393
- /**
394
- *
395
- */
396
- class quux {
397
-
398
- }
399
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
400
-
401
- /**
402
- *
403
- */
404
- function quux () {
405
-
406
- }
407
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["ClassDeclaration"]}]
408
-
409
- /**
410
- * @type {MyCallback}
411
- */
412
- function quux () {
413
-
414
- }
415
- // "jsdoc/require-description": ["error"|"warn", {"exemptedBy":["type"]}]
416
-
417
- /**
418
- *
419
- */
420
- interface quux {
421
-
422
- }
423
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
424
-
425
- interface quux {
426
- /**
427
- * If the thing should be checked.
428
- */
429
- checked?: boolean
430
- }
431
- // "jsdoc/require-description": ["error"|"warn", {"contexts":["TSPropertySignature"]}]
432
-
433
- /**
434
- *
435
- */
436
- var quux = class {
437
-
438
- };
439
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
440
-
441
- /**
442
- *
443
- */
444
- var quux = {
445
-
446
- };
447
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
448
-
449
- /**
450
- * Has an implicit description
451
- */
452
- function quux () {
453
-
454
- }
455
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"body"}]
456
-
457
- /**
458
- * Has an implicit description
459
- */
460
- function quux () {
461
-
462
- }
463
-
464
- /**
465
- * Has an implicit description
466
- */
467
- function quux () {
468
-
469
- }
470
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"any"}]
471
-
472
- /**
473
- * @description Has an explicit description
474
- */
475
- function quux () {
476
-
477
- }
478
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"any"}]
479
-
480
- /**
481
- *
482
- */
483
- function quux () {
484
-
485
- }
486
- // Settings: {"jsdoc":{"tagNamePreference":{"description":false}}}
487
-
488
- class TestClass {
489
- /**
490
- * Test.
491
- */
492
- constructor() { }
493
- }
494
-
495
- class TestClass {
496
- /**
497
- *
498
- */
499
- constructor() { }
500
- }
501
- // "jsdoc/require-description": ["error"|"warn", {"checkConstructors":false}]
502
-
503
- class TestClass {
504
- /**
505
- * Test.
506
- */
507
- get Test() { }
508
- }
509
-
510
- class TestClass {
511
- /**
512
- *
513
- */
514
- get Test() { }
515
- }
516
- // "jsdoc/require-description": ["error"|"warn", {"checkGetters":false}]
517
-
518
- class TestClass {
519
- /**
520
- * Test.
521
- */
522
- set Test(value) { }
523
- }
524
-
525
- class TestClass {
526
- /**
527
- *
528
- */
529
- set Test(value) { }
530
- }
531
- // "jsdoc/require-description": ["error"|"warn", {"checkSetters":false}]
532
-
533
- /**
534
- * Multi
535
- * line
536
- */
537
- function quux () {
538
-
539
- }
540
-
541
- /** Single line */
542
- function quux () {
543
-
544
- }
545
-
546
- /** @description something */
547
- function quux () {
548
-
549
- }
550
- // "jsdoc/require-description": ["error"|"warn", {"descriptionStyle":"tag"}]
551
-
552
- /**
553
- * @implements {Bar}
554
- */
555
- class quux {
556
-
557
- }
558
- // Settings: {"jsdoc":{"implementsReplacesDocs":false}}
559
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=/\\s{4}/]:has(JsdocTag[rawType=\"class\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
560
-
561
- /**
562
- * Has some
563
- * description already.
564
- */
565
- class quux {
566
-
567
- }
568
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"{Bar}\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}]
569
-
570
- /**
571
- * Has some
572
- * description already.
573
- */
574
- class quux {
575
-
576
- }
577
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"{Bar}\"])","context":"any"}],"descriptionStyle":"tag"}]
578
-
579
- /**
580
- * Has some
581
- * description already.
582
- */
583
- // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"{Bar}\"])","context":"any"}],"descriptionStyle":"tag"}]
584
- ````
585
-