@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,562 @@
1
+ import iterateJsdoc from '../iterateJsdoc.js';
2
+
3
+ /**
4
+ * @param {import('@es-joy/jsdoccomment').JsdocBlockWithInline} jsdoc
5
+ * @param {import('../iterateJsdoc.js').Utils} utils
6
+ * @param {number} requireSingleLineUnderCount
7
+ */
8
+ const checkForShortTags = (jsdoc, utils, requireSingleLineUnderCount) => {
9
+ if (!requireSingleLineUnderCount || !jsdoc.tags.length) {
10
+ return false;
11
+ }
12
+
13
+ let lastLineWithTag = 0;
14
+ let isUnderCountLimit = false;
15
+ let hasMultiDescOrType = false;
16
+ const tagLines = jsdoc.source.reduce((acc, {
17
+ tokens: {
18
+ delimiter,
19
+ description: desc,
20
+ name,
21
+ postDelimiter,
22
+ postName,
23
+ postTag,
24
+ postType,
25
+ start,
26
+ tag,
27
+ type,
28
+ },
29
+ }, idx) => {
30
+ if (tag.length) {
31
+ lastLineWithTag = idx;
32
+ if (
33
+ start.length + delimiter.length + postDelimiter.length +
34
+ type.length + postType.length + name.length + postName.length +
35
+ tag.length + postTag.length + desc.length <
36
+ requireSingleLineUnderCount
37
+ ) {
38
+ isUnderCountLimit = true;
39
+ }
40
+
41
+ return acc + 1;
42
+ } else if (desc.length || type.length) {
43
+ hasMultiDescOrType = true;
44
+ return acc;
45
+ }
46
+
47
+ return acc;
48
+ }, 0);
49
+ // Could be tagLines > 1
50
+ if (!hasMultiDescOrType && isUnderCountLimit && tagLines === 1) {
51
+ const fixer = () => {
52
+ const tokens = jsdoc.source[lastLineWithTag].tokens;
53
+ jsdoc.source = [
54
+ {
55
+ number: 0,
56
+ source: '',
57
+ tokens: utils.seedTokens({
58
+ delimiter: '/**',
59
+ description: tokens.description.trimEnd() + ' ',
60
+ end: '*/',
61
+ name: tokens.name,
62
+ postDelimiter: ' ',
63
+ postName: tokens.postName,
64
+ postTag: tokens.postTag,
65
+ postType: tokens.postType,
66
+ start: jsdoc.source[0].tokens.start,
67
+ tag: tokens.tag,
68
+ type: tokens.type,
69
+ }),
70
+ },
71
+ ];
72
+ };
73
+
74
+ utils.reportJSDoc(
75
+ 'Description is too short to be multi-line.',
76
+ null,
77
+ fixer,
78
+ );
79
+ return true;
80
+ }
81
+
82
+ return false;
83
+ };
84
+
85
+ /**
86
+ * @param {import('@es-joy/jsdoccomment').JsdocBlockWithInline} jsdoc
87
+ * @param {import('../iterateJsdoc.js').Utils} utils
88
+ * @param {number} requireSingleLineUnderCount
89
+ */
90
+ const checkForShortDescriptions = (jsdoc, utils, requireSingleLineUnderCount) => {
91
+ if (!requireSingleLineUnderCount || jsdoc.tags.length) {
92
+ return false;
93
+ }
94
+
95
+ let lastLineWithDesc = 0;
96
+ let isUnderCountLimit = false;
97
+ const descLines = jsdoc.source.reduce((acc, {
98
+ tokens: {
99
+ delimiter,
100
+ description: desc,
101
+ postDelimiter,
102
+ start,
103
+ },
104
+ }, idx) => {
105
+ if (desc.length) {
106
+ lastLineWithDesc = idx;
107
+ if (
108
+ start.length + delimiter.length + postDelimiter.length + desc.length <
109
+ requireSingleLineUnderCount
110
+ ) {
111
+ isUnderCountLimit = true;
112
+ }
113
+
114
+ return acc + 1;
115
+ }
116
+
117
+ return acc;
118
+ }, 0);
119
+ // Could be descLines > 1
120
+ if (isUnderCountLimit && descLines === 1) {
121
+ const fixer = () => {
122
+ const desc = jsdoc.source[lastLineWithDesc].tokens.description;
123
+ jsdoc.source = [
124
+ {
125
+ number: 0,
126
+ source: '',
127
+ tokens: utils.seedTokens({
128
+ delimiter: '/**',
129
+ description: desc.trimEnd() + ' ',
130
+ end: '*/',
131
+ postDelimiter: ' ',
132
+ start: jsdoc.source[0].tokens.start,
133
+ }),
134
+ },
135
+ ];
136
+ };
137
+
138
+ utils.reportJSDoc(
139
+ 'Description is too short to be multi-line.',
140
+ null,
141
+ fixer,
142
+ );
143
+ return true;
144
+ }
145
+
146
+ return false;
147
+ };
148
+
149
+ export default iterateJsdoc(({
150
+ context,
151
+ jsdoc,
152
+ utils,
153
+ }) => {
154
+ const {
155
+ allowMultipleTags = true,
156
+ minimumLengthForMultiline = Number.POSITIVE_INFINITY,
157
+ multilineTags = [
158
+ '*',
159
+ ],
160
+ noFinalLineText = true,
161
+ noMultilineBlocks = false,
162
+ noSingleLineBlocks = false,
163
+ noZeroLineText = true,
164
+ requireSingleLineUnderCount = null,
165
+ singleLineTags = [
166
+ 'lends', 'type',
167
+ ],
168
+ } = context.options[0] || {};
169
+
170
+ const {
171
+ source: [
172
+ {
173
+ tokens,
174
+ },
175
+ ],
176
+ } = jsdoc;
177
+ const {
178
+ description,
179
+ tag,
180
+ } = tokens;
181
+ const sourceLength = jsdoc.source.length;
182
+
183
+ /**
184
+ * @param {string} tagName
185
+ * @returns {boolean}
186
+ */
187
+ const isInvalidSingleLine = (tagName) => {
188
+ return noSingleLineBlocks &&
189
+ (!tagName ||
190
+ !singleLineTags.includes(tagName) && !singleLineTags.includes('*'));
191
+ };
192
+
193
+ if (sourceLength === 1) {
194
+ if (!isInvalidSingleLine(tag.slice(1))) {
195
+ return;
196
+ }
197
+
198
+ const fixer = () => {
199
+ utils.makeMultiline();
200
+ };
201
+
202
+ utils.reportJSDoc(
203
+ 'Single line blocks are not permitted by your configuration.',
204
+ null,
205
+ fixer,
206
+ true,
207
+ );
208
+
209
+ return;
210
+ }
211
+
212
+ if (checkForShortDescriptions(jsdoc, utils, requireSingleLineUnderCount)
213
+ ) {
214
+ return;
215
+ }
216
+
217
+ if (checkForShortTags(jsdoc, utils, requireSingleLineUnderCount)
218
+ ) {
219
+ return;
220
+ }
221
+
222
+ const lineChecks = () => {
223
+ if (
224
+ noZeroLineText &&
225
+ (tag || description)
226
+ ) {
227
+ const fixer = () => {
228
+ const line = {
229
+ ...tokens,
230
+ };
231
+ utils.emptyTokens(tokens);
232
+ const {
233
+ tokens: {
234
+ delimiter,
235
+ start,
236
+ },
237
+ } = jsdoc.source[1];
238
+ utils.addLine(1, {
239
+ ...line,
240
+ delimiter,
241
+ start,
242
+ });
243
+ };
244
+
245
+ utils.reportJSDoc(
246
+ 'Should have no text on the "0th" line (after the `/**`).',
247
+ null,
248
+ fixer,
249
+ );
250
+
251
+ return;
252
+ }
253
+
254
+ const finalLine = jsdoc.source[jsdoc.source.length - 1];
255
+ const finalLineTokens = finalLine.tokens;
256
+ if (
257
+ noFinalLineText &&
258
+ finalLineTokens.description.trim()
259
+ ) {
260
+ const fixer = () => {
261
+ const line = {
262
+ ...finalLineTokens,
263
+ };
264
+ line.description = line.description.trimEnd();
265
+
266
+ const {
267
+ delimiter,
268
+ } = line;
269
+
270
+ for (const prop of [
271
+ 'delimiter',
272
+ 'postDelimiter',
273
+ 'tag',
274
+ 'type',
275
+ 'lineEnd',
276
+ 'postType',
277
+ 'postTag',
278
+ 'name',
279
+ 'postName',
280
+ 'description',
281
+ ]) {
282
+ finalLineTokens[
283
+ /**
284
+ * @type {"delimiter"|"postDelimiter"|"tag"|"type"|
285
+ * "lineEnd"|"postType"|"postTag"|"name"|
286
+ * "postName"|"description"}
287
+ */ (
288
+ prop
289
+ )
290
+ ] = '';
291
+ }
292
+
293
+ utils.addLine(jsdoc.source.length - 1, {
294
+ ...line,
295
+ delimiter,
296
+ end: '',
297
+ });
298
+ };
299
+
300
+ utils.reportJSDoc(
301
+ 'Should have no text on the final line (before the `*/`).',
302
+ null,
303
+ fixer,
304
+ );
305
+ }
306
+ };
307
+
308
+ if (noMultilineBlocks) {
309
+ if (
310
+ jsdoc.tags.length &&
311
+ (multilineTags.includes('*') || utils.hasATag(multilineTags))
312
+ ) {
313
+ lineChecks();
314
+
315
+ return;
316
+ }
317
+
318
+ if (jsdoc.description.length >= minimumLengthForMultiline) {
319
+ lineChecks();
320
+
321
+ return;
322
+ }
323
+
324
+ if (
325
+ noSingleLineBlocks &&
326
+ (!jsdoc.tags.length ||
327
+ !utils.filterTags(({
328
+ tag: tg,
329
+ }) => {
330
+ return !isInvalidSingleLine(tg);
331
+ }).length)
332
+ ) {
333
+ utils.reportJSDoc(
334
+ 'Multiline JSDoc blocks are prohibited by ' +
335
+ 'your configuration but fixing would result in a single ' +
336
+ 'line block which you have prohibited with `noSingleLineBlocks`.',
337
+ );
338
+
339
+ return;
340
+ }
341
+
342
+ if (jsdoc.tags.length > 1) {
343
+ if (!allowMultipleTags) {
344
+ utils.reportJSDoc(
345
+ 'Multiline JSDoc blocks are prohibited by ' +
346
+ 'your configuration but the block has multiple tags.',
347
+ );
348
+
349
+ return;
350
+ }
351
+ } else if (jsdoc.tags.length === 1 && jsdoc.description.trim()) {
352
+ if (!allowMultipleTags) {
353
+ utils.reportJSDoc(
354
+ 'Multiline JSDoc blocks are prohibited by ' +
355
+ 'your configuration but the block has a description with a tag.',
356
+ );
357
+
358
+ return;
359
+ }
360
+ } else {
361
+ const fixer = () => {
362
+ jsdoc.source = [
363
+ {
364
+ number: 1,
365
+ source: '',
366
+ tokens: jsdoc.source.reduce((obj, {
367
+ tokens: {
368
+ description: desc,
369
+ lineEnd,
370
+ name: nme,
371
+ postName,
372
+ postTag,
373
+ postType,
374
+ tag: tg,
375
+ type: typ,
376
+ },
377
+ }) => {
378
+ if (typ) {
379
+ obj.type = typ;
380
+ }
381
+
382
+ if (tg && typ && nme) {
383
+ obj.postType = postType;
384
+ }
385
+
386
+ if (nme) {
387
+ obj.name += nme;
388
+ }
389
+
390
+ if (nme && desc) {
391
+ obj.postName = postName;
392
+ }
393
+
394
+ obj.description += desc;
395
+
396
+ const nameOrDescription = obj.description || obj.name;
397
+ if (
398
+ nameOrDescription && nameOrDescription.slice(-1) !== ' '
399
+ ) {
400
+ obj.description += ' ';
401
+ }
402
+
403
+ obj.lineEnd = lineEnd;
404
+
405
+ // Already filtered for multiple tags
406
+ obj.tag += tg;
407
+ if (tg) {
408
+ obj.postTag = postTag || ' ';
409
+ }
410
+
411
+ return obj;
412
+ }, utils.seedTokens({
413
+ delimiter: '/**',
414
+ end: '*/',
415
+ postDelimiter: ' ',
416
+ })),
417
+ },
418
+ ];
419
+ };
420
+
421
+ utils.reportJSDoc(
422
+ 'Multiline JSDoc blocks are prohibited by ' +
423
+ 'your configuration.',
424
+ null,
425
+ fixer,
426
+ );
427
+
428
+ return;
429
+ }
430
+ }
431
+
432
+ lineChecks();
433
+ }, {
434
+ iterateAllJsdocs: true,
435
+ meta: {
436
+ docs: {
437
+ description: 'Controls how and whether JSDoc blocks can be expressed as single or multiple line blocks.',
438
+ url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/multiline-blocks.md#repos-sticky-header',
439
+ },
440
+ fixable: 'code',
441
+ schema: [
442
+ {
443
+ additionalProperties: false,
444
+ properties: {
445
+ allowMultipleTags: {
446
+ description: `If \`noMultilineBlocks\` is set to \`true\` with this option and multiple tags are
447
+ found in a block, an error will not be reported.
448
+
449
+ Since multiple-tagged lines cannot be collapsed into a single line, this option
450
+ prevents them from being reported. Set to \`false\` if you really want to report
451
+ any blocks.
452
+
453
+ This option will also be applied when there is a block description and a single
454
+ tag (since a description cannot precede a tag on a single line, and also
455
+ cannot be reliably added after the tag either).
456
+
457
+ Defaults to \`true\`.`,
458
+ type: 'boolean',
459
+ },
460
+ minimumLengthForMultiline: {
461
+ description: `If \`noMultilineBlocks\` is set with this numeric option, multiline blocks will
462
+ be permitted if containing at least the given amount of text.
463
+
464
+ If not set, multiline blocks will not be permitted regardless of length unless
465
+ a relevant tag is present and \`multilineTags\` is set.
466
+
467
+ Defaults to not being in effect.`,
468
+ type: 'integer',
469
+ },
470
+ multilineTags: {
471
+ anyOf: [
472
+ {
473
+ enum: [
474
+ '*',
475
+ ],
476
+ type: 'string',
477
+ }, {
478
+ items: {
479
+ type: 'string',
480
+ },
481
+ type: 'array',
482
+ },
483
+ ],
484
+ description: `If \`noMultilineBlocks\` is set with this option, multiline blocks may be allowed
485
+ regardless of length as long as a tag or a tag of a certain type is present.
486
+
487
+ If \`*\` is included in the array, the presence of a tags will allow for
488
+ multiline blocks (but not when without any tags unless the amount of text is
489
+ over an amount specified by \`minimumLengthForMultiline\`).
490
+
491
+ If the array does not include \`*\` but lists certain tags, the presence of
492
+ such a tag will cause multiline blocks to be allowed.
493
+
494
+ You may set this to an empty array to prevent any tag from permitting multiple
495
+ lines.
496
+
497
+ Defaults to \`['*']\`.`,
498
+ },
499
+ noFinalLineText: {
500
+ description: `For multiline blocks, any non-whitespace text preceding the \`*/\` on the final
501
+ line will be reported. (Text preceding a newline is not reported.)
502
+
503
+ \`noMultilineBlocks\` will have priority over this rule if it applies.
504
+
505
+ Defaults to \`true\`.`,
506
+ type: 'boolean',
507
+ },
508
+ noMultilineBlocks: {
509
+ description: `Requires that JSDoc blocks are restricted to single lines only unless impacted
510
+ by the options \`minimumLengthForMultiline\`, \`multilineTags\`, or
511
+ \`allowMultipleTags\`.
512
+
513
+ Defaults to \`false\`.`,
514
+ type: 'boolean',
515
+ },
516
+ noSingleLineBlocks: {
517
+ description: `If this is \`true\`, any single line blocks will be reported, except those which
518
+ are whitelisted in \`singleLineTags\`.
519
+
520
+ Defaults to \`false\`.`,
521
+ type: 'boolean',
522
+ },
523
+ noZeroLineText: {
524
+ description: `For multiline blocks, any non-whitespace text immediately after the \`/**\` and
525
+ space will be reported. (Text after a newline is not reported.)
526
+
527
+ \`noMultilineBlocks\` will have priority over this rule if it applies.
528
+
529
+ Defaults to \`true\`.`,
530
+ type: 'boolean',
531
+ },
532
+ requireSingleLineUnderCount: {
533
+ description: `If this number is set, it indicates a minimum line width for a single line of
534
+ JSDoc content spread over a multi-line comment block. If a single line is under
535
+ the minimum length, it will be reported so as to enforce single line JSDoc blocks
536
+ for such cases. Blocks are not reported which have multi-line descriptions,
537
+ multiple tags, a block description and tag, or tags with multi-line types or
538
+ descriptions.
539
+
540
+ Defaults to \`null\`.`,
541
+ type: 'number',
542
+ },
543
+ singleLineTags: {
544
+ description: `An array of tags which can nevertheless be allowed as single line blocks when
545
+ \`noSingleLineBlocks\` is set. You may set this to a empty array to
546
+ cause all single line blocks to be reported. If \`'*'\` is present, then
547
+ the presence of a tag will allow single line blocks (but not if a tag is
548
+ missing).
549
+
550
+ Defaults to \`['lends', 'type']\`.`,
551
+ items: {
552
+ type: 'string',
553
+ },
554
+ type: 'array',
555
+ },
556
+ },
557
+ type: 'object',
558
+ },
559
+ ],
560
+ type: 'suggestion',
561
+ },
562
+ });
@@ -0,0 +1,127 @@
1
+ import iterateJsdoc from '../iterateJsdoc.js';
2
+ import {
3
+ parse as commentParser,
4
+ } from 'comment-parser';
5
+
6
+ // Neither a single nor 3+ asterisks are valid JSDoc per
7
+ // https://jsdoc.app/about-getting-started.html#adding-documentation-comments-to-your-code
8
+ const commentRegexp = /^\/\*(?!\*)/v;
9
+ const extraAsteriskCommentRegexp = /^\/\*{3,}/v;
10
+
11
+ export default iterateJsdoc(({
12
+ allComments,
13
+ context,
14
+ makeReport,
15
+ sourceCode,
16
+ }) => {
17
+ const [
18
+ {
19
+ ignore = [
20
+ 'ts-check',
21
+ 'ts-expect-error',
22
+ 'ts-ignore',
23
+ 'ts-nocheck',
24
+ ],
25
+ preventAllMultiAsteriskBlocks = false,
26
+ } = {},
27
+ ] = context.options;
28
+
29
+ let extraAsterisks = false;
30
+ const nonJsdocNodes = /** @type {import('estree').Node[]} */ (
31
+ allComments
32
+ ).filter((comment) => {
33
+ const commentText = sourceCode.getText(comment);
34
+
35
+ const initialText = commentText.replace(commentRegexp, '').trimStart();
36
+ if ([
37
+ 'eslint',
38
+ ].some((directive) => {
39
+ return initialText.startsWith(directive);
40
+ })) {
41
+ return false;
42
+ }
43
+
44
+ let sliceIndex = 2;
45
+ if (!commentRegexp.test(commentText)) {
46
+ const multiline = extraAsteriskCommentRegexp.exec(commentText)?.[0];
47
+ if (!multiline) {
48
+ return false;
49
+ }
50
+
51
+ sliceIndex = multiline.length;
52
+ extraAsterisks = true;
53
+ if (preventAllMultiAsteriskBlocks) {
54
+ return true;
55
+ }
56
+ }
57
+
58
+ const tags = (commentParser(
59
+ `${commentText.slice(0, 2)}*${commentText.slice(sliceIndex)}`,
60
+ )[0] || {}).tags ?? [];
61
+
62
+ return tags.length && !tags.some(({
63
+ tag,
64
+ }) => {
65
+ return ignore.includes(tag);
66
+ });
67
+ });
68
+
69
+ if (!nonJsdocNodes.length) {
70
+ return;
71
+ }
72
+
73
+ for (const node of nonJsdocNodes) {
74
+ const report = /** @type {import('../iterateJsdoc.js').MakeReport} */ (
75
+ makeReport
76
+ )(context, node);
77
+
78
+ // eslint-disable-next-line no-loop-func
79
+ const fix = /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {
80
+ const text = sourceCode.getText(node);
81
+
82
+ return fixer.replaceText(
83
+ node,
84
+ extraAsterisks ?
85
+ text.replace(extraAsteriskCommentRegexp, '/**') :
86
+ text.replace('/*', '/**'),
87
+ );
88
+ };
89
+
90
+ report('Expected JSDoc-like comment to begin with two asterisks.', fix);
91
+ }
92
+ }, {
93
+ checkFile: true,
94
+ meta: {
95
+ docs: {
96
+ description: 'This rule checks for multi-line-style comments which fail to meet the criteria of a JSDoc block.',
97
+ url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-bad-blocks.md#repos-sticky-header',
98
+ },
99
+ fixable: 'code',
100
+ schema: [
101
+ {
102
+ additionalProperties: false,
103
+ properties: {
104
+ ignore: {
105
+ description: `An array of directives that will not be reported if present at the beginning of
106
+ a multi-comment block and at-sign \`/* @\`.
107
+
108
+ Defaults to \`['ts-check', 'ts-expect-error', 'ts-ignore', 'ts-nocheck']\`
109
+ (some directives [used by TypeScript](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check)).`,
110
+ items: {
111
+ type: 'string',
112
+ },
113
+ type: 'array',
114
+ },
115
+ preventAllMultiAsteriskBlocks: {
116
+ description: `A boolean (defaulting to \`false\`) which if \`true\` will prevent all
117
+ JSDoc-like blocks with more than two initial asterisks even those without
118
+ apparent tag content.`,
119
+ type: 'boolean',
120
+ },
121
+ },
122
+ type: 'object',
123
+ },
124
+ ],
125
+ type: 'layout',
126
+ },
127
+ });