@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,176 @@
1
+ import iterateJsdoc from '../iterateJsdoc.js';
2
+
3
+ /**
4
+ * @param {string} str
5
+ * @param {string[]} excludeTags
6
+ * @returns {string}
7
+ */
8
+ const maskExcludedContent = (str, excludeTags) => {
9
+ const regContent = new RegExp(`([ \\t]+\\*)[ \\t]@(?:${excludeTags.join('|')})(?=[ \\n])([\\w\\|\\W]*?\\n)(?=[ \\t]*\\*(?:[ \\t]*@\\w+\\s|\\/))`, 'gv');
10
+
11
+ return str.replace(regContent, (_match, margin, code) => {
12
+ return (margin + '\n').repeat(code.match(/\n/gv).length);
13
+ });
14
+ };
15
+
16
+ /**
17
+ * @param {string} str
18
+ * @returns {string}
19
+ */
20
+ const maskCodeBlocks = (str) => {
21
+ const regContent = /([ \t]+\*)[ \t]```[^\n]*?([\w\|\W]*?\n)(?=[ \t]*\*(?:[ \t]*(?:```|@\w+\s)|\/))/gv;
22
+
23
+ return str.replaceAll(regContent, (_match, margin, code) => {
24
+ return (margin + '\n').repeat(code.match(/\n/gv).length);
25
+ });
26
+ };
27
+
28
+ /**
29
+ * @param {string[]} lines
30
+ * @param {number} lineIndex
31
+ * @returns {number}
32
+ */
33
+ const getLineNumber = (lines, lineIndex) => {
34
+ const precedingText = lines.slice(0, lineIndex).join('\n');
35
+ const lineBreaks = precedingText.match(/\n/gv) || [];
36
+ return lineBreaks.length + 1;
37
+ };
38
+
39
+ export default iterateJsdoc(({
40
+ context,
41
+ jsdocNode,
42
+ report,
43
+ sourceCode,
44
+ }) => {
45
+ const options = context.options[0] || {};
46
+ const /** @type {{excludeTags: string[], allowIndentedSections: boolean}} */ {
47
+ allowIndentedSections = false,
48
+ excludeTags = [
49
+ 'example',
50
+ ],
51
+ } = options;
52
+
53
+ const textWithoutCodeBlocks = maskCodeBlocks(sourceCode.getText(jsdocNode));
54
+ const text = excludeTags.length ? maskExcludedContent(textWithoutCodeBlocks, excludeTags) : textWithoutCodeBlocks;
55
+
56
+ if (allowIndentedSections) {
57
+ // When allowIndentedSections is enabled, only check for indentation on tag lines
58
+ // and the very first line of the main description
59
+ const lines = text.split('\n');
60
+ let hasSeenContent = false;
61
+ let currentSectionIndent = null;
62
+
63
+ for (const [
64
+ lineIndex,
65
+ line,
66
+ ] of lines.entries()) {
67
+ // Check for indentation (two or more spaces after *)
68
+ const indentMatch = line.match(/^(?:\/?\**|[\t ]*)\*([\t ]{2,})/v);
69
+
70
+ if (indentMatch) {
71
+ // Check what comes after the indentation
72
+ const afterIndent = line.slice(indentMatch[0].length);
73
+ const indentAmount = indentMatch[1].length;
74
+
75
+ // If this is a tag line with indentation, always report
76
+ if (/^@\w+/v.test(afterIndent)) {
77
+ report('There must be no indentation.', null, {
78
+ line: getLineNumber(lines, lineIndex),
79
+ });
80
+ return;
81
+ }
82
+
83
+ // If we haven't seen any content yet (main description first line) and there's content, report
84
+ if (!hasSeenContent && afterIndent.trim().length > 0) {
85
+ report('There must be no indentation.', null, {
86
+ line: getLineNumber(lines, lineIndex),
87
+ });
88
+ return;
89
+ }
90
+
91
+ // For continuation lines, check consistency
92
+ if (hasSeenContent && afterIndent.trim().length > 0) {
93
+ if (currentSectionIndent === null) {
94
+ // First indented line in this section, set the indent level
95
+ currentSectionIndent = indentAmount;
96
+ } else if (indentAmount < currentSectionIndent) {
97
+ // Indentation is less than the established level (inconsistent)
98
+ report('There must be no indentation.', null, {
99
+ line: getLineNumber(lines, lineIndex),
100
+ });
101
+ return;
102
+ }
103
+ }
104
+ } else if (/^\s*\*\s+\S/v.test(line)) {
105
+ // No indentation on this line, reset section indent tracking
106
+ // (unless it's just whitespace or a closing comment)
107
+ currentSectionIndent = null;
108
+ }
109
+
110
+ // Track if we've seen any content (non-whitespace after the *)
111
+ if (/^\s*\*\s+\S/v.test(line)) {
112
+ hasSeenContent = true;
113
+ }
114
+
115
+ // Reset section indent when we encounter a tag
116
+ if (/@\w+/v.test(line)) {
117
+ currentSectionIndent = null;
118
+ }
119
+ }
120
+ } else {
121
+ const reg = /^(?:\/?\**|[ \t]*)\*[ \t]{2}/gmv;
122
+ if (reg.test(text)) {
123
+ const lineBreaks = text.slice(0, reg.lastIndex).match(/\n/gv) || [];
124
+ report('There must be no indentation.', null, {
125
+ line: lineBreaks.length,
126
+ });
127
+ }
128
+ }
129
+ }, {
130
+ iterateAllJsdocs: true,
131
+ meta: {
132
+ docs: {
133
+ description: 'Reports invalid padding inside JSDoc blocks.',
134
+ url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-indentation.md#repos-sticky-header',
135
+ },
136
+ schema: [
137
+ {
138
+ additionalProperties: false,
139
+ properties: {
140
+ allowIndentedSections: {
141
+ description: 'Allows indentation of nested sections on subsequent lines (like bullet lists)',
142
+ type: 'boolean',
143
+ },
144
+ excludeTags: {
145
+ description: `Array of tags (e.g., \`['example', 'description']\`) whose content will be
146
+ "hidden" from the \`check-indentation\` rule. Defaults to \`['example']\`.
147
+
148
+ By default, the whole JSDoc block will be checked for invalid padding.
149
+ That would include \`@example\` blocks too, which can get in the way
150
+ of adding full, readable examples of code without ending up with multiple
151
+ linting issues.
152
+
153
+ When disabled (by passing \`excludeTags: []\` option), the following code *will*
154
+ report a padding issue:
155
+
156
+ \`\`\`js
157
+ /**
158
+ * @example
159
+ * anArray.filter((a) => {
160
+ * return a.b;
161
+ * });
162
+ */
163
+ \`\`\``,
164
+ items: {
165
+ pattern: '^\\S+$',
166
+ type: 'string',
167
+ },
168
+ type: 'array',
169
+ },
170
+ },
171
+ type: 'object',
172
+ },
173
+ ],
174
+ type: 'layout',
175
+ },
176
+ });
@@ -0,0 +1,453 @@
1
+ import alignTransform from '../alignTransform.js';
2
+ import iterateJsdoc from '../iterateJsdoc.js';
3
+ import {
4
+ transforms,
5
+ } from 'comment-parser';
6
+
7
+ const {
8
+ flow: commentFlow,
9
+ } = transforms;
10
+
11
+ /**
12
+ * Detects if a line starts with a markdown list marker
13
+ * Supports: -, *, numbered lists (1., 2., etc.)
14
+ * This explicitly excludes hyphens that are part of JSDoc tag syntax
15
+ * @param {string} text - The text to check
16
+ * @param {boolean} isFirstLineOfTag - True if this is the first line (tag line)
17
+ * @returns {boolean} - True if the text starts with a list marker
18
+ */
19
+ const startsWithListMarker = (text, isFirstLineOfTag = false) => {
20
+ // On the first line of a tag, the hyphen is typically the JSDoc separator,
21
+ // not a list marker
22
+ if (isFirstLineOfTag) {
23
+ return false;
24
+ }
25
+
26
+ // Match lines that start with optional whitespace, then a list marker
27
+ // - or * followed by a space
28
+ // or a number followed by . or ) and a space
29
+ return /^\s*(?:[\-*]|\d+(?:\.|\)))\s+/v.test(text);
30
+ };
31
+
32
+ /**
33
+ * Checks if we should allow extra indentation beyond wrapIndent.
34
+ * This is true for list continuation lines (lines with more indent than wrapIndent
35
+ * that follow a list item).
36
+ * @param {import('comment-parser').Spec} tag - The tag being checked
37
+ * @param {import('../iterateJsdoc.js').Integer} idx - Current line index (0-based in tag.source.slice(1))
38
+ * @returns {boolean} - True if extra indentation should be allowed
39
+ */
40
+ const shouldAllowExtraIndent = (tag, idx) => {
41
+ // Check if any previous line in this tag had a list marker
42
+ // idx is 0-based in the continuation lines (tag.source.slice(1))
43
+ // So tag.source[0] is the tag line, tag.source[idx+1] is current line
44
+ let hasSeenListMarker = false;
45
+
46
+ // Check all lines from the tag line onwards
47
+ for (let lineIdx = 0; lineIdx <= idx + 1; lineIdx++) {
48
+ const line = tag.source[lineIdx];
49
+ const isFirstLine = lineIdx === 0;
50
+ if (line?.tokens?.description && startsWithListMarker(line.tokens.description, isFirstLine)) {
51
+ hasSeenListMarker = true;
52
+ break;
53
+ }
54
+ }
55
+
56
+ return hasSeenListMarker;
57
+ };
58
+
59
+ /**
60
+ * @typedef {{
61
+ * postDelimiter: import('../iterateJsdoc.js').Integer,
62
+ * postHyphen: import('../iterateJsdoc.js').Integer,
63
+ * postName: import('../iterateJsdoc.js').Integer,
64
+ * postTag: import('../iterateJsdoc.js').Integer,
65
+ * postType: import('../iterateJsdoc.js').Integer,
66
+ * }} CustomSpacings
67
+ */
68
+
69
+ /**
70
+ * @param {import('../iterateJsdoc.js').Utils} utils
71
+ * @param {import('comment-parser').Spec & {
72
+ * line: import('../iterateJsdoc.js').Integer
73
+ * }} tag
74
+ * @param {CustomSpacings} customSpacings
75
+ */
76
+ const checkNotAlignedPerTag = (utils, tag, customSpacings) => {
77
+ /*
78
+ start +
79
+ delimiter +
80
+ postDelimiter +
81
+ tag +
82
+ postTag +
83
+ type +
84
+ postType +
85
+ name +
86
+ postName +
87
+ description +
88
+ end +
89
+ lineEnd
90
+ */
91
+
92
+ /**
93
+ * @typedef {"tag"|"type"|"name"|"description"} ContentProp
94
+ */
95
+
96
+ /** @type {("postDelimiter"|"postTag"|"postType"|"postName")[]} */
97
+ let spacerProps;
98
+ /** @type {ContentProp[]} */
99
+ let contentProps;
100
+ const mightHaveNamepath = utils.tagMightHaveNameOrNamepath(tag.tag);
101
+ if (mightHaveNamepath) {
102
+ spacerProps = [
103
+ 'postDelimiter', 'postTag', 'postType', 'postName',
104
+ ];
105
+ contentProps = [
106
+ 'tag', 'type', 'name', 'description',
107
+ ];
108
+ } else {
109
+ spacerProps = [
110
+ 'postDelimiter', 'postTag', 'postType',
111
+ ];
112
+ contentProps = [
113
+ 'tag', 'type', 'description',
114
+ ];
115
+ }
116
+
117
+ const {
118
+ tokens,
119
+ } = tag.source[0];
120
+
121
+ /**
122
+ * @param {import('../iterateJsdoc.js').Integer} idx
123
+ * @param {(notRet: boolean, contentProp: ContentProp) => void} [callbck]
124
+ */
125
+ const followedBySpace = (idx, callbck) => {
126
+ const nextIndex = idx + 1;
127
+
128
+ return spacerProps.slice(nextIndex).some((spacerProp, innerIdx) => {
129
+ const contentProp = contentProps[nextIndex + innerIdx];
130
+
131
+ const spacePropVal = tokens[spacerProp];
132
+
133
+ const ret = spacePropVal;
134
+
135
+ if (callbck) {
136
+ callbck(!ret, contentProp);
137
+ }
138
+
139
+ return ret && (callbck || !contentProp);
140
+ });
141
+ };
142
+
143
+ const postHyphenSpacing = customSpacings?.postHyphen ?? 1;
144
+ const exactHyphenSpacing = new RegExp(`^\\s*-\\s{${postHyphenSpacing},${postHyphenSpacing}}(?!\\s)`, 'v');
145
+ const hasNoHyphen = !(/^\s*-(?!$)(?=\s)/v).test(tokens.description);
146
+ const hasExactHyphenSpacing = exactHyphenSpacing.test(
147
+ tokens.description,
148
+ );
149
+
150
+ // If checking alignment on multiple lines, need to check other `source`
151
+ // items
152
+ // Go through `post*` spacing properties and exit to indicate problem if
153
+ // extra spacing detected
154
+ const ok = !spacerProps.some((spacerProp, idx) => {
155
+ const contentProp = contentProps[idx];
156
+ const contentPropVal = tokens[contentProp];
157
+ const spacerPropVal = tokens[spacerProp];
158
+ const spacing = customSpacings?.[spacerProp] || 1;
159
+
160
+ // There will be extra alignment if...
161
+
162
+ // 1. The spaces don't match the space it should have (1 or custom spacing) OR
163
+ return spacerPropVal.length !== spacing && spacerPropVal.length !== 0 ||
164
+
165
+ // 2. There is a (single) space, no immediate content, and yet another
166
+ // space is found subsequently (not separated by intervening content)
167
+ spacerPropVal && !contentPropVal && followedBySpace(idx);
168
+ }) && (hasNoHyphen || hasExactHyphenSpacing);
169
+ if (ok) {
170
+ return;
171
+ }
172
+
173
+ const fix = () => {
174
+ for (const [
175
+ idx,
176
+ spacerProp,
177
+ ] of spacerProps.entries()) {
178
+ const contentProp = contentProps[idx];
179
+ const contentPropVal = tokens[contentProp];
180
+
181
+ if (contentPropVal) {
182
+ const spacing = customSpacings?.[spacerProp] || 1;
183
+ tokens[spacerProp] = ''.padStart(spacing, ' ');
184
+ followedBySpace(idx, (hasSpace, contentPrp) => {
185
+ if (hasSpace) {
186
+ tokens[contentPrp] = '';
187
+ }
188
+ });
189
+ } else {
190
+ tokens[spacerProp] = '';
191
+ }
192
+ }
193
+
194
+ if (!hasExactHyphenSpacing) {
195
+ const hyphenSpacing = /^\s*-\s+/v;
196
+ tokens.description = tokens.description.replace(
197
+ hyphenSpacing, '-' + ''.padStart(postHyphenSpacing, ' '),
198
+ );
199
+ }
200
+
201
+ utils.setTag(tag, tokens);
202
+ };
203
+
204
+ utils.reportJSDoc('Expected JSDoc block lines to not be aligned.', tag, fix, true);
205
+ };
206
+
207
+ /**
208
+ * @param {object} cfg
209
+ * @param {CustomSpacings} cfg.customSpacings
210
+ * @param {string} cfg.indent
211
+ * @param {import('comment-parser').Block} cfg.jsdoc
212
+ * @param {import('eslint').Rule.Node & {
213
+ * range: [number, number]
214
+ * }} cfg.jsdocNode
215
+ * @param {boolean} cfg.preserveMainDescriptionPostDelimiter
216
+ * @param {import('../iterateJsdoc.js').Report} cfg.report
217
+ * @param {string[]} cfg.tags
218
+ * @param {import('../iterateJsdoc.js').Utils} cfg.utils
219
+ * @param {string} cfg.wrapIndent
220
+ * @param {boolean} cfg.disableWrapIndent
221
+ * @returns {void}
222
+ */
223
+ const checkAlignment = ({
224
+ customSpacings,
225
+ disableWrapIndent,
226
+ indent,
227
+ jsdoc,
228
+ jsdocNode,
229
+ preserveMainDescriptionPostDelimiter,
230
+ report,
231
+ tags,
232
+ utils,
233
+ wrapIndent,
234
+ }) => {
235
+ const transform = commentFlow(
236
+ alignTransform({
237
+ customSpacings,
238
+ disableWrapIndent,
239
+ indent,
240
+ preserveMainDescriptionPostDelimiter,
241
+ tags,
242
+ wrapIndent,
243
+ }),
244
+ );
245
+ const transformedJsdoc = transform(jsdoc);
246
+
247
+ const comment = '/*' +
248
+ /**
249
+ * @type {import('eslint').Rule.Node & {
250
+ * range: [number, number], value: string
251
+ * }}
252
+ */ (jsdocNode).value + '*/';
253
+
254
+ const formatted = utils.stringify(transformedJsdoc)
255
+ .trimStart();
256
+
257
+ if (comment !== formatted) {
258
+ report(
259
+ 'Expected JSDoc block lines to be aligned.',
260
+ /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {
261
+ return fixer.replaceText(jsdocNode, formatted);
262
+ },
263
+ );
264
+ }
265
+ };
266
+
267
+ export default iterateJsdoc(({
268
+ context,
269
+ indent,
270
+ jsdoc,
271
+ jsdocNode,
272
+ report,
273
+ utils,
274
+ }) => {
275
+ const {
276
+ customSpacings,
277
+ disableWrapIndent = false,
278
+ preserveMainDescriptionPostDelimiter,
279
+ tags: applicableTags = [
280
+ 'param', 'arg', 'argument', 'property', 'prop', 'returns', 'return', 'template',
281
+ ],
282
+ wrapIndent = '',
283
+ } = context.options[1] || {};
284
+
285
+ if (context.options[0] === 'always') {
286
+ // Skip if it contains only a single line.
287
+ if (!(
288
+ /**
289
+ * @type {import('eslint').Rule.Node & {
290
+ * range: [number, number], value: string
291
+ * }}
292
+ */
293
+ (jsdocNode).value.includes('\n')
294
+ )) {
295
+ return;
296
+ }
297
+
298
+ checkAlignment({
299
+ customSpacings,
300
+ disableWrapIndent,
301
+ indent,
302
+ jsdoc,
303
+ jsdocNode,
304
+ preserveMainDescriptionPostDelimiter,
305
+ report,
306
+ tags: applicableTags,
307
+ utils,
308
+ wrapIndent,
309
+ });
310
+
311
+ return;
312
+ }
313
+
314
+ const foundTags = utils.getPresentTags(applicableTags);
315
+ if (context.options[0] !== 'any') {
316
+ for (const tag of foundTags) {
317
+ checkNotAlignedPerTag(
318
+ utils,
319
+ /**
320
+ * @type {import('comment-parser').Spec & {
321
+ * line: import('../iterateJsdoc.js').Integer
322
+ * }}
323
+ */
324
+ (tag),
325
+ customSpacings,
326
+ );
327
+ }
328
+ }
329
+
330
+ for (const tag of foundTags) {
331
+ if (tag.source.length > 1) {
332
+ let idx = 0;
333
+ for (const {
334
+ tokens,
335
+ // Avoid the tag line
336
+ } of tag.source.slice(1)) {
337
+ idx++;
338
+
339
+ if (
340
+ !tokens.description ||
341
+ // Avoid first lines after multiline type
342
+ tokens.type ||
343
+ tokens.name
344
+ ) {
345
+ continue;
346
+ }
347
+
348
+ // Don't include a single separating space/tab
349
+ const actualIndent = tokens.postDelimiter.slice(1);
350
+ const hasCorrectWrapIndent = actualIndent === wrapIndent;
351
+
352
+ // Allow extra indentation if this line or previous lines contain list markers
353
+ // This preserves nested list structure
354
+ const hasExtraIndent = actualIndent.length > wrapIndent.length &&
355
+ actualIndent.startsWith(wrapIndent);
356
+ const isInListContext = shouldAllowExtraIndent(tag, idx - 1);
357
+
358
+ if (!disableWrapIndent && !hasCorrectWrapIndent &&
359
+ !(hasExtraIndent && isInListContext)) {
360
+ utils.reportJSDoc('Expected wrap indent', {
361
+ line: tag.source[0].number + idx,
362
+ }, () => {
363
+ tokens.postDelimiter = tokens.postDelimiter.charAt(0) + wrapIndent;
364
+ });
365
+ return;
366
+ }
367
+ }
368
+ }
369
+ }
370
+ }, {
371
+ iterateAllJsdocs: true,
372
+ meta: {
373
+ docs: {
374
+ description: 'Reports invalid alignment of JSDoc block lines.',
375
+ url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-line-alignment.md#repos-sticky-header',
376
+ },
377
+ fixable: 'whitespace',
378
+ schema: [
379
+ {
380
+ description: `If the string value is
381
+ \`"always"\` then a problem is raised when the lines are not aligned.
382
+ If it is \`"never"\` then a problem should be raised when there is more than
383
+ one space between each line's parts. If it is \`"any"\`, no alignment is made.
384
+ Defaults to \`"never"\`.
385
+
386
+ Note that in addition to alignment, the "never" and "always" options will both
387
+ ensure that at least one space is present after the asterisk delimiter.`,
388
+ enum: [
389
+ 'always', 'never', 'any',
390
+ ],
391
+ type: 'string',
392
+ },
393
+ {
394
+ additionalProperties: false,
395
+ properties: {
396
+ customSpacings: {
397
+ additionalProperties: false,
398
+ description: `An object with any of the following spacing keys set to an integer.
399
+ If a spacing is not defined, it defaults to one.`,
400
+ properties: {
401
+ postDelimiter: {
402
+ description: 'Affects spacing after the asterisk (e.g., `* @param`)',
403
+ type: 'integer',
404
+ },
405
+ postHyphen: {
406
+ description: 'Affects spacing after any hyphens in the description (e.g., `* @param {someType} name - A description`)',
407
+ type: 'integer',
408
+ },
409
+ postName: {
410
+ description: 'Affects spacing after the name (e.g., `* @param {someType} name `)',
411
+ type: 'integer',
412
+ },
413
+ postTag: {
414
+ description: 'Affects spacing after the tag (e.g., `* @param `)',
415
+ type: 'integer',
416
+ },
417
+ postType: {
418
+ description: 'Affects spacing after the type (e.g., `* @param {someType} `)',
419
+ type: 'integer',
420
+ },
421
+ },
422
+ type: 'object',
423
+ },
424
+ disableWrapIndent: {
425
+ description: 'Disables `wrapIndent`; existing wrap indentation is preserved without changes.',
426
+ type: 'boolean',
427
+ },
428
+ preserveMainDescriptionPostDelimiter: {
429
+ default: false,
430
+ description: `A boolean to determine whether to preserve the post-delimiter spacing of the
431
+ main description. If \`false\` or unset, will be set to a single space.`,
432
+ type: 'boolean',
433
+ },
434
+ tags: {
435
+ description: `Use this to change the tags which are sought for alignment changes. Defaults to an array of
436
+ \`['param', 'arg', 'argument', 'property', 'prop', 'returns', 'return', 'template']\`.`,
437
+ items: {
438
+ type: 'string',
439
+ },
440
+ type: 'array',
441
+ },
442
+ wrapIndent: {
443
+ description: `The indent that will be applied for tag text after the first line.
444
+ Default to the empty string (no indent).`,
445
+ type: 'string',
446
+ },
447
+ },
448
+ type: 'object',
449
+ },
450
+ ],
451
+ type: 'layout',
452
+ },
453
+ });