eslint-plugin-jsdoc 58.1.0 → 59.0.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 (184) hide show
  1. package/README.md +66 -60
  2. package/dist/buildForbidRuleDefinition.cjs +0 -1
  3. package/dist/buildForbidRuleDefinition.cjs.map +1 -1
  4. package/dist/buildRejectOrPreferRuleDefinition.cjs +7 -2
  5. package/dist/buildRejectOrPreferRuleDefinition.cjs.map +1 -1
  6. package/dist/cjs/rules/convertToJsdocComments.d.ts +7 -0
  7. package/dist/generateDocs.cjs +129 -3
  8. package/dist/generateDocs.cjs.map +1 -1
  9. package/dist/generateRule.cjs +3 -1
  10. package/dist/generateRule.cjs.map +1 -1
  11. package/dist/generateRuleTypes.cjs +5 -5
  12. package/dist/generateRuleTypes.cjs.map +1 -1
  13. package/dist/index-cjs.cjs +30 -0
  14. package/dist/index-cjs.cjs.map +1 -1
  15. package/dist/index.cjs +30 -0
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/rules/checkAccess.cjs +1 -1
  18. package/dist/rules/checkAccess.cjs.map +1 -1
  19. package/dist/rules/checkAlignment.cjs +4 -1
  20. package/dist/rules/checkAlignment.cjs.map +1 -1
  21. package/dist/rules/checkExamples.cjs +1 -1
  22. package/dist/rules/checkExamples.cjs.map +1 -1
  23. package/dist/rules/checkIndentation.cjs +19 -0
  24. package/dist/rules/checkIndentation.cjs.map +1 -1
  25. package/dist/rules/checkLineAlignment.cjs +25 -1
  26. package/dist/rules/checkLineAlignment.cjs.map +1 -1
  27. package/dist/rules/checkParamNames.cjs +62 -1
  28. package/dist/rules/checkParamNames.cjs.map +1 -1
  29. package/dist/rules/checkPropertyNames.cjs +6 -0
  30. package/dist/rules/checkPropertyNames.cjs.map +1 -1
  31. package/dist/rules/checkTagNames.cjs +71 -0
  32. package/dist/rules/checkTagNames.cjs.map +1 -1
  33. package/dist/rules/checkTypes.cjs +16 -1
  34. package/dist/rules/checkTypes.cjs.map +1 -1
  35. package/dist/rules/checkValues.cjs +17 -1
  36. package/dist/rules/checkValues.cjs.map +1 -1
  37. package/dist/rules/convertToJsdocComments.cjs +48 -0
  38. package/dist/rules/convertToJsdocComments.cjs.map +1 -1
  39. package/dist/rules/convertToJsdocComments.d.ts +7 -0
  40. package/dist/rules/emptyTags.cjs +10 -1
  41. package/dist/rules/emptyTags.cjs.map +1 -1
  42. package/dist/rules/implementsOnClasses.cjs +15 -1
  43. package/dist/rules/implementsOnClasses.cjs.map +1 -1
  44. package/dist/rules/informativeDocs.cjs +45 -0
  45. package/dist/rules/informativeDocs.cjs.map +1 -1
  46. package/dist/rules/linesBeforeBlock.cjs +14 -0
  47. package/dist/rules/linesBeforeBlock.cjs.map +1 -1
  48. package/dist/rules/matchDescription.cjs +129 -0
  49. package/dist/rules/matchDescription.cjs.map +1 -1
  50. package/dist/rules/matchName.cjs +30 -0
  51. package/dist/rules/matchName.cjs.map +1 -1
  52. package/dist/rules/multilineBlocks.cjs +78 -6
  53. package/dist/rules/multilineBlocks.cjs.map +1 -1
  54. package/dist/rules/noBadBlocks.cjs +11 -2
  55. package/dist/rules/noBadBlocks.cjs.map +1 -1
  56. package/dist/rules/noBlankBlockDescriptions.cjs +1 -1
  57. package/dist/rules/noBlankBlockDescriptions.cjs.map +1 -1
  58. package/dist/rules/noBlankBlocks.cjs +3 -1
  59. package/dist/rules/noBlankBlocks.cjs.map +1 -1
  60. package/dist/rules/noDefaults.cjs +19 -0
  61. package/dist/rules/noDefaults.cjs.map +1 -1
  62. package/dist/rules/noMissingSyntax.cjs +22 -2
  63. package/dist/rules/noMissingSyntax.cjs.map +1 -1
  64. package/dist/rules/noMultiAsterisks.cjs +29 -0
  65. package/dist/rules/noMultiAsterisks.cjs.map +1 -1
  66. package/dist/rules/noRestrictedSyntax.cjs +17 -1
  67. package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
  68. package/dist/rules/noTypes.cjs +17 -1
  69. package/dist/rules/noTypes.cjs.map +1 -1
  70. package/dist/rules/noUndefinedTypes.cjs +11 -1
  71. package/dist/rules/noUndefinedTypes.cjs.map +1 -1
  72. package/dist/rules/requireAsteriskPrefix.cjs +28 -0
  73. package/dist/rules/requireAsteriskPrefix.cjs.map +1 -1
  74. package/dist/rules/requireDescription.cjs +30 -1
  75. package/dist/rules/requireDescription.cjs.map +1 -1
  76. package/dist/rules/requireDescriptionCompleteSentence.cjs +27 -0
  77. package/dist/rules/requireDescriptionCompleteSentence.cjs.map +1 -1
  78. package/dist/rules/requireExample.cjs +26 -1
  79. package/dist/rules/requireExample.cjs.map +1 -1
  80. package/dist/rules/requireFileOverview.cjs +61 -0
  81. package/dist/rules/requireFileOverview.cjs.map +1 -1
  82. package/dist/rules/requireHyphenBeforeParamDescription.cjs +20 -2
  83. package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +1 -1
  84. package/dist/rules/requireJsdoc.cjs +82 -3
  85. package/dist/rules/requireJsdoc.cjs.map +1 -1
  86. package/dist/rules/requireParam.cjs +213 -1
  87. package/dist/rules/requireParam.cjs.map +1 -1
  88. package/dist/rules/requireParamDescription.cjs +21 -0
  89. package/dist/rules/requireParamDescription.cjs.map +1 -1
  90. package/dist/rules/requireParamName.cjs +16 -1
  91. package/dist/rules/requireParamName.cjs.map +1 -1
  92. package/dist/rules/requireParamType.cjs +21 -1
  93. package/dist/rules/requireParamType.cjs.map +1 -1
  94. package/dist/rules/requirePropertyName.cjs +1 -1
  95. package/dist/rules/requirePropertyName.cjs.map +1 -1
  96. package/dist/rules/requirePropertyType.cjs +1 -1
  97. package/dist/rules/requirePropertyType.cjs.map +1 -1
  98. package/dist/rules/requireReturns.cjs +54 -1
  99. package/dist/rules/requireReturns.cjs.map +1 -1
  100. package/dist/rules/requireReturnsCheck.cjs +22 -1
  101. package/dist/rules/requireReturnsCheck.cjs.map +1 -1
  102. package/dist/rules/requireReturnsDescription.cjs +15 -1
  103. package/dist/rules/requireReturnsDescription.cjs.map +1 -1
  104. package/dist/rules/requireReturnsType.cjs +15 -1
  105. package/dist/rules/requireReturnsType.cjs.map +1 -1
  106. package/dist/rules/requireTemplate.cjs +17 -1
  107. package/dist/rules/requireTemplate.cjs.map +1 -1
  108. package/dist/rules/requireThrows.cjs +18 -1
  109. package/dist/rules/requireThrows.cjs.map +1 -1
  110. package/dist/rules/requireYields.cjs +50 -1
  111. package/dist/rules/requireYields.cjs.map +1 -1
  112. package/dist/rules/requireYieldsCheck.cjs +25 -7
  113. package/dist/rules/requireYieldsCheck.cjs.map +1 -1
  114. package/dist/rules/sortTags.cjs +200 -1
  115. package/dist/rules/sortTags.cjs.map +1 -1
  116. package/dist/rules/tagLines.cjs +32 -2
  117. package/dist/rules/tagLines.cjs.map +1 -1
  118. package/dist/rules/textEscaping.cjs +5 -1
  119. package/dist/rules/textEscaping.cjs.map +1 -1
  120. package/dist/rules/typeFormatting.cjs +64 -16
  121. package/dist/rules/typeFormatting.cjs.map +1 -1
  122. package/dist/rules/validTypes.cjs +8 -1
  123. package/dist/rules/validTypes.cjs.map +1 -1
  124. package/dist/rules.d.ts +2130 -32
  125. package/package.json +1 -1
  126. package/src/buildForbidRuleDefinition.js +0 -1
  127. package/src/buildRejectOrPreferRuleDefinition.js +12 -2
  128. package/src/index-cjs.js +36 -0
  129. package/src/index.js +36 -0
  130. package/src/rules/checkAccess.js +1 -1
  131. package/src/rules/checkAlignment.js +3 -0
  132. package/src/rules/checkExamples.js +1 -1
  133. package/src/rules/checkIndentation.js +19 -0
  134. package/src/rules/checkLineAlignment.js +24 -0
  135. package/src/rules/checkParamNames.js +62 -1
  136. package/src/rules/checkPropertyNames.js +6 -0
  137. package/src/rules/checkTagNames.js +71 -0
  138. package/src/rules/checkTypes.js +16 -1
  139. package/src/rules/checkValues.js +16 -0
  140. package/src/rules/convertToJsdocComments.js +48 -0
  141. package/src/rules/emptyTags.js +10 -1
  142. package/src/rules/implementsOnClasses.js +15 -1
  143. package/src/rules/informativeDocs.js +45 -0
  144. package/src/rules/linesBeforeBlock.js +14 -0
  145. package/src/rules/matchDescription.js +129 -0
  146. package/src/rules/matchName.js +30 -0
  147. package/src/rules/multilineBlocks.js +77 -5
  148. package/src/rules/noBadBlocks.js +11 -2
  149. package/src/rules/noBlankBlockDescriptions.js +1 -1
  150. package/src/rules/noBlankBlocks.js +2 -0
  151. package/src/rules/noDefaults.js +19 -0
  152. package/src/rules/noMissingSyntax.js +22 -2
  153. package/src/rules/noMultiAsterisks.js +29 -0
  154. package/src/rules/noRestrictedSyntax.js +17 -1
  155. package/src/rules/noTypes.js +17 -1
  156. package/src/rules/noUndefinedTypes.js +11 -1
  157. package/src/rules/requireAsteriskPrefix.js +28 -0
  158. package/src/rules/requireDescription.js +30 -1
  159. package/src/rules/requireDescriptionCompleteSentence.js +27 -0
  160. package/src/rules/requireExample.js +26 -1
  161. package/src/rules/requireFileOverview.js +61 -0
  162. package/src/rules/requireHyphenBeforeParamDescription.js +19 -1
  163. package/src/rules/requireJsdoc.js +80 -1
  164. package/src/rules/requireParam.js +213 -1
  165. package/src/rules/requireParamDescription.js +21 -0
  166. package/src/rules/requireParamName.js +16 -1
  167. package/src/rules/requireParamType.js +21 -1
  168. package/src/rules/requirePropertyName.js +1 -1
  169. package/src/rules/requirePropertyType.js +1 -1
  170. package/src/rules/requireReturns.js +54 -1
  171. package/src/rules/requireReturnsCheck.js +22 -1
  172. package/src/rules/requireReturnsDescription.js +15 -1
  173. package/src/rules/requireReturnsType.js +15 -1
  174. package/src/rules/requireTemplate.js +17 -1
  175. package/src/rules/requireThrows.js +18 -1
  176. package/src/rules/requireYields.js +50 -1
  177. package/src/rules/requireYieldsCheck.js +25 -7
  178. package/src/rules/sortTags.js +200 -1
  179. package/src/rules/tagLines.js +30 -0
  180. package/src/rules/textEscaping.js +5 -1
  181. package/src/rules/typeFormatting.js +57 -19
  182. package/src/rules/validTypes.js +8 -1
  183. package/src/rules.d.ts +2130 -32
  184. package/typings/gitdown.d.ts +4 -0
@@ -446,7 +446,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
446
446
  contextDefaults: true,
447
447
  meta: {
448
448
  docs: {
449
- description: 'Requires that all function parameters are documented.',
449
+ description: 'Requires that all function parameters are documented with a `@param` tag.',
450
450
  url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header'
451
451
  },
452
452
  fixable: 'code',
@@ -455,36 +455,150 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
455
455
  properties: {
456
456
  autoIncrementBase: {
457
457
  default: 0,
458
+ description: `Numeric to indicate the number at which to begin auto-incrementing roots.
459
+ Defaults to \`0\`.
460
+ `,
458
461
  type: 'integer'
459
462
  },
460
463
  checkConstructors: {
461
464
  default: true,
465
+ description: `A value indicating whether \`constructor\`s should be checked. Defaults to
466
+ \`true\`.
467
+ `,
462
468
  type: 'boolean'
463
469
  },
464
470
  checkDestructured: {
465
471
  default: true,
472
+ description: 'Whether to require destructured properties. Defaults to `true`.',
466
473
  type: 'boolean'
467
474
  },
468
475
  checkDestructuredRoots: {
469
476
  default: true,
477
+ description: `Whether to check the existence of a corresponding \`@param\` for root objects
478
+ of destructured properties (e.g., that for \`function ({a, b}) {}\`, that there
479
+ is something like \`@param myRootObj\` defined that can correspond to
480
+ the \`{a, b}\` object parameter).
481
+
482
+ If \`checkDestructuredRoots\` is \`false\`, \`checkDestructured\` will also be
483
+ implied to be \`false\` (i.e., the inside of the roots will not be checked
484
+ either, e.g., it will also not complain if \`a\` or \`b\` do not have their own
485
+ documentation). Defaults to \`true\`.
486
+ `,
470
487
  type: 'boolean'
471
488
  },
472
489
  checkGetters: {
473
490
  default: false,
491
+ description: 'A value indicating whether getters should be checked. Defaults to `false`.',
474
492
  type: 'boolean'
475
493
  },
476
494
  checkRestProperty: {
477
495
  default: false,
496
+ description: `If set to \`true\`, will report (and add fixer insertions) for missing rest
497
+ properties. Defaults to \`false\`.
498
+
499
+ If set to \`true\`, note that you can still document the subproperties of the
500
+ rest property using other jsdoc features, e.g., \`@typedef\`:
501
+
502
+ \`\`\`js
503
+ /**
504
+ * @typedef ExtraOptions
505
+ * @property innerProp1
506
+ * @property innerProp2
507
+ */
508
+
509
+ /**
510
+ * @param cfg
511
+ * @param cfg.num
512
+ * @param {ExtraOptions} extra
513
+ */
514
+ function quux ({num, ...extra}) {
515
+ }
516
+ \`\`\`
517
+
518
+ Setting this option to \`false\` (the default) may be useful in cases where
519
+ you already have separate \`@param\` definitions for each of the properties
520
+ within the rest property.
521
+
522
+ For example, with the option disabled, this will not give an error despite
523
+ \`extra\` not having any definition:
524
+
525
+ \`\`\`js
526
+ /**
527
+ * @param cfg
528
+ * @param cfg.num
529
+ */
530
+ function quux ({num, ...extra}) {
531
+ }
532
+ \`\`\`
533
+
534
+ Nor will this:
535
+
536
+ \`\`\`js
537
+ /**
538
+ * @param cfg
539
+ * @param cfg.num
540
+ * @param cfg.innerProp1
541
+ * @param cfg.innerProp2
542
+ */
543
+ function quux ({num, ...extra}) {
544
+ }
545
+ \`\`\`
546
+ `,
478
547
  type: 'boolean'
479
548
  },
480
549
  checkSetters: {
481
550
  default: false,
551
+ description: 'A value indicating whether setters should be checked. Defaults to `false`.',
482
552
  type: 'boolean'
483
553
  },
484
554
  checkTypesPattern: {
555
+ description: `When one specifies a type, unless it is of a generic type, like \`object\`
556
+ or \`array\`, it may be considered unnecessary to have that object's
557
+ destructured components required, especially where generated docs will
558
+ link back to the specified type. For example:
559
+
560
+ \`\`\`js
561
+ /**
562
+ * @param {SVGRect} bbox - a SVGRect
563
+ */
564
+ export const bboxToObj = function ({x, y, width, height}) {
565
+ return {x, y, width, height};
566
+ };
567
+ \`\`\`
568
+
569
+ By default \`checkTypesPattern\` is set to
570
+ \`/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/v\`,
571
+ meaning that destructuring will be required only if the type of the \`@param\`
572
+ (the text between curly brackets) is a match for "Object" or "Array" (with or
573
+ without initial caps), "PlainObject", or "GenericObject", "GenericArray" (or
574
+ if no type is present). So in the above example, the lack of a match will
575
+ mean that no complaint will be given about the undocumented destructured
576
+ parameters.
577
+
578
+ Note that the \`/\` delimiters are optional, but necessary to add flags.
579
+
580
+ Defaults to using (only) the \`v\` flag, so to add your own flags, encapsulate
581
+ your expression as a string, but like a literal, e.g., \`/^object$/vi\`.
582
+
583
+ You could set this regular expression to a more expansive list, or you
584
+ could restrict it such that even types matching those strings would not
585
+ need destructuring.`,
485
586
  type: 'string'
486
587
  },
487
588
  contexts: {
589
+ description: `Set this to an array of strings representing the AST context (or an object with
590
+ optional \`context\` and \`comment\` properties) where you wish the rule to be applied.
591
+
592
+ \`context\` defaults to \`any\` and \`comment\` defaults to no specific comment context.
593
+
594
+ Overrides the default contexts (\`ArrowFunctionExpression\`, \`FunctionDeclaration\`,
595
+ \`FunctionExpression\`). May be useful for adding such as
596
+ \`TSMethodSignature\` in TypeScript or restricting the contexts
597
+ which are checked.
598
+
599
+ See the ["AST and Selectors"](../#advanced-ast-and-selectors)
600
+ section of our Advanced docs for more on the expected format.
601
+ `,
488
602
  items: {
489
603
  anyOf: [{
490
604
  type: 'string'
@@ -504,33 +618,131 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
504
618
  type: 'array'
505
619
  },
506
620
  enableFixer: {
621
+ description: 'Whether to enable the fixer. Defaults to `true`.',
507
622
  type: 'boolean'
508
623
  },
509
624
  enableRestElementFixer: {
625
+ description: `Whether to enable the rest element fixer.
626
+
627
+ The fixer will automatically report/insert
628
+ [JSDoc repeatable parameters](https://jsdoc.app/tags-param.html#multiple-types-and-repeatable-parameters)
629
+ if missing.
630
+
631
+ \`\`\`js
632
+ /**
633
+ * @param {GenericArray} cfg
634
+ * @param {number} cfg."0"
635
+ */
636
+ function baar ([a, ...extra]) {
637
+ //
638
+ }
639
+ \`\`\`
640
+
641
+ ...becomes:
642
+
643
+ \`\`\`js
644
+ /**
645
+ * @param {GenericArray} cfg
646
+ * @param {number} cfg."0"
647
+ * @param {...any} cfg."1"
648
+ */
649
+ function baar ([a, ...extra]) {
650
+ //
651
+ }
652
+ \`\`\`
653
+
654
+ Note that the type \`any\` is included since we don't know of any specific
655
+ type to use.
656
+
657
+ Defaults to \`true\`.
658
+ `,
510
659
  type: 'boolean'
511
660
  },
512
661
  enableRootFixer: {
662
+ description: `Whether to enable the auto-adding of incrementing roots.
663
+
664
+ The default behavior of \`true\` is for "root" to be auto-inserted for missing
665
+ roots, followed by a 0-based auto-incrementing number.
666
+
667
+ So for:
668
+
669
+ \`\`\`js
670
+ function quux ({foo}, {bar}, {baz}) {
671
+ }
672
+ \`\`\`
673
+
674
+ ...the default JSDoc that would be added if the fixer is enabled would be:
675
+
676
+ \`\`\`js
677
+ /**
678
+ * @param root0
679
+ * @param root0.foo
680
+ * @param root1
681
+ * @param root1.bar
682
+ * @param root2
683
+ * @param root2.baz
684
+ */
685
+ \`\`\`
686
+
687
+ Has no effect if \`enableFixer\` is set to \`false\`.`,
513
688
  type: 'boolean'
514
689
  },
515
690
  exemptedBy: {
691
+ description: `Array of tags (e.g., \`['type']\`) whose presence on the document block
692
+ avoids the need for a \`@param\`. Defaults to an array with
693
+ \`inheritdoc\`. If you set this array, it will overwrite the default,
694
+ so be sure to add back \`inheritdoc\` if you wish its presence to cause
695
+ exemption of the rule.`,
516
696
  items: {
517
697
  type: 'string'
518
698
  },
519
699
  type: 'array'
520
700
  },
521
701
  ignoreWhenAllParamsMissing: {
702
+ description: `Set to \`true\` to ignore reporting when all params are missing. Defaults to
703
+ \`false\`.`,
522
704
  type: 'boolean'
523
705
  },
524
706
  interfaceExemptsParamsCheck: {
707
+ description: `Set if you wish TypeScript interfaces to exempt checks for the existence of
708
+ \`@param\`'s.
709
+
710
+ Will check for a type defining the function itself (on a variable
711
+ declaration) or if there is a single destructured object with a type.
712
+ Defaults to \`false\`.`,
525
713
  type: 'boolean'
526
714
  },
527
715
  unnamedRootBase: {
716
+ description: `An array of root names to use in the fixer when roots are missing. Defaults
717
+ to \`['root']\`. Note that only when all items in the array besides the last
718
+ are exhausted will auto-incrementing occur. So, with
719
+ \`unnamedRootBase: ['arg', 'config']\`, the following:
720
+
721
+ \`\`\`js
722
+ function quux ({foo}, [bar], {baz}) {
723
+ }
724
+ \`\`\`
725
+
726
+ ...will get the following JSDoc block added:
727
+
728
+ \`\`\`js
729
+ /**
730
+ * @param arg
731
+ * @param arg.foo
732
+ * @param config0
733
+ * @param config0."0" (\`bar\`)
734
+ * @param config1
735
+ * @param config1.baz
736
+ */
737
+ \`\`\``,
528
738
  items: {
529
739
  type: 'string'
530
740
  },
531
741
  type: 'array'
532
742
  },
533
743
  useDefaultObjectProperties: {
744
+ description: `Set to \`true\` if you wish to expect documentation of properties on objects
745
+ supplied as default values. Defaults to \`false\`.`,
534
746
  type: 'boolean'
535
747
  }
536
748
  },
@@ -1 +1 @@
1
- {"version":3,"file":"requireParam.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","rootNamer","desiredRoots","currentIndex","name","idx","incremented","length","base","suffix","shift","_default","exports","iterateJsdoc","context","jsdoc","node","utils","avoidDocs","hasTag","autoIncrementBase","checkDestructured","checkDestructuredRoots","checkRestProperty","checkTypesPattern","enableFixer","enableRestElementFixer","enableRootFixer","ignoreWhenAllParamsMissing","interfaceExemptsParamsCheck","unnamedRootBase","useDefaultObjectProperties","options","params","type","typeAnnotation","parent","id","preferredTagName","getPreferredTagName","tagName","functionParameterNames","getFunctionParameterNames","jsdocParameterNames","getJsdocTagsDeep","shallowJsdocParameterNames","filter","tag","includes","map","checkTypesRegex","getRegexFromString","missingTags","flattenedRoots","flattenRoots","names","paramIndex","hasParamIndex","cur","dropPathSegmentQuotes","String","getParamIndex","setParamIndex","entries","findExpectedIndex","jsdocTags","indexAtFunctionParams","remainingRoots","slice","foundIndex","findIndex","newAdd","some","remainingRoot","Array","isArray","tags","tagLineCount","source","tokens","end","nextRootName","namer","thisOffset","functionParameterIdx","functionParameterName","inc","matchedJsdoc","rootName","search","hasPropertyRest","hasRestElement","rests","notCheckingNames","paramName","find","fpn","emptyParamIdx","push","remove","fullParamName","notCheckingName","paramType","comparePaths","undefined","startsWith","funcParamName","restElement","fix","createTokens","tagIndex","sourceIndex","spliceCount","number","delimiter","description","lineEnd","postDelimiter","postName","postTag","postType","start","splice","inlineTags","optional","problems","firstNumber","src","offset","expectedIdx","fixer","missingTag","makeMultiline","reportJSDoc","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","checkConstructors","checkGetters","checkSetters","contexts","items","anyOf","comment","exemptedBy","noTracking","module"],"sources":["../../src/rules/requireParam.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @typedef {[string, boolean, () => RootNamerReturn]} RootNamerReturn\n */\n\n/**\n * @param {string[]} desiredRoots\n * @param {number} currentIndex\n * @returns {RootNamerReturn}\n */\nconst rootNamer = (desiredRoots, currentIndex) => {\n /** @type {string} */\n let name;\n let idx = currentIndex;\n const incremented = desiredRoots.length <= 1;\n if (incremented) {\n const base = desiredRoots[0];\n const suffix = idx++;\n name = `${base}${suffix}`;\n } else {\n name = /** @type {string} */ (desiredRoots.shift());\n }\n\n return [\n name,\n incremented,\n () => {\n return rootNamer(desiredRoots, idx);\n },\n ];\n};\n\n/* eslint-disable complexity -- Temporary */\nexport default iterateJsdoc(({\n context,\n jsdoc,\n node,\n utils,\n}) => {\n /* eslint-enable complexity -- Temporary */\n if (utils.avoidDocs()) {\n return;\n }\n\n // Param type is specified by type in @type\n if (utils.hasTag('type')) {\n return;\n }\n\n const {\n autoIncrementBase = 0,\n checkDestructured = true,\n checkDestructuredRoots = true,\n checkRestProperty = false,\n checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/',\n enableFixer = true,\n enableRestElementFixer = true,\n enableRootFixer = true,\n ignoreWhenAllParamsMissing = false,\n interfaceExemptsParamsCheck = false,\n unnamedRootBase = [\n 'root',\n ],\n useDefaultObjectProperties = false,\n } = context.options[0] || {};\n\n if (interfaceExemptsParamsCheck) {\n if (node && 'params' in node && node.params.length === 1 &&\n node.params?.[0] && typeof node.params[0] === 'object' &&\n node.params[0].type === 'ObjectPattern' &&\n 'typeAnnotation' in node.params[0] && node.params[0].typeAnnotation\n ) {\n return;\n }\n\n if (node && node.parent.type === 'VariableDeclarator' &&\n 'typeAnnotation' in node.parent.id && node.parent.id.typeAnnotation) {\n return;\n }\n }\n\n const preferredTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'param',\n }));\n if (!preferredTagName) {\n return;\n }\n\n const functionParameterNames = utils.getFunctionParameterNames(useDefaultObjectProperties);\n if (!functionParameterNames.length) {\n return;\n }\n\n const jsdocParameterNames =\n /**\n * @type {{\n * idx: import('../iterateJsdoc.js').Integer;\n * name: string;\n * type: string;\n * }[]}\n */ (utils.getJsdocTagsDeep(preferredTagName));\n\n if (ignoreWhenAllParamsMissing && !jsdocParameterNames.length) {\n return;\n }\n\n const shallowJsdocParameterNames = jsdocParameterNames.filter((tag) => {\n return !tag.name.includes('.');\n }).map((tag, idx) => {\n return {\n ...tag,\n idx,\n };\n });\n\n const checkTypesRegex = utils.getRegexFromString(checkTypesPattern);\n\n /**\n * @type {{\n * functionParameterIdx: import('../iterateJsdoc.js').Integer,\n * functionParameterName: string,\n * inc: boolean|undefined,\n * remove?: true,\n * type?: string|undefined\n * }[]}\n */\n const missingTags = [];\n const flattenedRoots = utils.flattenRoots(functionParameterNames).names;\n\n /**\n * @type {{\n * [key: string]: import('../iterateJsdoc.js').Integer\n * }}\n */\n const paramIndex = {};\n\n /**\n * @param {string} cur\n * @returns {boolean}\n */\n const hasParamIndex = (cur) => {\n return utils.dropPathSegmentQuotes(String(cur)) in paramIndex;\n };\n\n /**\n *\n * @param {string|number|undefined} cur\n * @returns {import('../iterateJsdoc.js').Integer}\n */\n const getParamIndex = (cur) => {\n return paramIndex[utils.dropPathSegmentQuotes(String(cur))];\n };\n\n /**\n *\n * @param {string} cur\n * @param {import('../iterateJsdoc.js').Integer} idx\n * @returns {void}\n */\n const setParamIndex = (cur, idx) => {\n paramIndex[utils.dropPathSegmentQuotes(String(cur))] = idx;\n };\n\n for (const [\n idx,\n cur,\n ] of flattenedRoots.entries()) {\n setParamIndex(cur, idx);\n }\n\n /**\n *\n * @param {(import('@es-joy/jsdoccomment').JsdocTagWithInline & {\n * newAdd?: boolean\n * })[]} jsdocTags\n * @param {import('../iterateJsdoc.js').Integer} indexAtFunctionParams\n * @returns {import('../iterateJsdoc.js').Integer}\n */\n const findExpectedIndex = (jsdocTags, indexAtFunctionParams) => {\n const remainingRoots = functionParameterNames.slice(indexAtFunctionParams || 0);\n const foundIndex = jsdocTags.findIndex(({\n name,\n newAdd,\n }) => {\n return !newAdd && remainingRoots.some((remainingRoot) => {\n if (Array.isArray(remainingRoot)) {\n return (\n /**\n * @type {import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string|undefined;\n * }}\n */ (remainingRoot[1]).names.includes(name)\n );\n }\n\n if (typeof remainingRoot === 'object') {\n return name === remainingRoot.name;\n }\n\n return name === remainingRoot;\n });\n });\n\n const tags = foundIndex > -1 ?\n jsdocTags.slice(0, foundIndex) :\n jsdocTags.filter(({\n tag,\n }) => {\n return tag === preferredTagName;\n });\n\n let tagLineCount = 0;\n for (const {\n source,\n } of tags) {\n for (const {\n tokens: {\n end,\n },\n } of source) {\n if (!end) {\n tagLineCount++;\n }\n }\n }\n\n return tagLineCount;\n };\n\n let [\n nextRootName,\n incremented,\n namer,\n ] = rootNamer([\n ...unnamedRootBase,\n ], autoIncrementBase);\n\n const thisOffset = functionParameterNames[0] === 'this' ? 1 : 0;\n\n for (const [\n functionParameterIdx,\n functionParameterName,\n ] of functionParameterNames.entries()) {\n let inc;\n if (Array.isArray(functionParameterName)) {\n const matchedJsdoc = shallowJsdocParameterNames[functionParameterIdx - thisOffset];\n\n /** @type {string} */\n let rootName;\n if (functionParameterName[0]) {\n rootName = functionParameterName[0];\n } else if (matchedJsdoc && matchedJsdoc.name) {\n rootName = matchedJsdoc.name;\n if (matchedJsdoc.type && matchedJsdoc.type.search(checkTypesRegex) === -1) {\n continue;\n }\n } else {\n rootName = nextRootName;\n inc = incremented;\n }\n\n [\n nextRootName,\n incremented,\n namer,\n ] = namer();\n\n const {\n hasPropertyRest,\n hasRestElement,\n names,\n rests,\n } = /**\n * @type {import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string | undefined;\n * }}\n */ (functionParameterName[1]);\n const notCheckingNames = [];\n if (!enableRestElementFixer && hasRestElement) {\n continue;\n }\n\n if (!checkDestructuredRoots) {\n continue;\n }\n\n for (const [\n idx,\n paramName,\n ] of names.entries()) {\n // Add root if the root name is not in the docs (and is not already\n // in the tags to be fixed)\n if (!jsdocParameterNames.find(({\n name,\n }) => {\n return name === rootName;\n }) && !missingTags.find(({\n functionParameterName: fpn,\n }) => {\n return fpn === rootName;\n })) {\n const emptyParamIdx = jsdocParameterNames.findIndex(({\n name,\n }) => {\n return !name;\n });\n\n if (emptyParamIdx > -1) {\n missingTags.push({\n functionParameterIdx: emptyParamIdx,\n functionParameterName: rootName,\n inc,\n remove: true,\n });\n } else {\n missingTags.push({\n functionParameterIdx: hasParamIndex(rootName) ?\n getParamIndex(rootName) :\n getParamIndex(paramName),\n functionParameterName: rootName,\n inc,\n });\n }\n }\n\n if (!checkDestructured) {\n continue;\n }\n\n if (!checkRestProperty && rests[idx]) {\n continue;\n }\n\n const fullParamName = `${rootName}.${paramName}`;\n\n const notCheckingName = jsdocParameterNames.find(({\n name,\n type: paramType,\n }) => {\n return utils.comparePaths(name)(fullParamName) && paramType.search(checkTypesRegex) === -1 && paramType !== '';\n });\n\n if (notCheckingName !== undefined) {\n notCheckingNames.push(notCheckingName.name);\n }\n\n if (notCheckingNames.find((name) => {\n return fullParamName.startsWith(name);\n })) {\n continue;\n }\n\n if (jsdocParameterNames && !jsdocParameterNames.find(({\n name,\n }) => {\n return utils.comparePaths(name)(fullParamName);\n })) {\n missingTags.push({\n functionParameterIdx: getParamIndex(\n functionParameterName[0] ? fullParamName : paramName,\n ),\n functionParameterName: fullParamName,\n inc,\n type: hasRestElement && !hasPropertyRest ? '{...any}' : undefined,\n });\n }\n }\n\n continue;\n }\n\n /** @type {string} */\n let funcParamName;\n let type;\n if (typeof functionParameterName === 'object') {\n if (!enableRestElementFixer && functionParameterName.restElement) {\n continue;\n }\n\n funcParamName = /** @type {string} */ (functionParameterName.name);\n type = '{...any}';\n } else {\n funcParamName = /** @type {string} */ (functionParameterName);\n }\n\n if (jsdocParameterNames && !jsdocParameterNames.find(({\n name,\n }) => {\n return name === funcParamName;\n }) && funcParamName !== 'this') {\n missingTags.push({\n functionParameterIdx: getParamIndex(funcParamName),\n functionParameterName: funcParamName,\n inc,\n type,\n });\n }\n }\n\n /**\n *\n * @param {{\n * functionParameterIdx: import('../iterateJsdoc.js').Integer,\n * functionParameterName: string,\n * remove?: true,\n * inc?: boolean,\n * type?: string\n * }} cfg\n */\n const fix = ({\n functionParameterIdx,\n functionParameterName,\n inc,\n remove,\n type,\n }) => {\n if (inc && !enableRootFixer) {\n return;\n }\n\n /**\n *\n * @param {import('../iterateJsdoc.js').Integer} tagIndex\n * @param {import('../iterateJsdoc.js').Integer} sourceIndex\n * @param {import('../iterateJsdoc.js').Integer} spliceCount\n * @returns {void}\n */\n const createTokens = (tagIndex, sourceIndex, spliceCount) => {\n // console.log(sourceIndex, tagIndex, jsdoc.tags, jsdoc.source);\n const tokens = {\n number: sourceIndex + 1,\n source: '',\n tokens: {\n delimiter: '*',\n description: '',\n end: '',\n lineEnd: '',\n name: functionParameterName,\n newAdd: true,\n postDelimiter: ' ',\n postName: '',\n postTag: ' ',\n postType: type ? ' ' : '',\n start: jsdoc.source[sourceIndex].tokens.start,\n tag: `@${preferredTagName}`,\n type: type ?? '',\n },\n };\n\n /**\n * @type {(import('@es-joy/jsdoccomment').JsdocTagWithInline & {\n * newAdd?: true\n * })[]}\n */ (jsdoc.tags).splice(tagIndex, spliceCount, {\n description: '',\n inlineTags: [],\n name: functionParameterName,\n newAdd: true,\n optional: false,\n problems: [],\n source: [\n tokens,\n ],\n tag: preferredTagName,\n type: type ?? '',\n });\n const firstNumber = jsdoc.source[0].number;\n jsdoc.source.splice(sourceIndex, spliceCount, tokens);\n for (const [\n idx,\n src,\n ] of jsdoc.source.slice(sourceIndex).entries()) {\n src.number = firstNumber + sourceIndex + idx;\n }\n };\n\n const offset = jsdoc.source.findIndex(({\n tokens: {\n end,\n tag,\n },\n }) => {\n return tag || end;\n });\n if (remove) {\n createTokens(functionParameterIdx, offset + functionParameterIdx, 1);\n } else {\n const expectedIdx = findExpectedIndex(jsdoc.tags, functionParameterIdx);\n createTokens(expectedIdx, offset + expectedIdx, 0);\n }\n };\n\n /**\n * @returns {void}\n */\n const fixer = () => {\n for (const missingTag of missingTags) {\n fix(missingTag);\n }\n };\n\n if (missingTags.length && jsdoc.source.length === 1) {\n utils.makeMultiline();\n }\n\n for (const {\n functionParameterName,\n } of missingTags) {\n utils.reportJSDoc(\n `Missing JSDoc @${preferredTagName} \"${functionParameterName}\" declaration.`,\n null,\n enableFixer ? fixer : null,\n );\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all function parameters are documented.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n autoIncrementBase: {\n default: 0,\n type: 'integer',\n },\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkDestructured: {\n default: true,\n type: 'boolean',\n },\n checkDestructuredRoots: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n default: false,\n type: 'boolean',\n },\n checkRestProperty: {\n default: false,\n type: 'boolean',\n },\n checkSetters: {\n default: false,\n type: 'boolean',\n },\n checkTypesPattern: {\n type: 'string',\n },\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n type: 'boolean',\n },\n enableRestElementFixer: {\n type: 'boolean',\n },\n enableRootFixer: {\n type: 'boolean',\n },\n exemptedBy: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n ignoreWhenAllParamsMissing: {\n type: 'boolean',\n },\n interfaceExemptsParamsCheck: {\n type: 'boolean',\n },\n unnamedRootBase: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n useDefaultObjectProperties: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n\n // We cannot cache comment nodes as the contexts may recur with the\n // same comment node but a different JS node, and we may need the different\n // JS node to ensure we iterate its context\n noTracking: true,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMG,SAAS,GAAGA,CAACC,YAAY,EAAEC,YAAY,KAAK;EAChD;EACA,IAAIC,IAAI;EACR,IAAIC,GAAG,GAAGF,YAAY;EACtB,MAAMG,WAAW,GAAGJ,YAAY,CAACK,MAAM,IAAI,CAAC;EAC5C,IAAID,WAAW,EAAE;IACf,MAAME,IAAI,GAAGN,YAAY,CAAC,CAAC,CAAC;IAC5B,MAAMO,MAAM,GAAGJ,GAAG,EAAE;IACpBD,IAAI,GAAG,GAAGI,IAAI,GAAGC,MAAM,EAAE;EAC3B,CAAC,MAAM;IACLL,IAAI,GAAG,qBAAuBF,YAAY,CAACQ,KAAK,CAAC,CAAE;EACrD;EAEA,OAAO,CACLN,IAAI,EACJE,WAAW,EACX,MAAM;IACJ,OAAOL,SAAS,CAACC,YAAY,EAAEG,GAAG,CAAC;EACrC,CAAC,CACF;AACH,CAAC;;AAED;AAAA,IAAAM,QAAA,GA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AI,EAAE;QACR,CAAC;QACDL,2BAA2B,EAAE;UAC3BK,IAAI,EAAE;QACR,CAAC;QACDJ,eAAe,EAAE;UACfoH,KAAK,EAAE;YACLhH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDH,0BAA0B,EAAE;UAC1BG,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR,CAAC;EAED;EACA;EACA;EACAoH,UAAU,EAAE;AACd,CAAC,CAAC;AAAAC,MAAA,CAAA3I,OAAA,GAAAA,OAAA,CAAAZ,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"requireParam.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","rootNamer","desiredRoots","currentIndex","name","idx","incremented","length","base","suffix","shift","_default","exports","iterateJsdoc","context","jsdoc","node","utils","avoidDocs","hasTag","autoIncrementBase","checkDestructured","checkDestructuredRoots","checkRestProperty","checkTypesPattern","enableFixer","enableRestElementFixer","enableRootFixer","ignoreWhenAllParamsMissing","interfaceExemptsParamsCheck","unnamedRootBase","useDefaultObjectProperties","options","params","type","typeAnnotation","parent","id","preferredTagName","getPreferredTagName","tagName","functionParameterNames","getFunctionParameterNames","jsdocParameterNames","getJsdocTagsDeep","shallowJsdocParameterNames","filter","tag","includes","map","checkTypesRegex","getRegexFromString","missingTags","flattenedRoots","flattenRoots","names","paramIndex","hasParamIndex","cur","dropPathSegmentQuotes","String","getParamIndex","setParamIndex","entries","findExpectedIndex","jsdocTags","indexAtFunctionParams","remainingRoots","slice","foundIndex","findIndex","newAdd","some","remainingRoot","Array","isArray","tags","tagLineCount","source","tokens","end","nextRootName","namer","thisOffset","functionParameterIdx","functionParameterName","inc","matchedJsdoc","rootName","search","hasPropertyRest","hasRestElement","rests","notCheckingNames","paramName","find","fpn","emptyParamIdx","push","remove","fullParamName","notCheckingName","paramType","comparePaths","undefined","startsWith","funcParamName","restElement","fix","createTokens","tagIndex","sourceIndex","spliceCount","number","delimiter","description","lineEnd","postDelimiter","postName","postTag","postType","start","splice","inlineTags","optional","problems","firstNumber","src","offset","expectedIdx","fixer","missingTag","makeMultiline","reportJSDoc","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","checkConstructors","checkGetters","checkSetters","contexts","items","anyOf","comment","exemptedBy","noTracking","module"],"sources":["../../src/rules/requireParam.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @typedef {[string, boolean, () => RootNamerReturn]} RootNamerReturn\n */\n\n/**\n * @param {string[]} desiredRoots\n * @param {number} currentIndex\n * @returns {RootNamerReturn}\n */\nconst rootNamer = (desiredRoots, currentIndex) => {\n /** @type {string} */\n let name;\n let idx = currentIndex;\n const incremented = desiredRoots.length <= 1;\n if (incremented) {\n const base = desiredRoots[0];\n const suffix = idx++;\n name = `${base}${suffix}`;\n } else {\n name = /** @type {string} */ (desiredRoots.shift());\n }\n\n return [\n name,\n incremented,\n () => {\n return rootNamer(desiredRoots, idx);\n },\n ];\n};\n\n/* eslint-disable complexity -- Temporary */\nexport default iterateJsdoc(({\n context,\n jsdoc,\n node,\n utils,\n}) => {\n /* eslint-enable complexity -- Temporary */\n if (utils.avoidDocs()) {\n return;\n }\n\n // Param type is specified by type in @type\n if (utils.hasTag('type')) {\n return;\n }\n\n const {\n autoIncrementBase = 0,\n checkDestructured = true,\n checkDestructuredRoots = true,\n checkRestProperty = false,\n checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/',\n enableFixer = true,\n enableRestElementFixer = true,\n enableRootFixer = true,\n ignoreWhenAllParamsMissing = false,\n interfaceExemptsParamsCheck = false,\n unnamedRootBase = [\n 'root',\n ],\n useDefaultObjectProperties = false,\n } = context.options[0] || {};\n\n if (interfaceExemptsParamsCheck) {\n if (node && 'params' in node && node.params.length === 1 &&\n node.params?.[0] && typeof node.params[0] === 'object' &&\n node.params[0].type === 'ObjectPattern' &&\n 'typeAnnotation' in node.params[0] && node.params[0].typeAnnotation\n ) {\n return;\n }\n\n if (node && node.parent.type === 'VariableDeclarator' &&\n 'typeAnnotation' in node.parent.id && node.parent.id.typeAnnotation) {\n return;\n }\n }\n\n const preferredTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'param',\n }));\n if (!preferredTagName) {\n return;\n }\n\n const functionParameterNames = utils.getFunctionParameterNames(useDefaultObjectProperties);\n if (!functionParameterNames.length) {\n return;\n }\n\n const jsdocParameterNames =\n /**\n * @type {{\n * idx: import('../iterateJsdoc.js').Integer;\n * name: string;\n * type: string;\n * }[]}\n */ (utils.getJsdocTagsDeep(preferredTagName));\n\n if (ignoreWhenAllParamsMissing && !jsdocParameterNames.length) {\n return;\n }\n\n const shallowJsdocParameterNames = jsdocParameterNames.filter((tag) => {\n return !tag.name.includes('.');\n }).map((tag, idx) => {\n return {\n ...tag,\n idx,\n };\n });\n\n const checkTypesRegex = utils.getRegexFromString(checkTypesPattern);\n\n /**\n * @type {{\n * functionParameterIdx: import('../iterateJsdoc.js').Integer,\n * functionParameterName: string,\n * inc: boolean|undefined,\n * remove?: true,\n * type?: string|undefined\n * }[]}\n */\n const missingTags = [];\n const flattenedRoots = utils.flattenRoots(functionParameterNames).names;\n\n /**\n * @type {{\n * [key: string]: import('../iterateJsdoc.js').Integer\n * }}\n */\n const paramIndex = {};\n\n /**\n * @param {string} cur\n * @returns {boolean}\n */\n const hasParamIndex = (cur) => {\n return utils.dropPathSegmentQuotes(String(cur)) in paramIndex;\n };\n\n /**\n *\n * @param {string|number|undefined} cur\n * @returns {import('../iterateJsdoc.js').Integer}\n */\n const getParamIndex = (cur) => {\n return paramIndex[utils.dropPathSegmentQuotes(String(cur))];\n };\n\n /**\n *\n * @param {string} cur\n * @param {import('../iterateJsdoc.js').Integer} idx\n * @returns {void}\n */\n const setParamIndex = (cur, idx) => {\n paramIndex[utils.dropPathSegmentQuotes(String(cur))] = idx;\n };\n\n for (const [\n idx,\n cur,\n ] of flattenedRoots.entries()) {\n setParamIndex(cur, idx);\n }\n\n /**\n *\n * @param {(import('@es-joy/jsdoccomment').JsdocTagWithInline & {\n * newAdd?: boolean\n * })[]} jsdocTags\n * @param {import('../iterateJsdoc.js').Integer} indexAtFunctionParams\n * @returns {import('../iterateJsdoc.js').Integer}\n */\n const findExpectedIndex = (jsdocTags, indexAtFunctionParams) => {\n const remainingRoots = functionParameterNames.slice(indexAtFunctionParams || 0);\n const foundIndex = jsdocTags.findIndex(({\n name,\n newAdd,\n }) => {\n return !newAdd && remainingRoots.some((remainingRoot) => {\n if (Array.isArray(remainingRoot)) {\n return (\n /**\n * @type {import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string|undefined;\n * }}\n */ (remainingRoot[1]).names.includes(name)\n );\n }\n\n if (typeof remainingRoot === 'object') {\n return name === remainingRoot.name;\n }\n\n return name === remainingRoot;\n });\n });\n\n const tags = foundIndex > -1 ?\n jsdocTags.slice(0, foundIndex) :\n jsdocTags.filter(({\n tag,\n }) => {\n return tag === preferredTagName;\n });\n\n let tagLineCount = 0;\n for (const {\n source,\n } of tags) {\n for (const {\n tokens: {\n end,\n },\n } of source) {\n if (!end) {\n tagLineCount++;\n }\n }\n }\n\n return tagLineCount;\n };\n\n let [\n nextRootName,\n incremented,\n namer,\n ] = rootNamer([\n ...unnamedRootBase,\n ], autoIncrementBase);\n\n const thisOffset = functionParameterNames[0] === 'this' ? 1 : 0;\n\n for (const [\n functionParameterIdx,\n functionParameterName,\n ] of functionParameterNames.entries()) {\n let inc;\n if (Array.isArray(functionParameterName)) {\n const matchedJsdoc = shallowJsdocParameterNames[functionParameterIdx - thisOffset];\n\n /** @type {string} */\n let rootName;\n if (functionParameterName[0]) {\n rootName = functionParameterName[0];\n } else if (matchedJsdoc && matchedJsdoc.name) {\n rootName = matchedJsdoc.name;\n if (matchedJsdoc.type && matchedJsdoc.type.search(checkTypesRegex) === -1) {\n continue;\n }\n } else {\n rootName = nextRootName;\n inc = incremented;\n }\n\n [\n nextRootName,\n incremented,\n namer,\n ] = namer();\n\n const {\n hasPropertyRest,\n hasRestElement,\n names,\n rests,\n } = /**\n * @type {import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string | undefined;\n * }}\n */ (functionParameterName[1]);\n const notCheckingNames = [];\n if (!enableRestElementFixer && hasRestElement) {\n continue;\n }\n\n if (!checkDestructuredRoots) {\n continue;\n }\n\n for (const [\n idx,\n paramName,\n ] of names.entries()) {\n // Add root if the root name is not in the docs (and is not already\n // in the tags to be fixed)\n if (!jsdocParameterNames.find(({\n name,\n }) => {\n return name === rootName;\n }) && !missingTags.find(({\n functionParameterName: fpn,\n }) => {\n return fpn === rootName;\n })) {\n const emptyParamIdx = jsdocParameterNames.findIndex(({\n name,\n }) => {\n return !name;\n });\n\n if (emptyParamIdx > -1) {\n missingTags.push({\n functionParameterIdx: emptyParamIdx,\n functionParameterName: rootName,\n inc,\n remove: true,\n });\n } else {\n missingTags.push({\n functionParameterIdx: hasParamIndex(rootName) ?\n getParamIndex(rootName) :\n getParamIndex(paramName),\n functionParameterName: rootName,\n inc,\n });\n }\n }\n\n if (!checkDestructured) {\n continue;\n }\n\n if (!checkRestProperty && rests[idx]) {\n continue;\n }\n\n const fullParamName = `${rootName}.${paramName}`;\n\n const notCheckingName = jsdocParameterNames.find(({\n name,\n type: paramType,\n }) => {\n return utils.comparePaths(name)(fullParamName) && paramType.search(checkTypesRegex) === -1 && paramType !== '';\n });\n\n if (notCheckingName !== undefined) {\n notCheckingNames.push(notCheckingName.name);\n }\n\n if (notCheckingNames.find((name) => {\n return fullParamName.startsWith(name);\n })) {\n continue;\n }\n\n if (jsdocParameterNames && !jsdocParameterNames.find(({\n name,\n }) => {\n return utils.comparePaths(name)(fullParamName);\n })) {\n missingTags.push({\n functionParameterIdx: getParamIndex(\n functionParameterName[0] ? fullParamName : paramName,\n ),\n functionParameterName: fullParamName,\n inc,\n type: hasRestElement && !hasPropertyRest ? '{...any}' : undefined,\n });\n }\n }\n\n continue;\n }\n\n /** @type {string} */\n let funcParamName;\n let type;\n if (typeof functionParameterName === 'object') {\n if (!enableRestElementFixer && functionParameterName.restElement) {\n continue;\n }\n\n funcParamName = /** @type {string} */ (functionParameterName.name);\n type = '{...any}';\n } else {\n funcParamName = /** @type {string} */ (functionParameterName);\n }\n\n if (jsdocParameterNames && !jsdocParameterNames.find(({\n name,\n }) => {\n return name === funcParamName;\n }) && funcParamName !== 'this') {\n missingTags.push({\n functionParameterIdx: getParamIndex(funcParamName),\n functionParameterName: funcParamName,\n inc,\n type,\n });\n }\n }\n\n /**\n *\n * @param {{\n * functionParameterIdx: import('../iterateJsdoc.js').Integer,\n * functionParameterName: string,\n * remove?: true,\n * inc?: boolean,\n * type?: string\n * }} cfg\n */\n const fix = ({\n functionParameterIdx,\n functionParameterName,\n inc,\n remove,\n type,\n }) => {\n if (inc && !enableRootFixer) {\n return;\n }\n\n /**\n *\n * @param {import('../iterateJsdoc.js').Integer} tagIndex\n * @param {import('../iterateJsdoc.js').Integer} sourceIndex\n * @param {import('../iterateJsdoc.js').Integer} spliceCount\n * @returns {void}\n */\n const createTokens = (tagIndex, sourceIndex, spliceCount) => {\n // console.log(sourceIndex, tagIndex, jsdoc.tags, jsdoc.source);\n const tokens = {\n number: sourceIndex + 1,\n source: '',\n tokens: {\n delimiter: '*',\n description: '',\n end: '',\n lineEnd: '',\n name: functionParameterName,\n newAdd: true,\n postDelimiter: ' ',\n postName: '',\n postTag: ' ',\n postType: type ? ' ' : '',\n start: jsdoc.source[sourceIndex].tokens.start,\n tag: `@${preferredTagName}`,\n type: type ?? '',\n },\n };\n\n /**\n * @type {(import('@es-joy/jsdoccomment').JsdocTagWithInline & {\n * newAdd?: true\n * })[]}\n */ (jsdoc.tags).splice(tagIndex, spliceCount, {\n description: '',\n inlineTags: [],\n name: functionParameterName,\n newAdd: true,\n optional: false,\n problems: [],\n source: [\n tokens,\n ],\n tag: preferredTagName,\n type: type ?? '',\n });\n const firstNumber = jsdoc.source[0].number;\n jsdoc.source.splice(sourceIndex, spliceCount, tokens);\n for (const [\n idx,\n src,\n ] of jsdoc.source.slice(sourceIndex).entries()) {\n src.number = firstNumber + sourceIndex + idx;\n }\n };\n\n const offset = jsdoc.source.findIndex(({\n tokens: {\n end,\n tag,\n },\n }) => {\n return tag || end;\n });\n if (remove) {\n createTokens(functionParameterIdx, offset + functionParameterIdx, 1);\n } else {\n const expectedIdx = findExpectedIndex(jsdoc.tags, functionParameterIdx);\n createTokens(expectedIdx, offset + expectedIdx, 0);\n }\n };\n\n /**\n * @returns {void}\n */\n const fixer = () => {\n for (const missingTag of missingTags) {\n fix(missingTag);\n }\n };\n\n if (missingTags.length && jsdoc.source.length === 1) {\n utils.makeMultiline();\n }\n\n for (const {\n functionParameterName,\n } of missingTags) {\n utils.reportJSDoc(\n `Missing JSDoc @${preferredTagName} \"${functionParameterName}\" declaration.`,\n null,\n enableFixer ? fixer : null,\n );\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all function parameters are documented with a `@param` tag.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n autoIncrementBase: {\n default: 0,\n description: `Numeric to indicate the number at which to begin auto-incrementing roots.\nDefaults to \\`0\\`.\n`,\n type: 'integer',\n },\n checkConstructors: {\n default: true,\n description: `A value indicating whether \\`constructor\\`s should be checked. Defaults to\n\\`true\\`.\n`,\n type: 'boolean',\n },\n checkDestructured: {\n default: true,\n description: 'Whether to require destructured properties. Defaults to `true`.',\n type: 'boolean',\n },\n checkDestructuredRoots: {\n default: true,\n description: `Whether to check the existence of a corresponding \\`@param\\` for root objects\nof destructured properties (e.g., that for \\`function ({a, b}) {}\\`, that there\nis something like \\`@param myRootObj\\` defined that can correspond to\nthe \\`{a, b}\\` object parameter).\n\nIf \\`checkDestructuredRoots\\` is \\`false\\`, \\`checkDestructured\\` will also be\nimplied to be \\`false\\` (i.e., the inside of the roots will not be checked\neither, e.g., it will also not complain if \\`a\\` or \\`b\\` do not have their own\ndocumentation). Defaults to \\`true\\`.\n`,\n type: 'boolean',\n },\n checkGetters: {\n default: false,\n description: 'A value indicating whether getters should be checked. Defaults to `false`.',\n type: 'boolean',\n },\n checkRestProperty: {\n default: false,\n description: `If set to \\`true\\`, will report (and add fixer insertions) for missing rest\nproperties. Defaults to \\`false\\`.\n\nIf set to \\`true\\`, note that you can still document the subproperties of the\nrest property using other jsdoc features, e.g., \\`@typedef\\`:\n\n\\`\\`\\`js\n/**\n * @typedef ExtraOptions\n * @property innerProp1\n * @property innerProp2\n */\n\n/**\n * @param cfg\n * @param cfg.num\n * @param {ExtraOptions} extra\n */\nfunction quux ({num, ...extra}) {\n}\n\\`\\`\\`\n\nSetting this option to \\`false\\` (the default) may be useful in cases where\nyou already have separate \\`@param\\` definitions for each of the properties\nwithin the rest property.\n\nFor example, with the option disabled, this will not give an error despite\n\\`extra\\` not having any definition:\n\n\\`\\`\\`js\n/**\n * @param cfg\n * @param cfg.num\n */\nfunction quux ({num, ...extra}) {\n}\n\\`\\`\\`\n\nNor will this:\n\n\\`\\`\\`js\n/**\n * @param cfg\n * @param cfg.num\n * @param cfg.innerProp1\n * @param cfg.innerProp2\n */\nfunction quux ({num, ...extra}) {\n}\n\\`\\`\\`\n`,\n type: 'boolean',\n },\n checkSetters: {\n default: false,\n description: 'A value indicating whether setters should be checked. Defaults to `false`.',\n type: 'boolean',\n },\n checkTypesPattern: {\n description: `When one specifies a type, unless it is of a generic type, like \\`object\\`\nor \\`array\\`, it may be considered unnecessary to have that object's\ndestructured components required, especially where generated docs will\nlink back to the specified type. For example:\n\n\\`\\`\\`js\n/**\n * @param {SVGRect} bbox - a SVGRect\n */\nexport const bboxToObj = function ({x, y, width, height}) {\n return {x, y, width, height};\n};\n\\`\\`\\`\n\nBy default \\`checkTypesPattern\\` is set to\n\\`/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/v\\`,\nmeaning that destructuring will be required only if the type of the \\`@param\\`\n(the text between curly brackets) is a match for \"Object\" or \"Array\" (with or\nwithout initial caps), \"PlainObject\", or \"GenericObject\", \"GenericArray\" (or\nif no type is present). So in the above example, the lack of a match will\nmean that no complaint will be given about the undocumented destructured\nparameters.\n\nNote that the \\`/\\` delimiters are optional, but necessary to add flags.\n\nDefaults to using (only) the \\`v\\` flag, so to add your own flags, encapsulate\nyour expression as a string, but like a literal, e.g., \\`/^object$/vi\\`.\n\nYou could set this regular expression to a more expansive list, or you\ncould restrict it such that even types matching those strings would not\nneed destructuring.`,\n type: 'string',\n },\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\n\\`context\\` defaults to \\`any\\` and \\`comment\\` defaults to no specific comment context.\n\nOverrides the default contexts (\\`ArrowFunctionExpression\\`, \\`FunctionDeclaration\\`,\n\\`FunctionExpression\\`). May be useful for adding such as\n\\`TSMethodSignature\\` in TypeScript or restricting the contexts\nwhich are checked.\n\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.\n`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `true`.',\n type: 'boolean',\n },\n enableRestElementFixer: {\n description: `Whether to enable the rest element fixer.\n\nThe fixer will automatically report/insert\n[JSDoc repeatable parameters](https://jsdoc.app/tags-param.html#multiple-types-and-repeatable-parameters)\nif missing.\n\n\\`\\`\\`js\n/**\n * @param {GenericArray} cfg\n * @param {number} cfg.\"0\"\n */\nfunction baar ([a, ...extra]) {\n //\n}\n\\`\\`\\`\n\n...becomes:\n\n\\`\\`\\`js\n/**\n * @param {GenericArray} cfg\n * @param {number} cfg.\"0\"\n * @param {...any} cfg.\"1\"\n */\nfunction baar ([a, ...extra]) {\n //\n}\n\\`\\`\\`\n\nNote that the type \\`any\\` is included since we don't know of any specific\ntype to use.\n\nDefaults to \\`true\\`.\n`,\n type: 'boolean',\n },\n enableRootFixer: {\n description: `Whether to enable the auto-adding of incrementing roots.\n\nThe default behavior of \\`true\\` is for \"root\" to be auto-inserted for missing\nroots, followed by a 0-based auto-incrementing number.\n\nSo for:\n\n\\`\\`\\`js\nfunction quux ({foo}, {bar}, {baz}) {\n}\n\\`\\`\\`\n\n...the default JSDoc that would be added if the fixer is enabled would be:\n\n\\`\\`\\`js\n/**\n* @param root0\n* @param root0.foo\n* @param root1\n* @param root1.bar\n* @param root2\n* @param root2.baz\n*/\n\\`\\`\\`\n\nHas no effect if \\`enableFixer\\` is set to \\`false\\`.`,\n type: 'boolean',\n },\n exemptedBy: {\n description: `Array of tags (e.g., \\`['type']\\`) whose presence on the document block\navoids the need for a \\`@param\\`. Defaults to an array with\n\\`inheritdoc\\`. If you set this array, it will overwrite the default,\nso be sure to add back \\`inheritdoc\\` if you wish its presence to cause\nexemption of the rule.`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n ignoreWhenAllParamsMissing: {\n description: `Set to \\`true\\` to ignore reporting when all params are missing. Defaults to\n\\`false\\`.`,\n type: 'boolean',\n },\n interfaceExemptsParamsCheck: {\n description: `Set if you wish TypeScript interfaces to exempt checks for the existence of\n\\`@param\\`'s.\n\nWill check for a type defining the function itself (on a variable\ndeclaration) or if there is a single destructured object with a type.\nDefaults to \\`false\\`.`,\n type: 'boolean',\n },\n unnamedRootBase: {\n description: `An array of root names to use in the fixer when roots are missing. Defaults\nto \\`['root']\\`. Note that only when all items in the array besides the last\nare exhausted will auto-incrementing occur. So, with\n\\`unnamedRootBase: ['arg', 'config']\\`, the following:\n\n\\`\\`\\`js\nfunction quux ({foo}, [bar], {baz}) {\n}\n\\`\\`\\`\n\n...will get the following JSDoc block added:\n\n\\`\\`\\`js\n/**\n* @param arg\n* @param arg.foo\n* @param config0\n* @param config0.\"0\" (\\`bar\\`)\n* @param config1\n* @param config1.baz\n*/\n\\`\\`\\``,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n useDefaultObjectProperties: {\n description: `Set to \\`true\\` if you wish to expect documentation of properties on objects\nsupplied as default values. Defaults to \\`false\\`.`,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n\n // We cannot cache comment nodes as the contexts may recur with the\n // same comment node but a different JS node, and we may need the different\n // JS node to ensure we iterate its context\n noTracking: true,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMG,SAAS,GAAGA,CAACC,YAAY,EAAEC,YAAY,KAAK;EAChD;EACA,IAAIC,IAAI;EACR,IAAIC,GAAG,GAAGF,YAAY;EACtB,MAAMG,WAAW,GAAGJ,YAAY,CAACK,MAAM,IAAI,CAAC;EAC5C,IAAID,WAAW,EAAE;IACf,MAAME,IAAI,GAAGN,YAAY,CAAC,CAAC,CAAC;IAC5B,MAAMO,MAAM,GAAGJ,GAAG,EAAE;IACpBD,IAAI,GAAG,GAAGI,IAAI,GAAGC,MAAM,EAAE;EAC3B,CAAC,MAAM;IACLL,IAAI,GAAG,qBAAuBF,YAAY,CAACQ,KAAK,CAAC,CAAE;EACrD;EAEA,OAAO,CACLN,IAAI,EACJE,WAAW,EACX,MAAM;IACJ,OAAOL,SAAS,CAACC,YAAY,EAAEG,GAAG,CAAC;EACrC,CAAC,CACF;AACH,CAAC;;AAED;AAAA,IAAAM,QAAA,GAAAC,OAAA,CAAAZ,OAAA,GACe,IAAAa,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK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AAE,CAAC;UACVmH,WAAW,EAAE;AACzB;AACA,CAAC;UACWjF,IAAI,EAAE;QACR,CAAC;QACD4G,iBAAiB,EAAE;UACjB9I,OAAO,EAAE,IAAI;UACbmH,WAAW,EAAE;AACzB;AACA,CAAC;UACWjF,IAAI,EAAE;QACR,CAAC;QACDb,iBAAiB,EAAE;UACjBrB,OAAO,EAAE,IAAI;UACbmH,WAAW,EAAE,iEAAiE;UAC9EjF,IAAI,EAAE;QACR,CAAC;QACDZ,sBAAsB,EAAE;UACtBtB,OAAO,EAAE,IAAI;UACbmH,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;UACWjF,IAAI,EAAE;QACR,CAAC;QACD6G,YAAY,EAAE;UACZ/I,OAAO,EAAE,KAAK;UACdmH,WAAW,EAAE,4EAA4E;UACzFjF,IAAI,EAAE;QACR,CAAC;QACDX,iBAAiB,EAAE;UACjBvB,OAAO,EAAE,KAAK;UACdmH,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;UACWjF,IAAI,EAAE;QACR,CAAC;QACD8G,YAAY,EAAE;UACZhJ,OAAO,EAAE,KAAK;UACdmH,WAAW,EAAE,4EAA4E;UACzFjF,IAAI,EAAE;QACR,CAAC;QACDV,iBAAiB,EAAE;UACjB2F,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;UACRjF,IAAI,EAAE;QACR,CAAC;QACD+G,QAAQ,EAAE;UACR9B,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;UACW+B,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEjH,IAAI,EAAE;YACR,CAAC,EACD;cACE0G,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVO,OAAO,EAAE;kBACPlH,IAAI,EAAE;gBACR,CAAC;gBACDpB,OAAO,EAAE;kBACPoB,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDT,WAAW,EAAE;UACX0F,WAAW,EAAE,kDAAkD;UAC/DjF,IAAI,EAAE;QACR,CAAC;QACDR,sBAAsB,EAAE;UACtByF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;UACWjF,IAAI,EAAE;QACR,CAAC;QACDP,eAAe,EAAE;UACfwF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;UAC1CjF,IAAI,EAAE;QACR,CAAC;QACDmH,UAAU,EAAE;UACVlC,WAAW,EAAE;AACzB;AACA;AACA;AACA,uBAAuB;UACX+B,KAAK,EAAE;YACLhH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDN,0BAA0B,EAAE;UAC1BuF,WAAW,EAAE;AACzB,WAAW;UACCjF,IAAI,EAAE;QACR,CAAC;QACDL,2BAA2B,EAAE;UAC3BsF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA,uBAAuB;UACXjF,IAAI,EAAE;QACR,CAAC;QACDJ,eAAe,EAAE;UACfqF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;UACK+B,KAAK,EAAE;YACLhH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDH,0BAA0B,EAAE;UAC1BoF,WAAW,EAAE;AACzB,mDAAmD;UACvCjF,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR,CAAC;EAED;EACA;EACA;EACAoH,UAAU,EAAE;AACd,CAAC,CAAC;AAAAC,MAAA,CAAA3I,OAAA,GAAAA,OAAA,CAAAZ,OAAA","ignoreList":[]}
@@ -50,6 +50,20 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
50
50
  additionalProperties: false,
51
51
  properties: {
52
52
  contexts: {
53
+ description: `Set this to an array of strings representing the AST context (or an object with
54
+ optional \`context\` and \`comment\` properties) where you wish the rule to be applied.
55
+
56
+ \`context\` defaults to \`any\` and \`comment\` defaults to no specific comment context.
57
+
58
+ Overrides the default contexts (\`ArrowFunctionExpression\`, \`FunctionDeclaration\`,
59
+ \`FunctionExpression\`). Set to \`"any"\` if you want
60
+ the rule to apply to any JSDoc block throughout your files (as is necessary
61
+ for finding function blocks not attached to a function declaration or
62
+ expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
63
+ \`@method\`) (including those associated with an \`@interface\`).
64
+
65
+ See the ["AST and Selectors"](../#advanced-ast-and-selectors)
66
+ section of our Advanced docs for more on the expected format.`,
53
67
  items: {
54
68
  anyOf: [{
55
69
  type: 'string'
@@ -69,9 +83,16 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
69
83
  type: 'array'
70
84
  },
71
85
  defaultDestructuredRootDescription: {
86
+ description: `The description string to set by default for destructured roots. Defaults to
87
+ "The root object".`,
72
88
  type: 'string'
73
89
  },
74
90
  setDefaultDestructuredRootDescription: {
91
+ description: `Whether to set a default destructured root description. For example, you may
92
+ wish to avoid manually having to set the description for a \`@param\`
93
+ corresponding to a destructured root object as it should always be the same
94
+ type of object. Uses \`defaultDestructuredRootDescription\` for the description
95
+ string. Defaults to \`false\`.`,
75
96
  type: 'boolean'
76
97
  }
77
98
  },
@@ -1 +1 @@
1
- {"version":3,"file":"requireParamDescription.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","report","settings","utils","defaultDestructuredRootDescription","setDefaultDestructuredRootDescription","options","functionParameterNames","getFunctionParameterNames","rootCount","forEachPreferredTag","jsdocParameter","targetTagName","name","includes","description","trim","Array","isArray","exemptDestructuredRootsFromChecks","reportJSDoc","changeTag","postName","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","type","comment","module"],"sources":["../../src/rules/requireParamDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n report,\n settings,\n utils,\n}) => {\n const {\n defaultDestructuredRootDescription = 'The root object',\n setDefaultDestructuredRootDescription = false,\n } = context.options[0] || {};\n\n const functionParameterNames = utils.getFunctionParameterNames();\n\n let rootCount = -1;\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n rootCount += jsdocParameter.name.includes('.') ? 0 : 1;\n if (!jsdocParameter.description.trim()) {\n if (Array.isArray(functionParameterNames[rootCount])) {\n if (settings.exemptDestructuredRootsFromChecks) {\n return;\n }\n\n if (setDefaultDestructuredRootDescription) {\n utils.reportJSDoc(`Missing root description for @${targetTagName}.`, jsdocParameter, () => {\n utils.changeTag(jsdocParameter, {\n description: defaultDestructuredRootDescription,\n postName: ' ',\n });\n });\n return;\n }\n }\n\n report(\n `Missing JSDoc @${targetTagName} \"${jsdocParameter.name}\" description.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that each `@param` tag has a `description` value.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-description.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n defaultDestructuredRootDescription: {\n type: 'string',\n },\n setDefaultDestructuredRootDescription: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,MAAM;EACNC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,kCAAkC,GAAG,iBAAiB;IACtDC,qCAAqC,GAAG;EAC1C,CAAC,GAAGL,OAAO,CAACM,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAMC,sBAAsB,GAAGJ,KAAK,CAACK,yBAAyB,CAAC,CAAC;EAEhE,IAAIC,SAAS,GAAG,CAAC,CAAC;EAClBN,KAAK,CAACO,mBAAmB,CAAC,OAAO,EAAE,CAACC,cAAc,EAAEC,aAAa,KAAK;IACpEH,SAAS,IAAIE,cAAc,CAACE,IAAI,CAACC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;IACtD,IAAI,CAACH,cAAc,CAACI,WAAW,CAACC,IAAI,CAAC,CAAC,EAAE;MACtC,IAAIC,KAAK,CA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C,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"requireParamDescription.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","report","settings","utils","defaultDestructuredRootDescription","setDefaultDestructuredRootDescription","options","functionParameterNames","getFunctionParameterNames","rootCount","forEachPreferredTag","jsdocParameter","targetTagName","name","includes","description","trim","Array","isArray","exemptDestructuredRootsFromChecks","reportJSDoc","changeTag","postName","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","type","comment","module"],"sources":["../../src/rules/requireParamDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n report,\n settings,\n utils,\n}) => {\n const {\n defaultDestructuredRootDescription = 'The root object',\n setDefaultDestructuredRootDescription = false,\n } = context.options[0] || {};\n\n const functionParameterNames = utils.getFunctionParameterNames();\n\n let rootCount = -1;\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n rootCount += jsdocParameter.name.includes('.') ? 0 : 1;\n if (!jsdocParameter.description.trim()) {\n if (Array.isArray(functionParameterNames[rootCount])) {\n if (settings.exemptDestructuredRootsFromChecks) {\n return;\n }\n\n if (setDefaultDestructuredRootDescription) {\n utils.reportJSDoc(`Missing root description for @${targetTagName}.`, jsdocParameter, () => {\n utils.changeTag(jsdocParameter, {\n description: defaultDestructuredRootDescription,\n postName: ' ',\n });\n });\n return;\n }\n }\n\n report(\n `Missing JSDoc @${targetTagName} \"${jsdocParameter.name}\" description.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that each `@param` tag has a `description` value.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-description.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\n\\`context\\` defaults to \\`any\\` and \\`comment\\` defaults to no specific comment context.\n\nOverrides the default contexts (\\`ArrowFunctionExpression\\`, \\`FunctionDeclaration\\`,\n\\`FunctionExpression\\`). Set to \\`\"any\"\\` if you want\nthe rule to apply to any JSDoc block throughout your files (as is necessary\nfor finding function blocks not attached to a function declaration or\nexpression, i.e., \\`@callback\\` or \\`@function\\` (or its aliases \\`@func\\` or\n\\`@method\\`) (including those associated with an \\`@interface\\`).\n\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n defaultDestructuredRootDescription: {\n description: `The description string to set by default for destructured roots. Defaults to\n\"The root object\".`,\n type: 'string',\n },\n setDefaultDestructuredRootDescription: {\n description: `Whether to set a default destructured root description. For example, you may\nwish to avoid manually having to set the description for a \\`@param\\`\ncorresponding to a destructured root object as it should always be the same\ntype of object. Uses \\`defaultDestructuredRootDescription\\` for the description\nstring. Defaults to \\`false\\`.`,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,MAAM;EACNC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,kCAAkC,GAAG,iBAAiB;IACtDC,qCAAqC,GAAG;EAC1C,CAAC,GAAGL,O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D;UAClDiB,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEC,IAAI,EAAE;YACR,CAAC,EACD;cACEL,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVK,OAAO,EAAE;kBACPD,IAAI,EAAE;gBACR,CAAC;gBACDlC,OAAO,EAAE;kBACPkC,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACD9B,kCAAkC,EAAE;UAClCW,WAAW,EAAE;AACzB,mBAAmB;UACPmB,IAAI,EAAE;QACR,CAAC;QACD7B,qCAAqC,EAAE;UACrCU,WAAW,EAAE;AACzB;AACA;AACA;AACA,+BAA+B;UACnBmB,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAE,MAAA,CAAAtC,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
@@ -19,13 +19,28 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
19
19
  contextDefaults: true,
20
20
  meta: {
21
21
  docs: {
22
- description: 'Requires that all function parameters have names.',
22
+ description: 'Requires that all `@param` tags have names.',
23
23
  url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-name.md#repos-sticky-header'
24
24
  },
25
25
  schema: [{
26
26
  additionalProperties: false,
27
27
  properties: {
28
28
  contexts: {
29
+ description: `Set this to an array of strings representing the AST context (or an object with
30
+ optional \`context\` and \`comment\` properties) where you wish the rule to be applied.
31
+
32
+ \`context\` defaults to \`any\` and \`comment\` defaults to no specific comment context.
33
+
34
+ Overrides the default contexts (\`ArrowFunctionExpression\`, \`FunctionDeclaration\`,
35
+ \`FunctionExpression\`). Set to \`"any"\` if you want
36
+ the rule to apply to any JSDoc block throughout your files (as is necessary
37
+ for finding function blocks not attached to a function declaration or
38
+ expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
39
+ \`@method\`) (including those associated with an \`@interface\`).
40
+
41
+ See the ["AST and Selectors"](../#advanced-ast-and-selectors)
42
+ section of our Advanced docs for more on the expected format.
43
+ `,
29
44
  items: {
30
45
  anyOf: [{
31
46
  type: 'string'
@@ -1 +1 @@
1
- {"version":3,"file":"requireParamName.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","report","utils","forEachPreferredTag","jsdocParameter","targetTagName","tag","name","type","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","module"],"sources":["../../src/rules/requireParamName.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n if (jsdocParameter.tag && jsdocParameter.name === '') {\n report(\n `There must be an identifier after @${targetTagName} ${jsdocParameter.type === '' ? 'type' : 'tag'}.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all function parameters have names.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-name.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,MAAM;EACNC;AACF,CAAC,KAAK;EACJA,KAAK,CAACC,mBAAmB,CAAC,OAAO,EAAE,CAACC,cAAc,EAAEC,aAAa,KAAK;IACpE,IAAID,cAAc,CAACE,GAAG,IAAIF,cAAc,CAACG,IAAI,KAAK,EAAE,EAAE;MACpDN,MAAM,CACJ,sCAAsCI,aAAa,IAAID,cAAc,CAACI,IAAI,KAAK,EAAE,GAAG,MAAM,GAAG,KAAK,GAAG,EACrG,IAAI,EACJJ,cACF,CAAC;IACH;EACF,CAAC,CAAC;AACJ,CAAC,EAAE;EACDK,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,mDAAmD;MAChEC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,QAAQ,EAAE;UACRC,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEX,IAAI,EAAE;YACR,CAAC,EACD;cACEO,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVI,OAAO,EAAE;kBACPZ,IAAI,EAAE;gBACR,CAAC;gBACDa,OAAO,EAAE;kBACPb,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAc,MAAA,CAAAvB,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"requireParamName.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","report","utils","forEachPreferredTag","jsdocParameter","targetTagName","tag","name","type","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","module"],"sources":["../../src/rules/requireParamName.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n if (jsdocParameter.tag && jsdocParameter.name === '') {\n report(\n `There must be an identifier after @${targetTagName} ${jsdocParameter.type === '' ? 'type' : 'tag'}.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all `@param` tags have names.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-name.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\n\\`context\\` defaults to \\`any\\` and \\`comment\\` defaults to no specific comment context.\n\nOverrides the default contexts (\\`ArrowFunctionExpression\\`, \\`FunctionDeclaration\\`,\n\\`FunctionExpression\\`). Set to \\`\"any\"\\` if you want\nthe rule to apply to any JSDoc block throughout your files (as is necessary\nfor finding function blocks not attached to a function declaration or\nexpression, i.e., \\`@callback\\` or \\`@function\\` (or its aliases \\`@func\\` or\n\\`@method\\`) (including those associated with an \\`@interface\\`).\n\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.\n`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,MAAM;EACNC;AACF,CAAC,KAAK;EACJA,KAAK,CAACC,mBAAmB,CAAC,OAAO,EAAE,CAACC,cAAc,EAAEC,aAAa,KAAK;IACpE,IAAID,cAAc,CAACE,GAAG,IAAIF,cAAc,CAACG,IAAI,KAAK,EAAE,EAAE;MACpDN,MAAM,CACJ,sCAAsCI,aAAa,IAAID,cAAc,CAACI,IAAI,KAAK,EAAE,GAAG,MAAM,GAAG,KAAK,GAAG,EACrG,IAAI,EACJJ,cACF,CAAC;IACH;EACF,CAAC,CAAC;AACJ,CAAC,EAAE;EACDK,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,6CAA6C;MAC1DC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,QAAQ,EAAE;UACRL,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;UACWM,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEX,IAAI,EAAE;YACR,CAAC,EACD;cACEO,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVI,OAAO,EAAE;kBACPZ,IAAI,EAAE;gBACR,CAAC;gBACDa,OAAO,EAAE;kBACPb,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAc,MAAA,CAAAvB,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
@@ -42,7 +42,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
42
42
  contextDefaults: true,
43
43
  meta: {
44
44
  docs: {
45
- description: 'Requires that each `@param` tag has a `type` value.',
45
+ description: 'Requires that each `@param` tag has a type value (in curly brackets).',
46
46
  url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-type.md#repos-sticky-header'
47
47
  },
48
48
  fixable: 'code',
@@ -50,6 +50,20 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
50
50
  additionalProperties: false,
51
51
  properties: {
52
52
  contexts: {
53
+ description: `Set this to an array of strings representing the AST context (or an object with
54
+ optional \`context\` and \`comment\` properties) where you wish the rule to be applied.
55
+
56
+ \`context\` defaults to \`any\` and \`comment\` defaults to no specific comment context.
57
+
58
+ Overrides the default contexts (\`ArrowFunctionExpression\`, \`FunctionDeclaration\`,
59
+ \`FunctionExpression\`). Set to \`"any"\` if you want
60
+ the rule to apply to any JSDoc block throughout your files (as is necessary
61
+ for finding function blocks not attached to a function declaration or
62
+ expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
63
+ \`@method\`) (including those associated with an \`@interface\`).
64
+
65
+ See the ["AST and Selectors"](../#advanced-ast-and-selectors)
66
+ section of our Advanced docs for more on the expected format.`,
53
67
  items: {
54
68
  anyOf: [{
55
69
  type: 'string'
@@ -69,9 +83,15 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
69
83
  type: 'array'
70
84
  },
71
85
  defaultDestructuredRootType: {
86
+ description: 'The type string to set by default for destructured roots. Defaults to "object".',
72
87
  type: 'string'
73
88
  },
74
89
  setDefaultDestructuredRootType: {
90
+ description: `Whether to set a default destructured root type. For example, you may wish
91
+ to avoid manually having to set the type for a \`@param\`
92
+ corresponding to a destructured root object as it is always going to be an
93
+ object. Uses \`defaultDestructuredRootType\` for the type string. Defaults to
94
+ \`false\`.`,
75
95
  type: 'boolean'
76
96
  }
77
97
  },