@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,321 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
8
+ var _escapeStringRegexp = _interopRequireDefault(require("escape-string-regexp"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const otherDescriptiveTags = new Set(['classdesc', 'deprecated', 'exception', 'file', 'fileoverview', 'overview',
11
+ // 'copyright' and 'see' might be good addition, but as the former may be
12
+ // sensitive text, and the latter may have just a link, they are not
13
+ // included by default
14
+ 'summary', 'throws', 'todo', 'yield', 'yields']);
15
+
16
+ /**
17
+ * @param {string} text
18
+ * @returns {string[]}
19
+ */
20
+ const extractParagraphs = text => {
21
+ return text.split(/(?<![;:])\n\n+/v);
22
+ };
23
+
24
+ /**
25
+ * @param {string} text
26
+ * @param {string|RegExp} abbreviationsRegex
27
+ * @returns {string[]}
28
+ */
29
+ const extractSentences = (text, abbreviationsRegex) => {
30
+ const txt = text
31
+ // Remove all {} tags.
32
+ .replaceAll(/(?<!^)\{[\s\S]*?\}\s*/gv, '')
33
+
34
+ // Remove custom abbreviations
35
+ .replace(abbreviationsRegex, '');
36
+ const sentenceEndGrouping = /([.?!])(?:\s+|$)/gv;
37
+ const puncts = [...txt.matchAll(sentenceEndGrouping)].map(sentEnd => {
38
+ return sentEnd[0];
39
+ });
40
+ return txt.split(/[.?!](?:\s+|$)/v)
41
+
42
+ // Re-add the dot.
43
+ .map((sentence, idx) => {
44
+ return !puncts[idx] && /^\s*$/v.test(sentence) ? sentence : `${sentence}${puncts[idx] || ''}`;
45
+ });
46
+ };
47
+
48
+ /**
49
+ * @param {string} text
50
+ * @returns {boolean}
51
+ */
52
+ const isNewLinePrecededByAPeriod = text => {
53
+ /** @type {boolean} */
54
+ let lastLineEndsSentence;
55
+ const lines = text.split('\n');
56
+ return !lines.some(line => {
57
+ if (lastLineEndsSentence === false && /^[A-Z][a-z]/v.test(line)) {
58
+ return true;
59
+ }
60
+ lastLineEndsSentence = /[.:?!\|]$/v.test(line);
61
+ return false;
62
+ });
63
+ };
64
+
65
+ /**
66
+ * @param {string} str
67
+ * @returns {boolean}
68
+ */
69
+ const isCapitalized = str => {
70
+ return str[0] === str[0].toUpperCase();
71
+ };
72
+
73
+ /**
74
+ * @param {string} str
75
+ * @returns {boolean}
76
+ */
77
+ const isTable = str => {
78
+ return str.charAt(0) === '|';
79
+ };
80
+
81
+ /**
82
+ * @param {string} str
83
+ * @returns {string}
84
+ */
85
+ const capitalize = str => {
86
+ return str.charAt(0).toUpperCase() + str.slice(1);
87
+ };
88
+
89
+ /**
90
+ * @param {string} description
91
+ * @param {import('../iterateJsdoc.js').Report} reportOrig
92
+ * @param {import('eslint').Rule.Node} jsdocNode
93
+ * @param {string|RegExp} abbreviationsRegex
94
+ * @param {import('eslint').SourceCode} sourceCode
95
+ * @param {import('comment-parser').Spec|{
96
+ * line: import('../iterateJsdoc.js').Integer
97
+ * }} tag
98
+ * @param {boolean} newlineBeforeCapsAssumesBadSentenceEnd
99
+ * @returns {boolean}
100
+ */
101
+ const validateDescription = (description, reportOrig, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd) => {
102
+ if (!description || /^\n+$/v.test(description)) {
103
+ return false;
104
+ }
105
+ const descriptionNoHeadings = description.replaceAll(/^\s*#[^\n]*(\n|$)/gmv, '');
106
+ const paragraphs = extractParagraphs(descriptionNoHeadings).filter(Boolean);
107
+ return paragraphs.some((paragraph, parIdx) => {
108
+ const sentences = extractSentences(paragraph, abbreviationsRegex);
109
+ const fix = /** @type {import('eslint').Rule.ReportFixer} */fixer => {
110
+ let text = sourceCode.getText(jsdocNode);
111
+ if (!/[.:?!]$/v.test(paragraph)) {
112
+ const line = paragraph.split('\n').findLast(Boolean);
113
+ text = text.replace(new RegExp(`${(0, _escapeStringRegexp.default)(/** @type {string} */
114
+ line)}$`, 'mv'), `${line}.`);
115
+ }
116
+ for (const sentence of sentences.filter(sentence_ => {
117
+ return !/^\s*$/v.test(sentence_) && !isCapitalized(sentence_) && !isTable(sentence_);
118
+ })) {
119
+ const beginning = sentence.split('\n')[0];
120
+ if ('tag' in tag && tag.tag) {
121
+ const reg = new RegExp(`(@${(0, _escapeStringRegexp.default)(tag.tag)}.*)${(0, _escapeStringRegexp.default)(beginning)}`, 'v');
122
+ text = text.replace(reg, (_$0, $1) => {
123
+ return $1 + capitalize(beginning);
124
+ });
125
+ } else {
126
+ text = text.replace(new RegExp('((?:[.?!]|\\*|\\})\\s*)' + (0, _escapeStringRegexp.default)(beginning), 'v'), '$1' + capitalize(beginning));
127
+ }
128
+ }
129
+ return fixer.replaceText(jsdocNode, text);
130
+ };
131
+
132
+ /**
133
+ * @param {string} msg
134
+ * @param {import('eslint').Rule.ReportFixer | null | undefined} fixer
135
+ * @param {{
136
+ * line?: number | undefined;
137
+ * column?: number | undefined;
138
+ * } | (import('comment-parser').Spec & {
139
+ * line?: number | undefined;
140
+ * column?: number | undefined;
141
+ * })} tagObj
142
+ * @returns {void}
143
+ */
144
+ const report = (msg, fixer, tagObj) => {
145
+ if ('line' in tagObj) {
146
+ /**
147
+ * @type {{
148
+ * line: number;
149
+ * }}
150
+ */
151
+ tagObj.line += parIdx * 2;
152
+ } else {
153
+ /** @type {import('comment-parser').Spec} */tagObj.source[0].number += parIdx * 2;
154
+ }
155
+
156
+ // Avoid errors if old column doesn't exist here
157
+ tagObj.column = 0;
158
+ reportOrig(msg, fixer, tagObj);
159
+ };
160
+ if (sentences.some(sentence => {
161
+ return /^[.?!]$/v.test(sentence);
162
+ })) {
163
+ report('Sentences must be more than punctuation.', null, tag);
164
+ }
165
+ if (sentences.some(sentence => {
166
+ return !/^\s*$/v.test(sentence) && !isCapitalized(sentence) && !isTable(sentence);
167
+ })) {
168
+ report('Sentences should start with an uppercase character.', fix, tag);
169
+ }
170
+ const paragraphNoAbbreviations = paragraph.replace(abbreviationsRegex, '');
171
+ if (!/(?:[.?!\|]|```)\s*$/v.test(paragraphNoAbbreviations)) {
172
+ report('Sentences must end with a period.', fix, tag);
173
+ return true;
174
+ }
175
+ if (newlineBeforeCapsAssumesBadSentenceEnd && !isNewLinePrecededByAPeriod(paragraphNoAbbreviations)) {
176
+ report('A line of text is started with an uppercase character, but the preceding line does not end the sentence.', null, tag);
177
+ return true;
178
+ }
179
+ return false;
180
+ });
181
+ };
182
+ var _default = exports.default = (0, _iterateJsdoc.default)(({
183
+ context,
184
+ jsdoc,
185
+ jsdocNode,
186
+ report,
187
+ sourceCode,
188
+ utils
189
+ }) => {
190
+ const /** @type {{abbreviations: string[], newlineBeforeCapsAssumesBadSentenceEnd: boolean}} */{
191
+ abbreviations = [],
192
+ newlineBeforeCapsAssumesBadSentenceEnd = false
193
+ } = context.options[0] || {};
194
+
195
+ // `@inheritDoc` can be used as inline tag with TSDoc/typedoc: https://typedoc.org/documents/Tags.__inheritDoc_.html
196
+ if (utils.getInlineTags().some(({
197
+ tag
198
+ }) => {
199
+ return [
200
+ // Typdoc
201
+ 'include', 'includeCode',
202
+ // TSDoc
203
+ 'inheritDoc', 'inheritdoc', 'label'].includes(tag);
204
+ })) {
205
+ return;
206
+ }
207
+ const abbreviationsRegex = abbreviations.length ? new RegExp('\\b' + abbreviations.map(abbreviation => {
208
+ return (0, _escapeStringRegexp.default)(abbreviation.replaceAll(/\.$/gv, '') + '.');
209
+ }).join('|') + '(?:$|\\s)', 'gv') : '';
210
+ let {
211
+ description
212
+ } = utils.getDescription();
213
+ const indices = [...description.matchAll(/```[\s\S]*```/gv)].map(match => {
214
+ const {
215
+ index
216
+ } = match;
217
+ const [{
218
+ length
219
+ }] = match;
220
+ return {
221
+ index,
222
+ length
223
+ };
224
+ }).toReversed();
225
+ for (const {
226
+ index,
227
+ length
228
+ } of indices) {
229
+ description = description.slice(0, index) + description.slice(/** @type {import('../iterateJsdoc.js').Integer} */index + length);
230
+ }
231
+ if (validateDescription(description, report, jsdocNode, abbreviationsRegex, sourceCode, {
232
+ line: jsdoc.source[0].number + 1
233
+ }, newlineBeforeCapsAssumesBadSentenceEnd)) {
234
+ return;
235
+ }
236
+ utils.forEachPreferredTag('description', matchingJsdocTag => {
237
+ const desc = `${matchingJsdocTag.name} ${utils.getTagDescription(matchingJsdocTag)}`.trim();
238
+ validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, matchingJsdocTag, newlineBeforeCapsAssumesBadSentenceEnd);
239
+ }, true);
240
+ const {
241
+ tagsWithNames
242
+ } = utils.getTagsByType(jsdoc.tags);
243
+ const tagsWithoutNames = utils.filterTags(({
244
+ tag: tagName
245
+ }) => {
246
+ return otherDescriptiveTags.has(tagName) || utils.hasOptionTag(tagName) && !tagsWithNames.some(({
247
+ tag
248
+ }) => {
249
+ // If user accidentally adds tags with names (or like `returns`
250
+ // get parsed as having names), do not add to this list
251
+ return tag === tagName;
252
+ });
253
+ });
254
+ tagsWithNames.some(tag => {
255
+ const desc = /** @type {string} */utils.getTagDescription(tag).replace(/^- /v, '').trimEnd();
256
+ return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd);
257
+ });
258
+ tagsWithoutNames.some(tag => {
259
+ const desc = `${tag.name} ${utils.getTagDescription(tag)}`.trim();
260
+ return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd);
261
+ });
262
+ }, {
263
+ iterateAllJsdocs: true,
264
+ meta: {
265
+ docs: {
266
+ description: 'Requires that block description, explicit `@description`, and `@param`/`@returns` tag descriptions are written in complete sentences.',
267
+ url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-description-complete-sentence.md#repos-sticky-header'
268
+ },
269
+ fixable: 'code',
270
+ schema: [{
271
+ additionalProperties: false,
272
+ properties: {
273
+ abbreviations: {
274
+ description: `You can provide an \`abbreviations\` options array to avoid such strings of text
275
+ being treated as sentence endings when followed by dots. The \`.\` is not
276
+ necessary at the end of the array items.`,
277
+ items: {
278
+ type: 'string'
279
+ },
280
+ type: 'array'
281
+ },
282
+ newlineBeforeCapsAssumesBadSentenceEnd: {
283
+ description: `When \`false\` (the new default), we will not assume capital letters after
284
+ newlines are an incorrect way to end the sentence (they may be proper
285
+ nouns, for example).`,
286
+ type: 'boolean'
287
+ },
288
+ tags: {
289
+ description: `If you want additional tags to be checked for their descriptions, you may
290
+ add them within this option.
291
+
292
+ \`\`\`js
293
+ {
294
+ 'jsdoc/require-description-complete-sentence': ['error', {
295
+ tags: ['see', 'copyright']
296
+ }]
297
+ }
298
+ \`\`\`
299
+
300
+ The tags \`@param\`/\`@arg\`/\`@argument\` and \`@property\`/\`@prop\` will be properly
301
+ parsed to ensure that the checked "description" text includes only the text
302
+ after the name.
303
+
304
+ All other tags will treat the text following the tag name, a space, and
305
+ an optional curly-bracketed type expression (and another space) as part of
306
+ its "description" (e.g., for \`@returns {someType} some description\`, the
307
+ description is \`some description\` while for \`@some-tag xyz\`, the description
308
+ is \`xyz\`).`,
309
+ items: {
310
+ type: 'string'
311
+ },
312
+ type: 'array'
313
+ }
314
+ },
315
+ type: 'object'
316
+ }],
317
+ type: 'suggestion'
318
+ }
319
+ });
320
+ module.exports = exports.default;
321
+ //# sourceMappingURL=requireDescriptionCompleteSentence.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requireDescriptionCompleteSentence.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_escapeStringRegexp","e","__esModule","default","otherDescriptiveTags","Set","extractParagraphs","text","split","extractSentences","abbreviationsRegex","txt","replaceAll","replace","sentenceEndGrouping","puncts","matchAll","map","sentEnd","sentence","idx","test","isNewLinePrecededByAPeriod","lastLineEndsSentence","lines","some","line","isCapitalized","str","toUpperCase","isTable","charAt","capitalize","slice","validateDescription","description","reportOrig","jsdocNode","sourceCode","tag","newlineBeforeCapsAssumesBadSentenceEnd","descriptionNoHeadings","paragraphs","filter","Boolean","paragraph","parIdx","sentences","fix","fixer","getText","findLast","RegExp","escapeStringRegexp","sentence_","beginning","reg","_$0","$1","replaceText","report","msg","tagObj","source","number","column","paragraphNoAbbreviations","_default","exports","iterateJsdoc","context","jsdoc","utils","abbreviations","options","getInlineTags","includes","length","abbreviation","join","getDescription","indices","match","index","toReversed","forEachPreferredTag","matchingJsdocTag","desc","name","getTagDescription","trim","tagsWithNames","getTagsByType","tags","tagsWithoutNames","filterTags","tagName","has","hasOptionTag","trimEnd","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","items","type","module"],"sources":["../../src/rules/requireDescriptionCompleteSentence.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport escapeStringRegexp from 'escape-string-regexp';\n\nconst otherDescriptiveTags = new Set([\n 'classdesc', 'deprecated', 'exception', 'file', 'fileoverview', 'overview',\n // 'copyright' and 'see' might be good addition, but as the former may be\n // sensitive text, and the latter may have just a link, they are not\n // included by default\n 'summary', 'throws', 'todo', 'yield', 'yields',\n]);\n\n/**\n * @param {string} text\n * @returns {string[]}\n */\nconst extractParagraphs = (text) => {\n return text.split(/(?<![;:])\\n\\n+/v);\n};\n\n/**\n * @param {string} text\n * @param {string|RegExp} abbreviationsRegex\n * @returns {string[]}\n */\nconst extractSentences = (text, abbreviationsRegex) => {\n const txt = text\n // Remove all {} tags.\n .replaceAll(/(?<!^)\\{[\\s\\S]*?\\}\\s*/gv, '')\n\n // Remove custom abbreviations\n .replace(abbreviationsRegex, '');\n\n const sentenceEndGrouping = /([.?!])(?:\\s+|$)/gv;\n\n const puncts = [\n ...txt.matchAll(sentenceEndGrouping),\n ].map((sentEnd) => {\n return sentEnd[0];\n });\n\n return txt\n .split(/[.?!](?:\\s+|$)/v)\n\n // Re-add the dot.\n .map((sentence, idx) => {\n return !puncts[idx] && /^\\s*$/v.test(sentence) ? sentence : `${sentence}${puncts[idx] || ''}`;\n });\n};\n\n/**\n * @param {string} text\n * @returns {boolean}\n */\nconst isNewLinePrecededByAPeriod = (text) => {\n /** @type {boolean} */\n let lastLineEndsSentence;\n\n const lines = text.split('\\n');\n\n return !lines.some((line) => {\n if (lastLineEndsSentence === false && /^[A-Z][a-z]/v.test(line)) {\n return true;\n }\n\n lastLineEndsSentence = /[.:?!\\|]$/v.test(line);\n\n return false;\n });\n};\n\n/**\n * @param {string} str\n * @returns {boolean}\n */\nconst isCapitalized = (str) => {\n return str[0] === str[0].toUpperCase();\n};\n\n/**\n * @param {string} str\n * @returns {boolean}\n */\nconst isTable = (str) => {\n return str.charAt(0) === '|';\n};\n\n/**\n * @param {string} str\n * @returns {string}\n */\nconst capitalize = (str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\n/**\n * @param {string} description\n * @param {import('../iterateJsdoc.js').Report} reportOrig\n * @param {import('eslint').Rule.Node} jsdocNode\n * @param {string|RegExp} abbreviationsRegex\n * @param {import('eslint').SourceCode} sourceCode\n * @param {import('comment-parser').Spec|{\n * line: import('../iterateJsdoc.js').Integer\n * }} tag\n * @param {boolean} newlineBeforeCapsAssumesBadSentenceEnd\n * @returns {boolean}\n */\nconst validateDescription = (\n description, reportOrig, jsdocNode, abbreviationsRegex,\n sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd,\n) => {\n if (!description || (/^\\n+$/v).test(description)) {\n return false;\n }\n\n const descriptionNoHeadings = description.replaceAll(/^\\s*#[^\\n]*(\\n|$)/gmv, '');\n\n const paragraphs = extractParagraphs(descriptionNoHeadings).filter(Boolean);\n\n return paragraphs.some((paragraph, parIdx) => {\n const sentences = extractSentences(paragraph, abbreviationsRegex);\n\n const fix = /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {\n let text = sourceCode.getText(jsdocNode);\n\n if (!/[.:?!]$/v.test(paragraph)) {\n const line = paragraph.split('\\n').findLast(Boolean);\n text = text.replace(new RegExp(`${escapeStringRegexp(\n /** @type {string} */\n (line),\n )}$`, 'mv'), `${line}.`);\n }\n\n for (const sentence of sentences.filter((sentence_) => {\n return !(/^\\s*$/v).test(sentence_) && !isCapitalized(sentence_) &&\n !isTable(sentence_);\n })) {\n const beginning = sentence.split('\\n')[0];\n\n if ('tag' in tag && tag.tag) {\n const reg = new RegExp(`(@${escapeStringRegexp(tag.tag)}.*)${escapeStringRegexp(beginning)}`, 'v');\n\n text = text.replace(reg, (_$0, $1) => {\n return $1 + capitalize(beginning);\n });\n } else {\n text = text.replace(new RegExp('((?:[.?!]|\\\\*|\\\\})\\\\s*)' + escapeStringRegexp(beginning), 'v'), '$1' + capitalize(beginning));\n }\n }\n\n return fixer.replaceText(jsdocNode, text);\n };\n\n /**\n * @param {string} msg\n * @param {import('eslint').Rule.ReportFixer | null | undefined} fixer\n * @param {{\n * line?: number | undefined;\n * column?: number | undefined;\n * } | (import('comment-parser').Spec & {\n * line?: number | undefined;\n * column?: number | undefined;\n * })} tagObj\n * @returns {void}\n */\n const report = (msg, fixer, tagObj) => {\n if ('line' in tagObj) {\n /**\n * @type {{\n * line: number;\n * }}\n */ (tagObj).line += parIdx * 2;\n } else {\n /** @type {import('comment-parser').Spec} */ (\n tagObj\n ).source[0].number += parIdx * 2;\n }\n\n // Avoid errors if old column doesn't exist here\n tagObj.column = 0;\n reportOrig(msg, fixer, tagObj);\n };\n\n if (sentences.some((sentence) => {\n return (/^[.?!]$/v).test(sentence);\n })) {\n report('Sentences must be more than punctuation.', null, tag);\n }\n\n if (sentences.some((sentence) => {\n return !(/^\\s*$/v).test(sentence) && !isCapitalized(sentence) && !isTable(sentence);\n })) {\n report('Sentences should start with an uppercase character.', fix, tag);\n }\n\n const paragraphNoAbbreviations = paragraph.replace(abbreviationsRegex, '');\n\n if (!/(?:[.?!\\|]|```)\\s*$/v.test(paragraphNoAbbreviations)) {\n report('Sentences must end with a period.', fix, tag);\n return true;\n }\n\n if (newlineBeforeCapsAssumesBadSentenceEnd && !isNewLinePrecededByAPeriod(paragraphNoAbbreviations)) {\n report('A line of text is started with an uppercase character, but the preceding line does not end the sentence.', null, tag);\n\n return true;\n }\n\n return false;\n });\n};\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n jsdocNode,\n report,\n sourceCode,\n utils,\n}) => {\n const /** @type {{abbreviations: string[], newlineBeforeCapsAssumesBadSentenceEnd: boolean}} */ {\n abbreviations = [],\n newlineBeforeCapsAssumesBadSentenceEnd = false,\n } = context.options[0] || {};\n\n // `@inheritDoc` can be used as inline tag with TSDoc/typedoc: https://typedoc.org/documents/Tags.__inheritDoc_.html\n if (utils.getInlineTags().some(({\n tag,\n }) => {\n return [\n // Typdoc\n 'include', 'includeCode',\n // TSDoc\n 'inheritDoc', 'inheritdoc',\n 'label',\n ].includes(tag);\n })) {\n return;\n }\n\n const abbreviationsRegex = abbreviations.length ?\n new RegExp('\\\\b' + abbreviations.map((abbreviation) => {\n return escapeStringRegexp(abbreviation.replaceAll(/\\.$/gv, '') + '.');\n }).join('|') + '(?:$|\\\\s)', 'gv') :\n '';\n\n let {\n description,\n } = utils.getDescription();\n\n const indices = [\n ...description.matchAll(/```[\\s\\S]*```/gv),\n ].map((match) => {\n const {\n index,\n } = match;\n const [\n {\n length,\n },\n ] = match;\n return {\n index,\n length,\n };\n }).toReversed();\n\n for (const {\n index,\n length,\n } of indices) {\n description = description.slice(0, index) +\n description.slice(/** @type {import('../iterateJsdoc.js').Integer} */ (\n index\n ) + length);\n }\n\n if (validateDescription(description, report, jsdocNode, abbreviationsRegex, sourceCode, {\n line: jsdoc.source[0].number + 1,\n }, newlineBeforeCapsAssumesBadSentenceEnd)) {\n return;\n }\n\n utils.forEachPreferredTag('description', (matchingJsdocTag) => {\n const desc = `${matchingJsdocTag.name} ${utils.getTagDescription(matchingJsdocTag)}`.trim();\n validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, matchingJsdocTag, newlineBeforeCapsAssumesBadSentenceEnd);\n }, true);\n\n const {\n tagsWithNames,\n } = utils.getTagsByType(jsdoc.tags);\n const tagsWithoutNames = utils.filterTags(({\n tag: tagName,\n }) => {\n return otherDescriptiveTags.has(tagName) ||\n utils.hasOptionTag(tagName) && !tagsWithNames.some(({\n tag,\n }) => {\n // If user accidentally adds tags with names (or like `returns`\n // get parsed as having names), do not add to this list\n return tag === tagName;\n });\n });\n\n tagsWithNames.some((tag) => {\n const desc = /** @type {string} */ (\n utils.getTagDescription(tag)\n ).replace(/^- /v, '').trimEnd();\n\n return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd);\n });\n\n tagsWithoutNames.some((tag) => {\n const desc = `${tag.name} ${utils.getTagDescription(tag)}`.trim();\n\n return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd);\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires that block description, explicit `@description`, and `@param`/`@returns` tag descriptions are written in complete sentences.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-description-complete-sentence.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n abbreviations: {\n description: `You can provide an \\`abbreviations\\` options array to avoid such strings of text\nbeing treated as sentence endings when followed by dots. The \\`.\\` is not\nnecessary at the end of the array items.`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n newlineBeforeCapsAssumesBadSentenceEnd: {\n description: `When \\`false\\` (the new default), we will not assume capital letters after\nnewlines are an incorrect way to end the sentence (they may be proper\nnouns, for example).`,\n type: 'boolean',\n },\n tags: {\n description: `If you want additional tags to be checked for their descriptions, you may\nadd them within this option.\n\n\\`\\`\\`js\n{\n 'jsdoc/require-description-complete-sentence': ['error', {\n tags: ['see', 'copyright']\n }]\n}\n\\`\\`\\`\n\nThe tags \\`@param\\`/\\`@arg\\`/\\`@argument\\` and \\`@property\\`/\\`@prop\\` will be properly\nparsed to ensure that the checked \"description\" text includes only the text\nafter the name.\n\nAll other tags will treat the text following the tag name, a space, and\nan optional curly-bracketed type expression (and another space) as part of\nits \"description\" (e.g., for \\`@returns {someType} some description\\`, the\ndescription is \\`some description\\` while for \\`@some-tag xyz\\`, the description\nis \\`xyz\\`).`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAsD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtD,MAAMG,oBAAoB,GAAG,IAAIC,GAAG,CAAC,CACnC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU;AAC1E;AACA;AACA;AACA,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAC/C,CAAC;;AAEF;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAIC,IAAI,IAAK;EAClC,OAAOA,IAAI,CAACC,KAAK,CAAC,iBAAiB,CAAC;AACtC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAACF,IAAI,EAAEG,kBAAkB,KAAK;EACrD,MAAMC,GAAG,GAAGJ;EACV;EAAA,CACCK,UAAU,CAAC,yBAAyB,EAAE,EAAE;;EAEzC;EAAA,CACCC,OAAO,CAACH,kBAAkB,EAAE,EAAE,CAAC;EAElC,MAAMI,mBAAmB,GAAG,oBAAoB;EAEhD,MAAMC,MAAM,GAAG,CACb,GAAGJ,GAAG,CAACK,QAAQ,CAACF,mBAAmB,CAAC,CACrC,CAACG,GAAG,CAAEC,OAAO,IAAK;IACjB,OAAOA,OAAO,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC;EAEF,OAAOP,GAAG,CACPH,KAAK,CAA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oreList":[]}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("eslint").Rule.RuleModule;
2
+ export default _default;
3
+ //# sourceMappingURL=requireDescriptionCompleteSentence.d.ts.map
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ var _default = exports.default = (0, _iterateJsdoc.default)(({
10
+ context,
11
+ jsdoc,
12
+ report,
13
+ utils
14
+ }) => {
15
+ if (utils.avoidDocs()) {
16
+ return;
17
+ }
18
+ const {
19
+ enableFixer = true,
20
+ exemptNoArguments = false
21
+ } = context.options[0] || {};
22
+ const targetTagName = 'example';
23
+ const functionExamples = jsdoc.tags.filter(({
24
+ tag
25
+ }) => {
26
+ return tag === targetTagName;
27
+ });
28
+ if (!functionExamples.length) {
29
+ if (exemptNoArguments && utils.isIteratingFunctionOrVariable() && !utils.hasParams()) {
30
+ return;
31
+ }
32
+ utils.reportJSDoc(`Missing JSDoc @${targetTagName} declaration.`, null, () => {
33
+ if (enableFixer) {
34
+ utils.addTag(targetTagName);
35
+ }
36
+ });
37
+ return;
38
+ }
39
+ for (const example of functionExamples) {
40
+ const exampleContent = `${example.name} ${utils.getTagDescription(example)}`.trim().split('\n').filter(Boolean);
41
+ if (!exampleContent.length) {
42
+ report(`Missing JSDoc @${targetTagName} description.`, null, example);
43
+ }
44
+ }
45
+ }, {
46
+ contextDefaults: true,
47
+ meta: {
48
+ docs: {
49
+ description: 'Requires that all functions (and potentially other contexts) have examples.',
50
+ url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-example.md#repos-sticky-header'
51
+ },
52
+ fixable: 'code',
53
+ schema: [{
54
+ additionalProperties: false,
55
+ properties: {
56
+ checkConstructors: {
57
+ default: true,
58
+ description: `A value indicating whether \`constructor\`s should be checked.
59
+ Defaults to \`true\`.`,
60
+ type: 'boolean'
61
+ },
62
+ checkGetters: {
63
+ default: false,
64
+ description: 'A value indicating whether getters should be checked. Defaults to `false`.',
65
+ type: 'boolean'
66
+ },
67
+ checkSetters: {
68
+ default: false,
69
+ description: 'A value indicating whether setters should be checked. Defaults to `false`.',
70
+ type: 'boolean'
71
+ },
72
+ contexts: {
73
+ description: `Set this to an array of strings representing the AST context (or an object with
74
+ optional \`context\` and \`comment\` properties) where you wish the rule to be applied.
75
+ (e.g., \`ClassDeclaration\` for ES6 classes).
76
+
77
+ \`context\` defaults to \`any\` and \`comment\` defaults to no specific comment context.
78
+
79
+ Overrides the default contexts (\`ArrowFunctionExpression\`, \`FunctionDeclaration\`,
80
+ \`FunctionExpression\`). Set to \`"any"\` if you want the rule to apply to any
81
+ JSDoc block throughout your files.
82
+
83
+ See the ["AST and Selectors"](../#advanced-ast-and-selectors)
84
+ section of our Advanced docs for more on the expected format.`,
85
+ items: {
86
+ anyOf: [{
87
+ type: 'string'
88
+ }, {
89
+ additionalProperties: false,
90
+ properties: {
91
+ comment: {
92
+ type: 'string'
93
+ },
94
+ context: {
95
+ type: 'string'
96
+ }
97
+ },
98
+ type: 'object'
99
+ }]
100
+ },
101
+ type: 'array'
102
+ },
103
+ enableFixer: {
104
+ default: true,
105
+ description: `A boolean on whether to enable the fixer (which adds an empty \`@example\` block).
106
+ Defaults to \`true\`.`,
107
+ type: 'boolean'
108
+ },
109
+ exemptedBy: {
110
+ description: `Array of tags (e.g., \`['type']\`) whose presence on the document
111
+ block avoids the need for an \`@example\`. Defaults to an array with
112
+ \`inheritdoc\`. If you set this array, it will overwrite the default,
113
+ so be sure to add back \`inheritdoc\` if you wish its presence to cause
114
+ exemption of the rule.`,
115
+ items: {
116
+ type: 'string'
117
+ },
118
+ type: 'array'
119
+ },
120
+ exemptNoArguments: {
121
+ default: false,
122
+ description: `Boolean to indicate that no-argument functions should not be reported for
123
+ missing \`@example\` declarations.`,
124
+ type: 'boolean'
125
+ }
126
+ },
127
+ type: 'object'
128
+ }],
129
+ type: 'suggestion'
130
+ }
131
+ });
132
+ module.exports = exports.default;
133
+ //# sourceMappingURL=requireExample.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requireExample.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","jsdoc","report","utils","avoidDocs","enableFixer","exemptNoArguments","options","targetTagName","functionExamples","tags","filter","tag","length","isIteratingFunctionOrVariable","hasParams","reportJSDoc","addTag","example","exampleContent","name","getTagDescription","trim","split","Boolean","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","properties","checkConstructors","type","checkGetters","checkSetters","contexts","items","anyOf","comment","exemptedBy","module"],"sources":["../../src/rules/requireExample.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n report,\n utils,\n}) => {\n if (utils.avoidDocs()) {\n return;\n }\n\n const {\n enableFixer = true,\n exemptNoArguments = false,\n } = context.options[0] || {};\n\n const targetTagName = 'example';\n\n const functionExamples = jsdoc.tags.filter(({\n tag,\n }) => {\n return tag === targetTagName;\n });\n\n if (!functionExamples.length) {\n if (exemptNoArguments && utils.isIteratingFunctionOrVariable() &&\n !utils.hasParams()\n ) {\n return;\n }\n\n utils.reportJSDoc(`Missing JSDoc @${targetTagName} declaration.`, null, () => {\n if (enableFixer) {\n utils.addTag(targetTagName);\n }\n });\n\n return;\n }\n\n for (const example of functionExamples) {\n const exampleContent = `${example.name} ${utils.getTagDescription(example)}`\n .trim()\n .split('\\n')\n .filter(Boolean);\n\n if (!exampleContent.length) {\n report(`Missing JSDoc @${targetTagName} description.`, null, example);\n }\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all functions (and potentially other contexts) have examples.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-example.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: true,\n description: `A value indicating whether \\`constructor\\`s should be checked.\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n checkGetters: {\n default: false,\n description: 'A value indicating whether getters should be checked. Defaults to `false`.',\n type: 'boolean',\n },\n checkSetters: {\n default: false,\n description: 'A value indicating whether setters should be checked. Defaults to `false`.',\n type: 'boolean',\n },\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n(e.g., \\`ClassDeclaration\\` for ES6 classes).\n\n\\`context\\` defaults to \\`any\\` and \\`comment\\` defaults to no specific comment context.\n\nOverrides the default contexts (\\`ArrowFunctionExpression\\`, \\`FunctionDeclaration\\`,\n\\`FunctionExpression\\`). Set to \\`\"any\"\\` if you want the rule to apply to any\nJSDoc block throughout your files.\n\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n default: true,\n description: `A boolean on whether to enable the fixer (which adds an empty \\`@example\\` block).\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n exemptedBy: {\n description: `Array of tags (e.g., \\`['type']\\`) whose presence on the document\nblock avoids the need for an \\`@example\\`. Defaults to an array with\n\\`inheritdoc\\`. If you set this array, it will overwrite the default,\nso be sure to add back \\`inheritdoc\\` if you wish its presence to cause\nexemption of the rule.`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n exemptNoArguments: {\n default: false,\n description: `Boolean to indicate that no-argument functions should not be reported for\nmissing \\`@example\\` declarations.`,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sB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uB;UACXW,KAAK,EAAE;YACLJ,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACD7B,iBAAiB,EAAE;UACjBV,OAAO,EAAE,KAAK;UACdgC,WAAW,EAAE;AACzB,mCAAmC;UACvBO,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAQ,MAAA,CAAA7C,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("eslint").Rule.RuleModule;
2
+ export default _default;
3
+ //# sourceMappingURL=requireExample.d.ts.map