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