eslint-plugin-jsdoc 56.0.0 → 56.0.2

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 (79) hide show
  1. package/dist/cjs/getJsdocProcessorPlugin.d.cts +5 -1
  2. package/dist/cjs/iterateJsdoc.d.cts +6 -2
  3. package/dist/getJsdocProcessorPlugin.cts +3 -1
  4. package/dist/iterateJsdoc.cts +9 -4
  5. package/package.json +4 -4
  6. package/src/getJsdocProcessorPlugin.cts +3 -1
  7. package/src/iterateJsdoc.cts +9 -4
  8. package/dist/cjs/WarnSettings.js +0 -30
  9. package/dist/cjs/alignTransform.js +0 -285
  10. package/dist/cjs/defaultTagOrder.js +0 -152
  11. package/dist/cjs/exportParser.js +0 -754
  12. package/dist/cjs/getDefaultTagStructureForMode.js +0 -840
  13. package/dist/cjs/getJsdocProcessorPlugin.cjs +0 -4
  14. package/dist/cjs/getJsdocProcessorPlugin.js +0 -553
  15. package/dist/cjs/index-cjs.js +0 -492
  16. package/dist/cjs/index.cjs.cjs +0 -6
  17. package/dist/cjs/iterateJsdoc.cjs +0 -38
  18. package/dist/cjs/iterateJsdoc.js +0 -1981
  19. package/dist/cjs/jsdocUtils.js +0 -1470
  20. package/dist/cjs/rules/checkAccess.js +0 -35
  21. package/dist/cjs/rules/checkAlignment.js +0 -63
  22. package/dist/cjs/rules/checkExamples.js +0 -486
  23. package/dist/cjs/rules/checkIndentation.js +0 -66
  24. package/dist/cjs/rules/checkLineAlignment.js +0 -297
  25. package/dist/cjs/rules/checkParamNames.js +0 -320
  26. package/dist/cjs/rules/checkPropertyNames.js +0 -105
  27. package/dist/cjs/rules/checkSyntax.js +0 -27
  28. package/dist/cjs/rules/checkTagNames.js +0 -252
  29. package/dist/cjs/rules/checkTemplateNames.js +0 -189
  30. package/dist/cjs/rules/checkTypes.js +0 -421
  31. package/dist/cjs/rules/checkValues.js +0 -163
  32. package/dist/cjs/rules/convertToJsdocComments.js +0 -313
  33. package/dist/cjs/rules/emptyTags.js +0 -79
  34. package/dist/cjs/rules/implementsOnClasses.js +0 -63
  35. package/dist/cjs/rules/importsAsDependencies.js +0 -105
  36. package/dist/cjs/rules/informativeDocs.js +0 -153
  37. package/dist/cjs/rules/linesBeforeBlock.js +0 -106
  38. package/dist/cjs/rules/matchDescription.js +0 -240
  39. package/dist/cjs/rules/matchName.js +0 -122
  40. package/dist/cjs/rules/multilineBlocks.js +0 -339
  41. package/dist/cjs/rules/noBadBlocks.js +0 -88
  42. package/dist/cjs/rules/noBlankBlockDescriptions.js +0 -56
  43. package/dist/cjs/rules/noBlankBlocks.js +0 -41
  44. package/dist/cjs/rules/noDefaults.js +0 -84
  45. package/dist/cjs/rules/noMissingSyntax.js +0 -164
  46. package/dist/cjs/rules/noMultiAsterisks.js +0 -83
  47. package/dist/cjs/rules/noRestrictedSyntax.js +0 -75
  48. package/dist/cjs/rules/noTypes.js +0 -88
  49. package/dist/cjs/rules/noUndefinedTypes.js +0 -451
  50. package/dist/cjs/rules/requireAsteriskPrefix.js +0 -144
  51. package/dist/cjs/rules/requireDescription.js +0 -136
  52. package/dist/cjs/rules/requireDescriptionCompleteSentence.js +0 -258
  53. package/dist/cjs/rules/requireExample.js +0 -103
  54. package/dist/cjs/rules/requireFileOverview.js +0 -117
  55. package/dist/cjs/rules/requireHyphenBeforeParamDescription.js +0 -144
  56. package/dist/cjs/rules/requireJsdoc.js +0 -629
  57. package/dist/cjs/rules/requireParam.js +0 -480
  58. package/dist/cjs/rules/requireParamDescription.js +0 -77
  59. package/dist/cjs/rules/requireParamName.js +0 -52
  60. package/dist/cjs/rules/requireParamType.js +0 -77
  61. package/dist/cjs/rules/requireProperty.js +0 -44
  62. package/dist/cjs/rules/requirePropertyDescription.js +0 -22
  63. package/dist/cjs/rules/requirePropertyName.js +0 -22
  64. package/dist/cjs/rules/requirePropertyType.js +0 -22
  65. package/dist/cjs/rules/requireReturns.js +0 -197
  66. package/dist/cjs/rules/requireReturnsCheck.js +0 -108
  67. package/dist/cjs/rules/requireReturnsDescription.js +0 -58
  68. package/dist/cjs/rules/requireReturnsType.js +0 -52
  69. package/dist/cjs/rules/requireTemplate.js +0 -173
  70. package/dist/cjs/rules/requireThrows.js +0 -101
  71. package/dist/cjs/rules/requireYields.js +0 -172
  72. package/dist/cjs/rules/requireYieldsCheck.js +0 -164
  73. package/dist/cjs/rules/sortTags.js +0 -392
  74. package/dist/cjs/rules/tagLines.js +0 -259
  75. package/dist/cjs/rules/textEscaping.js +0 -125
  76. package/dist/cjs/rules/typeFormatting.js +0 -328
  77. package/dist/cjs/rules/validTypes.js +0 -333
  78. package/dist/cjs/tagNames.js +0 -209
  79. package/dist/cjs/utils/hasReturnValue.js +0 -469
@@ -1,840 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * @typedef {Map<string, Map<string, (string|boolean)>>} TagStructure
5
- */
6
- /**
7
- * @param {import('./jsdocUtils.js').ParserMode} mode
8
- * @returns {TagStructure}
9
- */
10
- const getDefaultTagStructureForMode = (mode) => {
11
- const isJsdoc = mode === 'jsdoc';
12
- const isClosure = mode === 'closure';
13
- const isTypescript = mode === 'typescript';
14
- const isPermissive = mode === 'permissive';
15
- const isJsdocOrPermissive = isJsdoc || isPermissive;
16
- const isJsdocOrTypescript = isJsdoc || isTypescript;
17
- const isTypescriptOrClosure = isTypescript || isClosure;
18
- const isClosureOrPermissive = isClosure || isPermissive;
19
- const isJsdocTypescriptOrPermissive = isJsdocOrTypescript || isPermissive;
20
- // Properties:
21
- // `namepathRole` - 'namepath-referencing'|'namepath-defining'|'namepath-or-url-referencing'|'text'|false
22
- // `typeAllowed` - boolean
23
- // `nameRequired` - boolean
24
- // `typeRequired` - boolean
25
- // `typeOrNameRequired` - boolean
26
- // All of `typeAllowed` have a signature with "type" except for
27
- // `augments`/`extends` ("namepath")
28
- // `param`/`arg`/`argument` (no signature)
29
- // `property`/`prop` (no signature)
30
- // `modifies` (undocumented)
31
- // None of the `namepathRole: 'namepath-defining'` show as having curly
32
- // brackets for their name/namepath
33
- // Among `namepath-defining` and `namepath-referencing`, these do not seem
34
- // to allow curly brackets in their doc signature or examples (`modifies`
35
- // references namepaths within its type brackets and `param` is
36
- // name-defining but not namepath-defining, so not part of these groups)
37
- // Todo: Should support special processing for "name" as distinct from
38
- // "namepath" (e.g., param can't define a namepath)
39
- // Todo: Should support a `tutorialID` type (for `@tutorial` block and
40
- // inline)
41
- /**
42
- * @type {TagStructure}
43
- */
44
- return new Map([
45
- [
46
- 'alias', new Map(/** @type {[string, string|boolean][]} */ ([
47
- // Signature seems to require a "namepath" (and no counter-examples)
48
- [
49
- 'namepathRole', 'namepath-defining',
50
- ],
51
- // "namepath"
52
- [
53
- 'typeOrNameRequired', true,
54
- ],
55
- ])),
56
- ],
57
- [
58
- 'arg', new Map(/** @type {[string, string|boolean][]} */ ([
59
- [
60
- 'namepathRole', 'namepath-defining',
61
- ],
62
- // See `param`
63
- [
64
- 'nameRequired', true,
65
- ],
66
- // Has no formal signature in the docs but shows curly brackets
67
- // in the examples
68
- [
69
- 'typeAllowed', true,
70
- ],
71
- ])),
72
- ],
73
- [
74
- 'argument', new Map(/** @type {[string, string|boolean][]} */ ([
75
- [
76
- 'namepathRole', 'namepath-defining',
77
- ],
78
- // See `param`
79
- [
80
- 'nameRequired', true,
81
- ],
82
- // Has no formal signature in the docs but shows curly brackets
83
- // in the examples
84
- [
85
- 'typeAllowed', true,
86
- ],
87
- ])),
88
- ],
89
- [
90
- 'augments', new Map(/** @type {[string, string|boolean][]} */ ([
91
- // Signature seems to require a "namepath" (and no counter-examples)
92
- [
93
- 'namepathRole', 'namepath-referencing',
94
- ],
95
- // Does not show curly brackets in either the signature or examples
96
- [
97
- 'typeAllowed', true,
98
- ],
99
- // "namepath"
100
- [
101
- 'typeOrNameRequired', true,
102
- ],
103
- ])),
104
- ],
105
- [
106
- 'borrows', new Map(/** @type {[string, string|boolean][]} */ ([
107
- // `borrows` has a different format, however, so needs special parsing;
108
- // seems to require both, and as "namepath"'s
109
- [
110
- 'namepathRole', 'namepath-referencing',
111
- ],
112
- // "namepath"
113
- [
114
- 'typeOrNameRequired', true,
115
- ],
116
- ])),
117
- ],
118
- [
119
- 'callback', new Map(/** @type {[string, string|boolean][]} */ ([
120
- // Seems to require a "namepath" in the signature (with no
121
- // counter-examples); TypeScript does not enforce but seems
122
- // problematic as not attached so presumably not useable without it
123
- [
124
- 'namepathRole', 'namepath-defining',
125
- ],
126
- // "namepath"
127
- [
128
- 'nameRequired', true,
129
- ],
130
- ])),
131
- ],
132
- [
133
- 'class', new Map(/** @type {[string, string|boolean][]} */ ([
134
- // Not in use, but should be this value if using to power `empty-tags`
135
- [
136
- 'nameAllowed', true,
137
- ],
138
- // Allows for "name"'s in signature, but indicated as optional
139
- [
140
- 'namepathRole', 'namepath-defining',
141
- ],
142
- [
143
- 'typeAllowed', true,
144
- ],
145
- ])),
146
- ],
147
- [
148
- 'const', new Map(/** @type {[string, string|boolean][]} */ ([
149
- // Allows for "name"'s in signature, but indicated as optional
150
- [
151
- 'namepathRole', 'namepath-defining',
152
- ],
153
- [
154
- 'typeAllowed', true,
155
- ],
156
- ])),
157
- ],
158
- [
159
- 'constant', new Map(/** @type {[string, string|boolean][]} */ ([
160
- // Allows for "name"'s in signature, but indicated as optional
161
- [
162
- 'namepathRole', 'namepath-defining',
163
- ],
164
- [
165
- 'typeAllowed', true,
166
- ],
167
- ])),
168
- ],
169
- [
170
- 'constructor', new Map(/** @type {[string, string|boolean][]} */ ([
171
- // Allows for "name"'s in signature, but indicated as optional
172
- [
173
- 'namepathRole', 'namepath-defining',
174
- ],
175
- [
176
- 'typeAllowed', true,
177
- ],
178
- ])),
179
- ],
180
- [
181
- 'constructs', new Map(/** @type {[string, string|boolean][]} */ ([
182
- // Allows for "name"'s in signature, but indicated as optional
183
- [
184
- 'namepathRole', 'namepath-defining',
185
- ],
186
- [
187
- 'nameRequired', false,
188
- ],
189
- [
190
- 'typeAllowed', false,
191
- ],
192
- ])),
193
- ],
194
- [
195
- 'define', new Map(/** @type {[string, string|boolean][]} */ ([
196
- [
197
- 'typeRequired', isClosure,
198
- ],
199
- ])),
200
- ],
201
- [
202
- 'emits', new Map(/** @type {[string, string|boolean][]} */ ([
203
- // Signature seems to require a "name" (of an event) and no counter-examples
204
- [
205
- 'namepathRole', 'namepath-referencing',
206
- ],
207
- [
208
- 'nameRequired', true,
209
- ],
210
- [
211
- 'typeAllowed', false,
212
- ],
213
- ])),
214
- ],
215
- [
216
- 'enum', new Map(/** @type {[string, string|boolean][]} */ ([
217
- // Has example showing curly brackets but not in doc signature
218
- [
219
- 'typeAllowed', true,
220
- ],
221
- ])),
222
- ],
223
- [
224
- 'event', new Map(/** @type {[string, string|boolean][]} */ ([
225
- // Appears to require a "name" in its signature, albeit somewhat
226
- // different from other "name"'s (including as described
227
- // at https://jsdoc.app/about-namepaths.html )
228
- [
229
- 'namepathRole', 'namepath-defining',
230
- ],
231
- // The doc signature of `event` seems to require a "name"
232
- [
233
- 'nameRequired', true,
234
- ],
235
- ])),
236
- ],
237
- [
238
- 'exception', new Map(/** @type {[string, string|boolean][]} */ ([
239
- // Shows curly brackets in the signature and in the examples
240
- [
241
- 'typeAllowed', true,
242
- ],
243
- ])),
244
- ],
245
- // Closure
246
- [
247
- 'export', new Map(/** @type {[string, string|boolean][]} */ ([
248
- [
249
- 'typeAllowed', isClosureOrPermissive,
250
- ],
251
- ])),
252
- ],
253
- [
254
- 'exports', new Map(/** @type {[string, string|boolean][]} */ ([
255
- [
256
- 'namepathRole', 'namepath-defining',
257
- ],
258
- [
259
- 'nameRequired', isJsdoc,
260
- ],
261
- [
262
- 'typeAllowed', isClosureOrPermissive,
263
- ],
264
- ])),
265
- ],
266
- [
267
- 'extends', new Map(/** @type {[string, string|boolean][]} */ ([
268
- // Signature seems to require a "namepath" (and no counter-examples)
269
- [
270
- 'namepathRole', 'namepath-referencing',
271
- ],
272
- [
273
- 'nameRequired', isJsdoc,
274
- ],
275
- // Does not show curly brackets in either the signature or examples
276
- [
277
- 'typeAllowed', isTypescriptOrClosure || isPermissive,
278
- ],
279
- // "namepath"
280
- [
281
- 'typeOrNameRequired', isTypescriptOrClosure || isPermissive,
282
- ],
283
- ])),
284
- ],
285
- [
286
- 'external', new Map(/** @type {[string, string|boolean][]} */ ([
287
- // Appears to require a "name" in its signature, albeit somewhat
288
- // different from other "name"'s (including as described
289
- // at https://jsdoc.app/about-namepaths.html )
290
- [
291
- 'namepathRole', 'namepath-defining',
292
- ],
293
- // "name" (and a special syntax for the `external` name)
294
- [
295
- 'nameRequired', true,
296
- ],
297
- [
298
- 'typeAllowed', false,
299
- ],
300
- ])),
301
- ],
302
- [
303
- 'fires', new Map(/** @type {[string, string|boolean][]} */ ([
304
- // Signature seems to require a "name" (of an event) and no
305
- // counter-examples
306
- [
307
- 'namepathRole', 'namepath-referencing',
308
- ],
309
- [
310
- 'nameRequired', true,
311
- ],
312
- [
313
- 'typeAllowed', false,
314
- ],
315
- ])),
316
- ],
317
- [
318
- 'func', new Map(/** @type {[string, string|boolean][]} */ ([
319
- // Allows for "name"'s in signature, but indicated as optional
320
- [
321
- 'namepathRole', 'namepath-defining',
322
- ],
323
- ])),
324
- ],
325
- [
326
- 'function', new Map(/** @type {[string, string|boolean][]} */ ([
327
- // Allows for "name"'s in signature, but indicated as optional
328
- [
329
- 'namepathRole', 'namepath-defining',
330
- ],
331
- [
332
- 'nameRequired', false,
333
- ],
334
- [
335
- 'typeAllowed', false,
336
- ],
337
- ])),
338
- ],
339
- [
340
- 'host', new Map(/** @type {[string, string|boolean][]} */ ([
341
- // Appears to require a "name" in its signature, albeit somewhat
342
- // different from other "name"'s (including as described
343
- // at https://jsdoc.app/about-namepaths.html )
344
- [
345
- 'namepathRole', 'namepath-defining',
346
- ],
347
- // See `external`
348
- [
349
- 'nameRequired', true,
350
- ],
351
- [
352
- 'typeAllowed', false,
353
- ],
354
- ])),
355
- ],
356
- [
357
- 'implements', new Map(/** @type {[string, string|boolean][]} */ ([
358
- // Shows curly brackets in the doc signature and examples
359
- // "typeExpression"
360
- [
361
- 'typeRequired', true,
362
- ],
363
- ])),
364
- ],
365
- [
366
- 'interface', new Map(/** @type {[string, string|boolean][]} */ ([
367
- // Not in use, but should be this value if using to power `empty-tags`
368
- [
369
- 'nameAllowed', isClosure,
370
- ],
371
- // Allows for "name" in signature, but indicates as optional
372
- [
373
- 'namepathRole',
374
- isJsdocTypescriptOrPermissive ? 'namepath-defining' : false,
375
- ],
376
- [
377
- 'typeAllowed', false,
378
- ],
379
- ])),
380
- ],
381
- [
382
- 'internal', new Map(/** @type {[string, string|boolean][]} */ ([
383
- // Not in use, but should be this value if using to power `empty-tags`
384
- [
385
- 'nameAllowed', false,
386
- ],
387
- // https://www.typescriptlang.org/tsconfig/#stripInternal
388
- [
389
- 'namepathRole', false,
390
- ],
391
- ])),
392
- ],
393
- [
394
- 'lends', new Map(/** @type {[string, string|boolean][]} */ ([
395
- // Signature seems to require a "namepath" (and no counter-examples)
396
- [
397
- 'namepathRole', 'namepath-referencing',
398
- ],
399
- // "namepath"
400
- [
401
- 'typeOrNameRequired', true,
402
- ],
403
- ])),
404
- ],
405
- [
406
- 'link', new Map(/** @type {[string, string|boolean][]} */ ([
407
- // Signature seems to require a namepath OR URL and might be checked as such.
408
- [
409
- 'namepathRole', 'namepath-or-url-referencing',
410
- ],
411
- ])),
412
- ],
413
- [
414
- 'linkcode', new Map(/** @type {[string, string|boolean][]} */ ([
415
- // Synonym for "link"
416
- // Signature seems to require a namepath OR URL and might be checked as such.
417
- [
418
- 'namepathRole', 'namepath-or-url-referencing',
419
- ],
420
- ])),
421
- ],
422
- [
423
- 'linkplain', new Map(/** @type {[string, string|boolean][]} */ ([
424
- // Synonym for "link"
425
- // Signature seems to require a namepath OR URL and might be checked as such.
426
- [
427
- 'namepathRole', 'namepath-or-url-referencing',
428
- ],
429
- ])),
430
- ],
431
- [
432
- 'listens', new Map(/** @type {[string, string|boolean][]} */ ([
433
- // Signature seems to require a "name" (of an event) and no
434
- // counter-examples
435
- [
436
- 'namepathRole', 'namepath-referencing',
437
- ],
438
- [
439
- 'nameRequired', true,
440
- ],
441
- [
442
- 'typeAllowed', false,
443
- ],
444
- ])),
445
- ],
446
- [
447
- 'member', new Map(/** @type {[string, string|boolean][]} */ ([
448
- // Allows for "name"'s in signature, but indicated as optional
449
- [
450
- 'namepathRole', 'namepath-defining',
451
- ],
452
- // Has example showing curly brackets but not in doc signature
453
- [
454
- 'typeAllowed', true,
455
- ],
456
- ])),
457
- ],
458
- [
459
- 'memberof!', new Map(/** @type {[string, string|boolean][]} */ ([
460
- // Signature seems to require a "namepath" (and no counter-examples),
461
- // though it allows an incomplete namepath ending with connecting symbol
462
- [
463
- 'namepathRole', 'namepath-referencing',
464
- ],
465
- // "namepath"
466
- [
467
- 'typeOrNameRequired', true,
468
- ],
469
- ])),
470
- ],
471
- [
472
- 'memberof', new Map(/** @type {[string, string|boolean][]} */ ([
473
- // Signature seems to require a "namepath" (and no counter-examples),
474
- // though it allows an incomplete namepath ending with connecting symbol
475
- [
476
- 'namepathRole', 'namepath-referencing',
477
- ],
478
- // "namepath"
479
- [
480
- 'typeOrNameRequired', true,
481
- ],
482
- ])),
483
- ],
484
- [
485
- 'method', new Map(/** @type {[string, string|boolean][]} */ ([
486
- // Allows for "name"'s in signature, but indicated as optional
487
- [
488
- 'namepathRole', 'namepath-defining',
489
- ],
490
- ])),
491
- ],
492
- [
493
- 'mixes', new Map(/** @type {[string, string|boolean][]} */ ([
494
- // Signature seems to require a "OtherObjectPath" with no
495
- // counter-examples
496
- [
497
- 'namepathRole', 'namepath-referencing',
498
- ],
499
- // "OtherObjectPath"
500
- [
501
- 'typeOrNameRequired', true,
502
- ],
503
- ])),
504
- ],
505
- [
506
- 'mixin', new Map(/** @type {[string, string|boolean][]} */ ([
507
- // Allows for "name"'s in signature, but indicated as optional
508
- [
509
- 'namepathRole', 'namepath-defining',
510
- ],
511
- [
512
- 'nameRequired', false,
513
- ],
514
- [
515
- 'typeAllowed', false,
516
- ],
517
- ])),
518
- ],
519
- [
520
- 'modifies', new Map(/** @type {[string, string|boolean][]} */ ([
521
- // Has no documentation, but test example has curly brackets, and
522
- // "name" would be suggested rather than "namepath" based on example;
523
- // not sure if name is required
524
- [
525
- 'typeAllowed', true,
526
- ],
527
- ])),
528
- ],
529
- [
530
- 'module', new Map(/** @type {[string, string|boolean][]} */ ([
531
- // Optional "name" and no curly brackets
532
- // this block impacts `no-undefined-types` and `valid-types` (search for
533
- // "isNamepathDefiningTag|tagMightHaveNamepath|tagMightHaveEitherTypeOrNamePosition")
534
- [
535
- 'namepathRole', isJsdoc ? 'namepath-defining' : 'text',
536
- ],
537
- // Shows the signature with curly brackets but not in the example
538
- [
539
- 'typeAllowed', true,
540
- ],
541
- ])),
542
- ],
543
- [
544
- 'name', new Map(/** @type {[string, string|boolean][]} */ ([
545
- // Seems to require a "namepath" in the signature (with no
546
- // counter-examples)
547
- [
548
- 'namepathRole', 'namepath-defining',
549
- ],
550
- // "namepath"
551
- [
552
- 'nameRequired', true,
553
- ],
554
- // "namepath"
555
- [
556
- 'typeOrNameRequired', true,
557
- ],
558
- ])),
559
- ],
560
- [
561
- 'namespace', new Map(/** @type {[string, string|boolean][]} */ ([
562
- // Allows for "name"'s in signature, but indicated as optional
563
- [
564
- 'namepathRole', 'namepath-defining',
565
- ],
566
- // Shows the signature with curly brackets but not in the example
567
- [
568
- 'typeAllowed', true,
569
- ],
570
- ])),
571
- ],
572
- [
573
- 'package', new Map(/** @type {[string, string|boolean][]} */ ([
574
- // Shows the signature with curly brackets but not in the example
575
- // "typeExpression"
576
- [
577
- 'typeAllowed', isClosureOrPermissive,
578
- ],
579
- ])),
580
- ],
581
- [
582
- 'param', new Map(/** @type {[string, string|boolean][]} */ ([
583
- [
584
- 'namepathRole', 'namepath-defining',
585
- ],
586
- // Though no signature provided requiring, per
587
- // https://jsdoc.app/tags-param.html:
588
- // "The @param tag requires you to specify the name of the parameter you
589
- // are documenting."
590
- [
591
- 'nameRequired', true,
592
- ],
593
- // Has no formal signature in the docs but shows curly brackets
594
- // in the examples
595
- [
596
- 'typeAllowed', true,
597
- ],
598
- ])),
599
- ],
600
- [
601
- 'private', new Map(/** @type {[string, string|boolean][]} */ ([
602
- // Shows the signature with curly brackets but not in the example
603
- // "typeExpression"
604
- [
605
- 'typeAllowed', isClosureOrPermissive,
606
- ],
607
- ])),
608
- ],
609
- [
610
- 'prop', new Map(/** @type {[string, string|boolean][]} */ ([
611
- [
612
- 'namepathRole', 'namepath-defining',
613
- ],
614
- // See `property`
615
- [
616
- 'nameRequired', true,
617
- ],
618
- // Has no formal signature in the docs but shows curly brackets
619
- // in the examples
620
- [
621
- 'typeAllowed', true,
622
- ],
623
- ])),
624
- ],
625
- [
626
- 'property', new Map(/** @type {[string, string|boolean][]} */ ([
627
- [
628
- 'namepathRole', 'namepath-defining',
629
- ],
630
- // No docs indicate required, but since parallel to `param`, we treat as
631
- // such:
632
- [
633
- 'nameRequired', true,
634
- ],
635
- // Has no formal signature in the docs but shows curly brackets
636
- // in the examples
637
- [
638
- 'typeAllowed', true,
639
- ],
640
- ])),
641
- ],
642
- [
643
- 'protected', new Map(/** @type {[string, string|boolean][]} */ ([
644
- // Shows the signature with curly brackets but not in the example
645
- // "typeExpression"
646
- [
647
- 'typeAllowed', isClosureOrPermissive,
648
- ],
649
- ])),
650
- ],
651
- [
652
- 'public', new Map(/** @type {[string, string|boolean][]} */ ([
653
- // Does not show a signature nor show curly brackets in the example
654
- [
655
- 'typeAllowed', isClosureOrPermissive,
656
- ],
657
- ])),
658
- ],
659
- [
660
- 'requires', new Map(/** @type {[string, string|boolean][]} */ ([
661
- // <someModuleName>
662
- [
663
- 'namepathRole', 'namepath-referencing',
664
- ],
665
- [
666
- 'nameRequired', true,
667
- ],
668
- [
669
- 'typeAllowed', false,
670
- ],
671
- ])),
672
- ],
673
- [
674
- 'return', new Map(/** @type {[string, string|boolean][]} */ ([
675
- // Shows curly brackets in the signature and in the examples
676
- [
677
- 'typeAllowed', true,
678
- ],
679
- ])),
680
- ],
681
- [
682
- 'returns', new Map(/** @type {[string, string|boolean][]} */ ([
683
- // Shows curly brackets in the signature and in the examples
684
- [
685
- 'typeAllowed', true,
686
- ],
687
- ])),
688
- ],
689
- [
690
- 'satisfies', new Map(/** @type {[string, string|boolean][]} */ ([
691
- // Shows curly brackets in the doc signature and examples
692
- [
693
- 'typeRequired', true,
694
- ],
695
- ])),
696
- ],
697
- [
698
- 'see', new Map(/** @type {[string, string|boolean][]} */ ([
699
- // Signature allows for "namepath" or text, so user must configure to
700
- // 'namepath-referencing' to enforce checks
701
- [
702
- 'namepathRole', 'text',
703
- ],
704
- ])),
705
- ],
706
- [
707
- 'static', new Map(/** @type {[string, string|boolean][]} */ ([
708
- // Does not show a signature nor show curly brackets in the example
709
- [
710
- 'typeAllowed', isClosureOrPermissive,
711
- ],
712
- ])),
713
- ],
714
- [
715
- 'suppress', new Map(/** @type {[string, string|boolean][]} */ ([
716
- [
717
- 'namepathRole', !isClosure,
718
- ],
719
- [
720
- 'typeRequired', isClosure,
721
- ],
722
- ])),
723
- ],
724
- [
725
- 'template', new Map(/** @type {[string, string|boolean][]} */ ([
726
- [
727
- 'namepathRole', isJsdoc ? 'text' : 'namepath-referencing',
728
- ],
729
- [
730
- 'nameRequired', !isJsdoc,
731
- ],
732
- // Though defines `namepathRole: 'namepath-defining'` in a sense, it is
733
- // not parseable in the same way for template (e.g., allowing commas),
734
- // so not adding
735
- [
736
- 'typeAllowed', isTypescriptOrClosure || isPermissive,
737
- ],
738
- ])),
739
- ],
740
- [
741
- 'this', new Map(/** @type {[string, string|boolean][]} */ ([
742
- // Signature seems to require a "namepath" (and no counter-examples)
743
- // Not used with namepath in Closure/TypeScript, however
744
- [
745
- 'namepathRole', isJsdoc ? 'namepath-referencing' : false,
746
- ],
747
- // namepath
748
- [
749
- 'typeOrNameRequired', isJsdoc,
750
- ],
751
- [
752
- 'typeRequired', isTypescriptOrClosure,
753
- ],
754
- ])),
755
- ],
756
- [
757
- 'throws', new Map(/** @type {[string, string|boolean][]} */ ([
758
- // Shows curly brackets in the signature and in the examples
759
- [
760
- 'typeAllowed', true,
761
- ],
762
- ])),
763
- ],
764
- [
765
- 'tutorial', new Map(/** @type {[string, string|boolean][]} */ ([
766
- // (a tutorial ID)
767
- [
768
- 'nameRequired', true,
769
- ],
770
- [
771
- 'typeAllowed', false,
772
- ],
773
- ])),
774
- ],
775
- [
776
- 'type', new Map(/** @type {[string, string|boolean][]} */ ([
777
- // Shows curly brackets in the doc signature and examples
778
- // "typeName"
779
- [
780
- 'typeRequired', true,
781
- ],
782
- ])),
783
- ],
784
- [
785
- 'typedef', new Map(/** @type {[string, string|boolean][]} */ ([
786
- // Seems to require a "namepath" in the signature (with no
787
- // counter-examples)
788
- [
789
- 'namepathRole', 'namepath-defining',
790
- ],
791
- // TypeScript may allow it to be dropped if followed by @property or @member;
792
- // also shown as missing in Closure
793
- // "namepath"
794
- [
795
- 'nameRequired', isJsdocOrPermissive,
796
- ],
797
- // Is not `typeRequired` for TypeScript because it gives an error:
798
- // JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags.
799
- // Has example showing curly brackets but not in doc signature
800
- [
801
- 'typeAllowed', true,
802
- ],
803
- // TypeScript may allow it to be dropped if followed by @property or @member
804
- // "namepath"
805
- [
806
- 'typeOrNameRequired', !isTypescript,
807
- ],
808
- ])),
809
- ],
810
- [
811
- 'var', new Map(/** @type {[string, string|boolean][]} */ ([
812
- // Allows for "name"'s in signature, but indicated as optional
813
- [
814
- 'namepathRole', 'namepath-defining',
815
- ],
816
- // Has example showing curly brackets but not in doc signature
817
- [
818
- 'typeAllowed', true,
819
- ],
820
- ])),
821
- ],
822
- [
823
- 'yield', new Map(/** @type {[string, string|boolean][]} */ ([
824
- // Shows curly brackets in the signature and in the examples
825
- [
826
- 'typeAllowed', true,
827
- ],
828
- ])),
829
- ],
830
- [
831
- 'yields', new Map(/** @type {[string, string|boolean][]} */ ([
832
- // Shows curly brackets in the signature and in the examples
833
- [
834
- 'typeAllowed', true,
835
- ],
836
- ])),
837
- ],
838
- ]);
839
- };
840
- exports.default = getDefaultTagStructureForMode;