eslint-plugin-jsdoc 53.0.1 → 54.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/dist/WarnSettings.cjs +35 -18
  2. package/dist/WarnSettings.cjs.map +1 -1
  3. package/dist/alignTransform.cjs +305 -224
  4. package/dist/alignTransform.cjs.map +1 -1
  5. package/dist/defaultTagOrder.cjs +43 -132
  6. package/dist/defaultTagOrder.cjs.map +1 -1
  7. package/dist/exportParser.cjs +696 -478
  8. package/dist/exportParser.cjs.map +1 -1
  9. package/dist/generateRule.cjs +242 -0
  10. package/dist/generateRule.cjs.map +1 -0
  11. package/dist/getDefaultTagStructureForMode.cjs +288 -184
  12. package/dist/getDefaultTagStructureForMode.cjs.map +1 -1
  13. package/dist/getJsdocProcessorPlugin.cjs +550 -364
  14. package/dist/getJsdocProcessorPlugin.cjs.map +1 -1
  15. package/dist/getJsdocProcessorPlugin.d.ts +65 -68
  16. package/dist/getJsdocProcessorPlugin.d.ts.map +1 -1
  17. package/dist/index.cjs +410 -2
  18. package/dist/index.cjs.map +1 -0
  19. package/dist/index.d.ts +17 -2
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/iterateJsdoc.cjs +2005 -1539
  22. package/dist/iterateJsdoc.cjs.map +1 -1
  23. package/dist/iterateJsdoc.d.ts +350 -359
  24. package/dist/iterateJsdoc.d.ts.map +1 -1
  25. package/dist/jsdocUtils.cjs +1376 -1009
  26. package/dist/jsdocUtils.cjs.map +1 -1
  27. package/dist/rules/checkAccess.cjs +36 -29
  28. package/dist/rules/checkAccess.cjs.map +1 -1
  29. package/dist/rules/checkAlignment.cjs +54 -41
  30. package/dist/rules/checkAlignment.cjs.map +1 -1
  31. package/dist/rules/checkExamples.cjs +484 -327
  32. package/dist/rules/checkExamples.cjs.map +1 -1
  33. package/dist/rules/checkIndentation.cjs +65 -50
  34. package/dist/rules/checkIndentation.cjs.map +1 -1
  35. package/dist/rules/checkLineAlignment.cjs +311 -220
  36. package/dist/rules/checkLineAlignment.cjs.map +1 -1
  37. package/dist/rules/checkParamNames.cjs +335 -227
  38. package/dist/rules/checkParamNames.cjs.map +1 -1
  39. package/dist/rules/checkPropertyNames.cjs +106 -78
  40. package/dist/rules/checkPropertyNames.cjs.map +1 -1
  41. package/dist/rules/checkSyntax.cjs +34 -21
  42. package/dist/rules/checkSyntax.cjs.map +1 -1
  43. package/dist/rules/checkTagNames.cjs +210 -188
  44. package/dist/rules/checkTagNames.cjs.map +1 -1
  45. package/dist/rules/checkTemplateNames.cjs +178 -121
  46. package/dist/rules/checkTemplateNames.cjs.map +1 -1
  47. package/dist/rules/checkTypes.cjs +385 -291
  48. package/dist/rules/checkTypes.cjs.map +1 -1
  49. package/dist/rules/checkValues.cjs +146 -100
  50. package/dist/rules/checkValues.cjs.map +1 -1
  51. package/dist/rules/convertToJsdocComments.cjs +306 -228
  52. package/dist/rules/convertToJsdocComments.cjs.map +1 -1
  53. package/dist/rules/emptyTags.cjs +72 -62
  54. package/dist/rules/emptyTags.cjs.map +1 -1
  55. package/dist/rules/implementsOnClasses.cjs +56 -36
  56. package/dist/rules/implementsOnClasses.cjs.map +1 -1
  57. package/dist/rules/importsAsDependencies.cjs +99 -62
  58. package/dist/rules/importsAsDependencies.cjs.map +1 -1
  59. package/dist/rules/informativeDocs.cjs +142 -105
  60. package/dist/rules/informativeDocs.cjs.map +1 -1
  61. package/dist/rules/linesBeforeBlock.cjs +105 -70
  62. package/dist/rules/linesBeforeBlock.cjs.map +1 -1
  63. package/dist/rules/matchDescription.cjs +222 -160
  64. package/dist/rules/matchDescription.cjs.map +1 -1
  65. package/dist/rules/matchName.cjs +128 -73
  66. package/dist/rules/matchName.cjs.map +1 -1
  67. package/dist/rules/multilineBlocks.cjs +352 -235
  68. package/dist/rules/multilineBlocks.cjs.map +1 -1
  69. package/dist/rules/noBadBlocks.cjs +86 -63
  70. package/dist/rules/noBadBlocks.cjs.map +1 -1
  71. package/dist/rules/noBlankBlockDescriptions.cjs +57 -35
  72. package/dist/rules/noBlankBlockDescriptions.cjs.map +1 -1
  73. package/dist/rules/noBlankBlocks.cjs +48 -26
  74. package/dist/rules/noBlankBlocks.cjs.map +1 -1
  75. package/dist/rules/noDefaults.cjs +79 -52
  76. package/dist/rules/noDefaults.cjs.map +1 -1
  77. package/dist/rules/noMissingSyntax.cjs +165 -115
  78. package/dist/rules/noMissingSyntax.cjs.map +1 -1
  79. package/dist/rules/noMultiAsterisks.cjs +89 -48
  80. package/dist/rules/noMultiAsterisks.cjs.map +1 -1
  81. package/dist/rules/noRestrictedSyntax.cjs +79 -45
  82. package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
  83. package/dist/rules/noTypes.cjs +80 -59
  84. package/dist/rules/noTypes.cjs.map +1 -1
  85. package/dist/rules/noUndefinedTypes.cjs +388 -297
  86. package/dist/rules/noUndefinedTypes.cjs.map +1 -1
  87. package/dist/rules/requireAsteriskPrefix.cjs +159 -108
  88. package/dist/rules/requireAsteriskPrefix.cjs.map +1 -1
  89. package/dist/rules/requireDescription.cjs +129 -89
  90. package/dist/rules/requireDescription.cjs.map +1 -1
  91. package/dist/rules/requireDescriptionCompleteSentence.cjs +262 -201
  92. package/dist/rules/requireDescriptionCompleteSentence.cjs.map +1 -1
  93. package/dist/rules/requireExample.cjs +104 -73
  94. package/dist/rules/requireExample.cjs.map +1 -1
  95. package/dist/rules/requireFileOverview.cjs +129 -75
  96. package/dist/rules/requireFileOverview.cjs.map +1 -1
  97. package/dist/rules/requireHyphenBeforeParamDescription.cjs +133 -85
  98. package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +1 -1
  99. package/dist/rules/requireJsdoc.cjs +557 -384
  100. package/dist/rules/requireJsdoc.cjs.map +1 -1
  101. package/dist/rules/requireParam.cjs +526 -336
  102. package/dist/rules/requireParam.cjs.map +1 -1
  103. package/dist/rules/requireParamDescription.cjs +80 -55
  104. package/dist/rules/requireParamDescription.cjs.map +1 -1
  105. package/dist/rules/requireParamName.cjs +50 -32
  106. package/dist/rules/requireParamName.cjs.map +1 -1
  107. package/dist/rules/requireParamType.cjs +80 -55
  108. package/dist/rules/requireParamType.cjs.map +1 -1
  109. package/dist/rules/requireProperty.cjs +42 -31
  110. package/dist/rules/requireProperty.cjs.map +1 -1
  111. package/dist/rules/requirePropertyDescription.cjs +25 -17
  112. package/dist/rules/requirePropertyDescription.cjs.map +1 -1
  113. package/dist/rules/requirePropertyName.cjs +25 -17
  114. package/dist/rules/requirePropertyName.cjs.map +1 -1
  115. package/dist/rules/requirePropertyType.cjs +25 -17
  116. package/dist/rules/requirePropertyType.cjs.map +1 -1
  117. package/dist/rules/requireReturns.cjs +203 -125
  118. package/dist/rules/requireReturns.cjs.map +1 -1
  119. package/dist/rules/requireReturnsCheck.cjs +103 -60
  120. package/dist/rules/requireReturnsCheck.cjs.map +1 -1
  121. package/dist/rules/requireReturnsDescription.cjs +54 -39
  122. package/dist/rules/requireReturnsDescription.cjs.map +1 -1
  123. package/dist/rules/requireReturnsType.cjs +50 -32
  124. package/dist/rules/requireReturnsType.cjs.map +1 -1
  125. package/dist/rules/requireTemplate.cjs +178 -119
  126. package/dist/rules/requireTemplate.cjs.map +1 -1
  127. package/dist/rules/requireThrows.cjs +95 -61
  128. package/dist/rules/requireThrows.cjs.map +1 -1
  129. package/dist/rules/requireYields.cjs +166 -106
  130. package/dist/rules/requireYields.cjs.map +1 -1
  131. package/dist/rules/requireYieldsCheck.cjs +152 -96
  132. package/dist/rules/requireYieldsCheck.cjs.map +1 -1
  133. package/dist/rules/sortTags.cjs +444 -258
  134. package/dist/rules/sortTags.cjs.map +1 -1
  135. package/dist/rules/tagLines.cjs +266 -179
  136. package/dist/rules/tagLines.cjs.map +1 -1
  137. package/dist/rules/textEscaping.cjs +127 -92
  138. package/dist/rules/textEscaping.cjs.map +1 -1
  139. package/dist/rules/validTypes.cjs +265 -252
  140. package/dist/rules/validTypes.cjs.map +1 -1
  141. package/dist/tagNames.cjs +170 -134
  142. package/dist/tagNames.cjs.map +1 -1
  143. package/dist/utils/hasReturnValue.cjs +474 -246
  144. package/dist/utils/hasReturnValue.cjs.map +1 -1
  145. package/package.json +24 -40
  146. package/src/WarnSettings.js +34 -0
  147. package/src/alignTransform.js +358 -0
  148. package/src/defaultTagOrder.js +169 -0
  149. package/src/exportParser.js +978 -0
  150. package/src/getDefaultTagStructureForMode.js +969 -0
  151. package/src/getJsdocProcessorPlugin.js +672 -0
  152. package/src/index.js +530 -0
  153. package/src/iterateJsdoc.js +2541 -0
  154. package/src/jsdocUtils.js +1896 -0
  155. package/src/rules/checkAccess.js +45 -0
  156. package/src/rules/checkAlignment.js +63 -0
  157. package/src/rules/checkExamples.js +589 -0
  158. package/src/rules/checkIndentation.js +75 -0
  159. package/src/rules/checkLineAlignment.js +372 -0
  160. package/src/rules/checkParamNames.js +474 -0
  161. package/src/rules/checkPropertyNames.js +152 -0
  162. package/src/rules/checkSyntax.js +30 -0
  163. package/src/rules/checkTagNames.js +314 -0
  164. package/src/rules/checkTemplateNames.js +204 -0
  165. package/src/rules/checkTypes.js +535 -0
  166. package/src/rules/checkValues.js +248 -0
  167. package/src/rules/convertToJsdocComments.js +398 -0
  168. package/src/rules/emptyTags.js +98 -0
  169. package/src/rules/implementsOnClasses.js +64 -0
  170. package/src/rules/importsAsDependencies.js +133 -0
  171. package/src/rules/informativeDocs.js +189 -0
  172. package/src/rules/linesBeforeBlock.js +134 -0
  173. package/src/rules/matchDescription.js +286 -0
  174. package/src/rules/matchName.js +151 -0
  175. package/src/rules/multilineBlocks.js +493 -0
  176. package/src/rules/noBadBlocks.js +119 -0
  177. package/src/rules/noBlankBlockDescriptions.js +69 -0
  178. package/src/rules/noBlankBlocks.js +53 -0
  179. package/src/rules/noDefaults.js +85 -0
  180. package/src/rules/noMissingSyntax.js +195 -0
  181. package/src/rules/noMultiAsterisks.js +134 -0
  182. package/src/rules/noRestrictedSyntax.js +91 -0
  183. package/src/rules/noTypes.js +93 -0
  184. package/src/rules/noUndefinedTypes.js +543 -0
  185. package/src/rules/requireAsteriskPrefix.js +190 -0
  186. package/src/rules/requireDescription.js +161 -0
  187. package/src/rules/requireDescriptionCompleteSentence.js +335 -0
  188. package/src/rules/requireExample.js +118 -0
  189. package/src/rules/requireFileOverview.js +154 -0
  190. package/src/rules/requireHyphenBeforeParamDescription.js +176 -0
  191. package/src/rules/requireJsdoc.js +743 -0
  192. package/src/rules/requireParam.js +602 -0
  193. package/src/rules/requireParamDescription.js +89 -0
  194. package/src/rules/requireParamName.js +55 -0
  195. package/src/rules/requireParamType.js +89 -0
  196. package/src/rules/requireProperty.js +48 -0
  197. package/src/rules/requirePropertyDescription.js +25 -0
  198. package/src/rules/requirePropertyName.js +25 -0
  199. package/src/rules/requirePropertyType.js +25 -0
  200. package/src/rules/requireReturns.js +238 -0
  201. package/src/rules/requireReturnsCheck.js +145 -0
  202. package/src/rules/requireReturnsDescription.js +59 -0
  203. package/src/rules/requireReturnsType.js +51 -0
  204. package/src/rules/requireTemplate.js +201 -0
  205. package/src/rules/requireThrows.js +111 -0
  206. package/src/rules/requireYields.js +216 -0
  207. package/src/rules/requireYieldsCheck.js +208 -0
  208. package/src/rules/sortTags.js +558 -0
  209. package/src/rules/tagLines.js +359 -0
  210. package/src/rules/textEscaping.js +154 -0
  211. package/src/rules/validTypes.js +401 -0
  212. package/src/tagNames.js +238 -0
  213. package/src/utils/hasReturnValue.js +572 -0
  214. package/dist/WarnSettings.js +0 -20
  215. package/dist/WarnSettings.js.map +0 -1
  216. package/dist/_virtual/rolldown_runtime.cjs +0 -32
  217. package/dist/_virtual/rolldown_runtime.js +0 -11
  218. package/dist/alignTransform.js +0 -241
  219. package/dist/alignTransform.js.map +0 -1
  220. package/dist/defaultTagOrder.js +0 -134
  221. package/dist/defaultTagOrder.js.map +0 -1
  222. package/dist/exportParser.js +0 -518
  223. package/dist/exportParser.js.map +0 -1
  224. package/dist/getDefaultTagStructureForMode.js +0 -188
  225. package/dist/getDefaultTagStructureForMode.js.map +0 -1
  226. package/dist/getJsdocProcessorPlugin.d.cts +0 -70
  227. package/dist/getJsdocProcessorPlugin.d.cts.map +0 -1
  228. package/dist/getJsdocProcessorPlugin.js +0 -383
  229. package/dist/getJsdocProcessorPlugin.js.map +0 -1
  230. package/dist/index.d.cts +0 -2
  231. package/dist/index.js +0 -3
  232. package/dist/iterateJsdoc.d.cts +0 -472
  233. package/dist/iterateJsdoc.d.cts.map +0 -1
  234. package/dist/iterateJsdoc.js +0 -1628
  235. package/dist/iterateJsdoc.js.map +0 -1
  236. package/dist/jsdocUtils.js +0 -1123
  237. package/dist/jsdocUtils.js.map +0 -1
  238. package/dist/plugin.cjs +0 -427
  239. package/dist/plugin.cjs.map +0 -1
  240. package/dist/plugin.js +0 -427
  241. package/dist/plugin.js.map +0 -1
  242. package/dist/rules/checkAccess.js +0 -33
  243. package/dist/rules/checkAccess.js.map +0 -1
  244. package/dist/rules/checkAlignment.js +0 -47
  245. package/dist/rules/checkAlignment.js.map +0 -1
  246. package/dist/rules/checkExamples.js +0 -348
  247. package/dist/rules/checkExamples.js.map +0 -1
  248. package/dist/rules/checkIndentation.js +0 -59
  249. package/dist/rules/checkIndentation.js.map +0 -1
  250. package/dist/rules/checkLineAlignment.js +0 -229
  251. package/dist/rules/checkLineAlignment.js.map +0 -1
  252. package/dist/rules/checkParamNames.js +0 -237
  253. package/dist/rules/checkParamNames.js.map +0 -1
  254. package/dist/rules/checkPropertyNames.js +0 -88
  255. package/dist/rules/checkPropertyNames.js.map +0 -1
  256. package/dist/rules/checkSyntax.js +0 -25
  257. package/dist/rules/checkSyntax.js.map +0 -1
  258. package/dist/rules/checkTagNames.js +0 -191
  259. package/dist/rules/checkTagNames.js.map +0 -1
  260. package/dist/rules/checkTemplateNames.js +0 -124
  261. package/dist/rules/checkTemplateNames.js.map +0 -1
  262. package/dist/rules/checkTypes.js +0 -299
  263. package/dist/rules/checkTypes.js.map +0 -1
  264. package/dist/rules/checkValues.js +0 -103
  265. package/dist/rules/checkValues.js.map +0 -1
  266. package/dist/rules/convertToJsdocComments.js +0 -231
  267. package/dist/rules/convertToJsdocComments.js.map +0 -1
  268. package/dist/rules/emptyTags.js +0 -67
  269. package/dist/rules/emptyTags.js.map +0 -1
  270. package/dist/rules/implementsOnClasses.js +0 -40
  271. package/dist/rules/implementsOnClasses.js.map +0 -1
  272. package/dist/rules/importsAsDependencies.js +0 -68
  273. package/dist/rules/importsAsDependencies.js.map +0 -1
  274. package/dist/rules/informativeDocs.js +0 -110
  275. package/dist/rules/informativeDocs.js.map +0 -1
  276. package/dist/rules/linesBeforeBlock.js +0 -75
  277. package/dist/rules/linesBeforeBlock.js.map +0 -1
  278. package/dist/rules/matchDescription.js +0 -167
  279. package/dist/rules/matchDescription.js.map +0 -1
  280. package/dist/rules/matchName.js +0 -77
  281. package/dist/rules/matchName.js.map +0 -1
  282. package/dist/rules/multilineBlocks.js +0 -245
  283. package/dist/rules/multilineBlocks.js.map +0 -1
  284. package/dist/rules/noBadBlocks.js +0 -68
  285. package/dist/rules/noBadBlocks.js.map +0 -1
  286. package/dist/rules/noBlankBlockDescriptions.js +0 -41
  287. package/dist/rules/noBlankBlockDescriptions.js.map +0 -1
  288. package/dist/rules/noBlankBlocks.js +0 -30
  289. package/dist/rules/noBlankBlocks.js.map +0 -1
  290. package/dist/rules/noDefaults.js +0 -56
  291. package/dist/rules/noDefaults.js.map +0 -1
  292. package/dist/rules/noMissingSyntax.js +0 -126
  293. package/dist/rules/noMissingSyntax.js.map +0 -1
  294. package/dist/rules/noMultiAsterisks.js +0 -58
  295. package/dist/rules/noMultiAsterisks.js.map +0 -1
  296. package/dist/rules/noRestrictedSyntax.js +0 -49
  297. package/dist/rules/noRestrictedSyntax.js.map +0 -1
  298. package/dist/rules/noTypes.js +0 -65
  299. package/dist/rules/noTypes.js.map +0 -1
  300. package/dist/rules/noUndefinedTypes.js +0 -303
  301. package/dist/rules/noUndefinedTypes.js.map +0 -1
  302. package/dist/rules/requireAsteriskPrefix.js +0 -112
  303. package/dist/rules/requireAsteriskPrefix.js.map +0 -1
  304. package/dist/rules/requireDescription.js +0 -95
  305. package/dist/rules/requireDescription.js.map +0 -1
  306. package/dist/rules/requireDescriptionCompleteSentence.js +0 -220
  307. package/dist/rules/requireDescriptionCompleteSentence.js.map +0 -1
  308. package/dist/rules/requireExample.js +0 -77
  309. package/dist/rules/requireExample.js.map +0 -1
  310. package/dist/rules/requireFileOverview.js +0 -81
  311. package/dist/rules/requireFileOverview.js.map +0 -1
  312. package/dist/rules/requireHyphenBeforeParamDescription.js +0 -89
  313. package/dist/rules/requireHyphenBeforeParamDescription.js.map +0 -1
  314. package/dist/rules/requireJsdoc.js +0 -404
  315. package/dist/rules/requireJsdoc.js.map +0 -1
  316. package/dist/rules/requireParam.js +0 -344
  317. package/dist/rules/requireParam.js.map +0 -1
  318. package/dist/rules/requireParamDescription.js +0 -59
  319. package/dist/rules/requireParamDescription.js.map +0 -1
  320. package/dist/rules/requireParamName.js +0 -36
  321. package/dist/rules/requireParamName.js.map +0 -1
  322. package/dist/rules/requireParamType.js +0 -59
  323. package/dist/rules/requireParamType.js.map +0 -1
  324. package/dist/rules/requireProperty.js +0 -35
  325. package/dist/rules/requireProperty.js.map +0 -1
  326. package/dist/rules/requirePropertyDescription.js +0 -21
  327. package/dist/rules/requirePropertyDescription.js.map +0 -1
  328. package/dist/rules/requirePropertyName.js +0 -21
  329. package/dist/rules/requirePropertyName.js.map +0 -1
  330. package/dist/rules/requirePropertyType.js +0 -21
  331. package/dist/rules/requirePropertyType.js.map +0 -1
  332. package/dist/rules/requireReturns.js +0 -131
  333. package/dist/rules/requireReturns.js.map +0 -1
  334. package/dist/rules/requireReturnsCheck.js +0 -66
  335. package/dist/rules/requireReturnsCheck.js.map +0 -1
  336. package/dist/rules/requireReturnsDescription.js +0 -43
  337. package/dist/rules/requireReturnsDescription.js.map +0 -1
  338. package/dist/rules/requireReturnsType.js +0 -36
  339. package/dist/rules/requireReturnsType.js.map +0 -1
  340. package/dist/rules/requireTemplate.js +0 -122
  341. package/dist/rules/requireTemplate.js.map +0 -1
  342. package/dist/rules/requireThrows.js +0 -67
  343. package/dist/rules/requireThrows.js.map +0 -1
  344. package/dist/rules/requireYields.js +0 -115
  345. package/dist/rules/requireYields.js.map +0 -1
  346. package/dist/rules/requireYieldsCheck.js +0 -105
  347. package/dist/rules/requireYieldsCheck.js.map +0 -1
  348. package/dist/rules/sortTags.js +0 -262
  349. package/dist/rules/sortTags.js.map +0 -1
  350. package/dist/rules/tagLines.js +0 -183
  351. package/dist/rules/tagLines.js.map +0 -1
  352. package/dist/rules/textEscaping.js +0 -102
  353. package/dist/rules/textEscaping.js.map +0 -1
  354. package/dist/rules/validTypes.js +0 -259
  355. package/dist/rules/validTypes.js.map +0 -1
  356. package/dist/tagNames.js +0 -144
  357. package/dist/tagNames.js.map +0 -1
  358. package/dist/utils/hasReturnValue.js +0 -265
  359. package/dist/utils/hasReturnValue.js.map +0 -1
@@ -1,21 +1,38 @@
1
+ "use strict";
1
2
 
2
- //#region src/WarnSettings.js
3
- const WarnSettings = function() {
4
- /** @type {WeakMap<object, Set<string>>} */
5
- const warnedSettings = /* @__PURE__ */ new WeakMap();
6
- return {
7
- hasBeenWarned(context, setting) {
8
- return warnedSettings.has(context) && warnedSettings.get(context).has(setting);
9
- },
10
- markSettingAsWarned(context, setting) {
11
- // c8 ignore else
12
- if (!warnedSettings.has(context)) warnedSettings.set(context, /* @__PURE__ */ new Set());
13
- /** @type {Set<string>} */ warnedSettings.get(context).add(setting);
14
- }
15
- };
16
- };
17
- var WarnSettings_default = WarnSettings;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ const WarnSettings = function () {
8
+ /** @type {WeakMap<object, Set<string>>} */
9
+ const warnedSettings = new WeakMap();
10
+ return {
11
+ /**
12
+ * Warn only once for each context and setting
13
+ * @param {{}} context
14
+ * @param {string} setting
15
+ * @returns {boolean}
16
+ */
17
+ hasBeenWarned(context, setting) {
18
+ return warnedSettings.has(context) && /** @type {Set<string>} */warnedSettings.get(context).has(setting);
19
+ },
20
+ /**
21
+ * @param {{}} context
22
+ * @param {string} setting
23
+ * @returns {void}
24
+ */
25
+ markSettingAsWarned(context, setting) {
26
+ // c8 ignore else
27
+ if (!warnedSettings.has(context)) {
28
+ warnedSettings.set(context, new Set());
29
+ }
18
30
 
19
- //#endregion
20
- exports.default = WarnSettings_default;
31
+ /** @type {Set<string>} */
32
+ warnedSettings.get(context).add(setting);
33
+ }
34
+ };
35
+ };
36
+ var _default = exports.default = WarnSettings;
37
+ module.exports = exports.default;
21
38
  //# sourceMappingURL=WarnSettings.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"WarnSettings.cjs","names":[],"sources":["../src/WarnSettings.js"],"sourcesContent":["const WarnSettings = function () {\n /** @type {WeakMap<object, Set<string>>} */\n const warnedSettings = new WeakMap();\n\n return {\n /**\n * Warn only once for each context and setting\n * @param {{}} context\n * @param {string} setting\n * @returns {boolean}\n */\n hasBeenWarned (context, setting) {\n return warnedSettings.has(context) && /** @type {Set<string>} */ (\n warnedSettings.get(context)\n ).has(setting);\n },\n\n /**\n * @param {{}} context\n * @param {string} setting\n * @returns {void}\n */\n markSettingAsWarned (context, setting) {\n // c8 ignore else\n if (!warnedSettings.has(context)) {\n warnedSettings.set(context, new Set());\n }\n\n /** @type {Set<string>} */ (warnedSettings.get(context)).add(setting);\n },\n };\n};\n\nexport default WarnSettings;\n"],"mappings":";;AAAA,MAAM,eAAe,WAAY;;CAE/B,MAAM,iCAAiB,IAAI;AAE3B,QAAO;EAOL,cAAe,SAAS,SAAS;AAC/B,UAAO,eAAe,IAAI,QAAQ,IAChC,eAAe,IAAI,QAAQ,CAC3B,IAAI,QAAQ;EACf;EAOD,oBAAqB,SAAS,SAAS;;AAErC,OAAI,CAAC,eAAe,IAAI,QAAQ,EAC9B,eAAe,IAAI,yBAAS,IAAI,MAAM;8BAGZ,eAAe,IAAI,QAAQ,CAAE,IAAI,QAAQ;EACtE;CACF;AACF;AAED,2BAAe"}
1
+ {"version":3,"file":"WarnSettings.cjs","names":["WarnSettings","warnedSettings","WeakMap","hasBeenWarned","context","setting","has","get","markSettingAsWarned","set","Set","add","_default","exports","default","module"],"sources":["../src/WarnSettings.js"],"sourcesContent":["const WarnSettings = function () {\n /** @type {WeakMap<object, Set<string>>} */\n const warnedSettings = new WeakMap();\n\n return {\n /**\n * Warn only once for each context and setting\n * @param {{}} context\n * @param {string} setting\n * @returns {boolean}\n */\n hasBeenWarned (context, setting) {\n return warnedSettings.has(context) && /** @type {Set<string>} */ (\n warnedSettings.get(context)\n ).has(setting);\n },\n\n /**\n * @param {{}} context\n * @param {string} setting\n * @returns {void}\n */\n markSettingAsWarned (context, setting) {\n // c8 ignore else\n if (!warnedSettings.has(context)) {\n warnedSettings.set(context, new Set());\n }\n\n /** @type {Set<string>} */ (warnedSettings.get(context)).add(setting);\n },\n };\n};\n\nexport default WarnSettings;\n"],"mappings":";;;;;;AAAA,MAAMA,YAAY,GAAG,SAAAA,CAAA,EAAY;EAC/B;EACA,MAAMC,cAAc,GAAG,IAAIC,OAAO,CAAC,CAAC;EAEpC,OAAO;IACL;AACJ;AACA;AACA;AACA;AACA;IACIC,aAAaA,CAAEC,OAAO,EAAEC,OAAO,EAAE;MAC/B,OAAOJ,cAAc,CAACK,GAAG,CAACF,OAAO,CAAC,IAAI,0BACpCH,cAAc,CAACM,GAAG,CAACH,OAAO,CAAC,CAC3BE,GAAG,CAACD,OAAO,CAAC;IAChB,CAAC;IAED;AACJ;AACA;AACA;AACA;IACIG,mBAAmBA,CAAEJ,OAAO,EAAEC,OAAO,EAAE;MACrC;MACA,IAAI,CAACJ,cAAc,CAACK,GAAG,CAACF,OAAO,CAAC,EAAE;QAChCH,cAAc,CAACQ,GAAG,CAACL,OAAO,EAAE,IAAIM,GAAG,CAAC,CAAC,CAAC;MACxC;;MAEA;MAA4BT,cAAc,CAACM,GAAG,CAACH,OAAO,CAAC,CAAEO,GAAG,CAACN,OAAO,CAAC;IACvE;EACF,CAAC;AACH,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,YAAY;AAAAe,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA","ignoreList":[]}
@@ -1,242 +1,323 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
- const comment_parser = require_rolldown_runtime.__toESM(require("comment-parser"));
1
+ "use strict";
3
2
 
4
- //#region src/alignTransform.js
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _commentParser = require("comment-parser");
5
8
  /**
6
- * @typedef {{
7
- * hasNoTypes: boolean,
8
- * maxNamedTagLength: import('./iterateJsdoc.js').Integer,
9
- * maxUnnamedTagLength: import('./iterateJsdoc.js').Integer
10
- * }} TypelessInfo
11
- */
12
- const { rewireSource } = comment_parser.util;
9
+ * Transform based on https://github.com/syavorsky/comment-parser/blob/master/src/transforms/align.ts
10
+ *
11
+ * It contains some customizations to align based on the tags, and some custom options.
12
+ */
13
+
13
14
  /**
14
- * @typedef {{
15
- * name: import('./iterateJsdoc.js').Integer,
16
- * start: import('./iterateJsdoc.js').Integer,
17
- * tag: import('./iterateJsdoc.js').Integer,
18
- * type: import('./iterateJsdoc.js').Integer
19
- * }} Width
20
- */
15
+ * @typedef {{
16
+ * hasNoTypes: boolean,
17
+ * maxNamedTagLength: import('./iterateJsdoc.js').Integer,
18
+ * maxUnnamedTagLength: import('./iterateJsdoc.js').Integer
19
+ * }} TypelessInfo
20
+ */
21
+
22
+ const {
23
+ rewireSource
24
+ } = _commentParser.util;
25
+
26
+ /**
27
+ * @typedef {{
28
+ * name: import('./iterateJsdoc.js').Integer,
29
+ * start: import('./iterateJsdoc.js').Integer,
30
+ * tag: import('./iterateJsdoc.js').Integer,
31
+ * type: import('./iterateJsdoc.js').Integer
32
+ * }} Width
33
+ */
34
+
21
35
  /** @type {Width} */
22
36
  const zeroWidth = {
23
- name: 0,
24
- start: 0,
25
- tag: 0,
26
- type: 0
37
+ name: 0,
38
+ start: 0,
39
+ tag: 0,
40
+ type: 0
27
41
  };
42
+
28
43
  /**
29
- * @param {string[]} tags
30
- * @param {import('./iterateJsdoc.js').Integer} index
31
- * @param {import('comment-parser').Line[]} source
32
- * @returns {boolean}
33
- */
44
+ * @param {string[]} tags
45
+ * @param {import('./iterateJsdoc.js').Integer} index
46
+ * @param {import('comment-parser').Line[]} source
47
+ * @returns {boolean}
48
+ */
34
49
  const shouldAlign = (tags, index, source) => {
35
- const tag = source[index].tokens.tag.replace("@", "");
36
- const includesTag = tags.includes(tag);
37
- if (includesTag) return true;
38
- if (tag !== "") return false;
39
- for (let iterator = index; iterator >= 0; iterator--) {
40
- const previousTag = source[iterator].tokens.tag.replace("@", "");
41
- if (previousTag !== "") {
42
- if (tags.includes(previousTag)) return true;
43
- return false;
44
- }
45
- }
46
- return true;
50
+ const tag = source[index].tokens.tag.replace('@', '');
51
+ const includesTag = tags.includes(tag);
52
+ if (includesTag) {
53
+ return true;
54
+ }
55
+ if (tag !== '') {
56
+ return false;
57
+ }
58
+ for (let iterator = index; iterator >= 0; iterator--) {
59
+ const previousTag = source[iterator].tokens.tag.replace('@', '');
60
+ if (previousTag !== '') {
61
+ if (tags.includes(previousTag)) {
62
+ return true;
63
+ }
64
+ return false;
65
+ }
66
+ }
67
+ return true;
47
68
  };
69
+
48
70
  /**
49
- * @param {string[]} tags
50
- * @returns {(
51
- * width: Width,
52
- * line: {
53
- * tokens: import('comment-parser').Tokens
54
- * },
55
- * index: import('./iterateJsdoc.js').Integer,
56
- * source: import('comment-parser').Line[]
57
- * ) => Width}
58
- */
59
- const getWidth = (tags) => {
60
- return (width, { tokens }, index, source) => {
61
- if (!shouldAlign(tags, index, source)) return width;
62
- return {
63
- name: Math.max(width.name, tokens.name.length),
64
- start: tokens.delimiter === "/**" ? tokens.start.length : width.start,
65
- tag: Math.max(width.tag, tokens.tag.length),
66
- type: Math.max(width.type, tokens.type.length)
67
- };
68
- };
71
+ * @param {string[]} tags
72
+ * @returns {(
73
+ * width: Width,
74
+ * line: {
75
+ * tokens: import('comment-parser').Tokens
76
+ * },
77
+ * index: import('./iterateJsdoc.js').Integer,
78
+ * source: import('comment-parser').Line[]
79
+ * ) => Width}
80
+ */
81
+ const getWidth = tags => {
82
+ return (width, {
83
+ tokens
84
+ }, index, source) => {
85
+ if (!shouldAlign(tags, index, source)) {
86
+ return width;
87
+ }
88
+ return {
89
+ name: Math.max(width.name, tokens.name.length),
90
+ start: tokens.delimiter === '/**' ? tokens.start.length : width.start,
91
+ tag: Math.max(width.tag, tokens.tag.length),
92
+ type: Math.max(width.type, tokens.type.length)
93
+ };
94
+ };
69
95
  };
96
+
70
97
  /**
71
- * @param {{
72
- * description: string;
73
- * tags: import('comment-parser').Spec[];
74
- * problems: import('comment-parser').Problem[];
75
- * }} fields
76
- * @returns {TypelessInfo}
77
- */
78
- const getTypelessInfo = (fields) => {
79
- const hasNoTypes = fields.tags.every(({ type }) => {
80
- return !type;
81
- });
82
- const maxNamedTagLength = Math.max(...fields.tags.map(({ name, tag }) => {
83
- return name.length === 0 ? -1 : tag.length;
84
- }).filter((length) => {
85
- return length !== -1;
86
- })) + 1;
87
- const maxUnnamedTagLength = Math.max(...fields.tags.map(({ name, tag }) => {
88
- return name.length === 0 ? tag.length : -1;
89
- }).filter((length) => {
90
- return length !== -1;
91
- })) + 1;
92
- return {
93
- hasNoTypes,
94
- maxNamedTagLength,
95
- maxUnnamedTagLength
96
- };
98
+ * @param {{
99
+ * description: string;
100
+ * tags: import('comment-parser').Spec[];
101
+ * problems: import('comment-parser').Problem[];
102
+ * }} fields
103
+ * @returns {TypelessInfo}
104
+ */
105
+ const getTypelessInfo = fields => {
106
+ const hasNoTypes = fields.tags.every(({
107
+ type
108
+ }) => {
109
+ return !type;
110
+ });
111
+ const maxNamedTagLength = Math.max(...fields.tags.map(({
112
+ name,
113
+ tag
114
+ }) => {
115
+ return name.length === 0 ? -1 : tag.length;
116
+ }).filter(length => {
117
+ return length !== -1;
118
+ })) + 1;
119
+ const maxUnnamedTagLength = Math.max(...fields.tags.map(({
120
+ name,
121
+ tag
122
+ }) => {
123
+ return name.length === 0 ? tag.length : -1;
124
+ }).filter(length => {
125
+ return length !== -1;
126
+ })) + 1;
127
+ return {
128
+ hasNoTypes,
129
+ maxNamedTagLength,
130
+ maxUnnamedTagLength
131
+ };
97
132
  };
133
+
98
134
  /**
99
- * @param {import('./iterateJsdoc.js').Integer} len
100
- * @returns {string}
101
- */
102
- const space = (len) => {
103
- return "".padStart(len, " ");
135
+ * @param {import('./iterateJsdoc.js').Integer} len
136
+ * @returns {string}
137
+ */
138
+ const space = len => {
139
+ return ''.padStart(len, ' ');
104
140
  };
141
+
105
142
  /**
106
- * @param {{
107
- * customSpacings: import('../src/rules/checkLineAlignment.js').CustomSpacings,
108
- * tags: string[],
109
- * indent: string,
110
- * preserveMainDescriptionPostDelimiter: boolean,
111
- * wrapIndent: string,
112
- * disableWrapIndent: boolean,
113
- * }} cfg
114
- * @returns {(
115
- * block: import('comment-parser').Block
116
- * ) => import('comment-parser').Block}
117
- */
118
- const alignTransform = ({ customSpacings, disableWrapIndent, indent, preserveMainDescriptionPostDelimiter, tags, wrapIndent }) => {
119
- let intoTags = false;
120
- /** @type {Width} */
121
- let width;
122
- /**
123
- * @param {import('comment-parser').Tokens} tokens
124
- * @param {TypelessInfo} typelessInfo
125
- * @returns {import('comment-parser').Tokens}
126
- */
127
- const alignTokens = (tokens, typelessInfo) => {
128
- const nothingAfter = {
129
- delim: false,
130
- name: false,
131
- tag: false,
132
- type: false
133
- };
134
- if (tokens.description === "") {
135
- nothingAfter.name = true;
136
- tokens.postName = "";
137
- if (tokens.name === "") {
138
- nothingAfter.type = true;
139
- tokens.postType = "";
140
- if (tokens.type === "") {
141
- nothingAfter.tag = true;
142
- tokens.postTag = "";
143
- /* c8 ignore next: Never happens because the !intoTags return. But it's here for consistency with the original align transform */
144
- if (tokens.tag === "") nothingAfter.delim = true;
145
- }
146
- }
147
- }
148
- let untypedNameAdjustment = 0;
149
- let untypedTypeAdjustment = 0;
150
- if (typelessInfo.hasNoTypes) {
151
- nothingAfter.tag = true;
152
- tokens.postTag = "";
153
- if (tokens.name === "") untypedNameAdjustment = typelessInfo.maxNamedTagLength - tokens.tag.length;
154
- else {
155
- untypedNameAdjustment = typelessInfo.maxNamedTagLength > typelessInfo.maxUnnamedTagLength ? 0 : Math.max(0, typelessInfo.maxUnnamedTagLength - (tokens.tag.length + tokens.name.length + 1));
156
- untypedTypeAdjustment = typelessInfo.maxNamedTagLength - tokens.tag.length;
157
- }
158
- }
159
- if (tokens.tag === "" && tokens.type) return tokens;
160
- const spacings = {
161
- postDelimiter: customSpacings?.postDelimiter || 1,
162
- postName: customSpacings?.postName || 1,
163
- postTag: customSpacings?.postTag || 1,
164
- postType: customSpacings?.postType || 1
165
- };
166
- tokens.postDelimiter = nothingAfter.delim ? "" : space(spacings.postDelimiter);
167
- if (!nothingAfter.tag) tokens.postTag = space(width.tag - tokens.tag.length + spacings.postTag);
168
- if (!nothingAfter.type) tokens.postType = space(width.type - tokens.type.length + spacings.postType + untypedTypeAdjustment);
169
- if (!nothingAfter.name) tokens.postName = width.name === 0 ? "" : space(width.name - tokens.name.length + spacings.postName + untypedNameAdjustment);
170
- return tokens;
171
- };
172
- /**
173
- * @param {import('comment-parser').Line} line
174
- * @param {import('./iterateJsdoc.js').Integer} index
175
- * @param {import('comment-parser').Line[]} source
176
- * @param {TypelessInfo} typelessInfo
177
- * @param {string|false} indentTag
178
- * @returns {import('comment-parser').Line}
179
- */
180
- const update = (line, index, source, typelessInfo, indentTag) => {
181
- /** @type {import('comment-parser').Tokens} */
182
- const tokens = { ...line.tokens };
183
- if (tokens.tag !== "") intoTags = true;
184
- const isEmpty = tokens.tag === "" && tokens.name === "" && tokens.type === "" && tokens.description === "";
185
- if (tokens.end === "*/" && isEmpty) {
186
- tokens.start = indent + " ";
187
- return {
188
- ...line,
189
- tokens
190
- };
191
- }
192
- switch (tokens.delimiter) {
193
- case "*":
194
- tokens.start = indent + " ";
195
- break;
196
- case "/**":
197
- tokens.start = indent;
198
- break;
199
- default:
200
- tokens.delimiter = "";
201
- tokens.start = indent + " ";
202
- }
203
- if (!intoTags) {
204
- if (tokens.description === "") tokens.postDelimiter = "";
205
- else if (!preserveMainDescriptionPostDelimiter) tokens.postDelimiter = " ";
206
- return {
207
- ...line,
208
- tokens
209
- };
210
- }
211
- const postHyphenSpacing = customSpacings?.postHyphen ?? 1;
212
- const hyphenSpacing = /^\s*-\s+/v;
213
- tokens.description = tokens.description.replace(hyphenSpacing, "-" + "".padStart(postHyphenSpacing, " "));
214
- if (shouldAlign(tags, index, source)) {
215
- alignTokens(tokens, typelessInfo);
216
- if (!disableWrapIndent && indentTag) tokens.postDelimiter += wrapIndent;
217
- }
218
- return {
219
- ...line,
220
- tokens
221
- };
222
- };
223
- return ({ source,...fields }) => {
224
- width = source.reduce(getWidth(tags), { ...zeroWidth });
225
- const typelessInfo = getTypelessInfo(fields);
226
- let tagIndentMode = false;
227
- return rewireSource({
228
- ...fields,
229
- source: source.map((line, index) => {
230
- const indentTag = !disableWrapIndent && tagIndentMode && !line.tokens.tag && line.tokens.description;
231
- const ret = update(line, index, source, typelessInfo, indentTag);
232
- if (!disableWrapIndent && line.tokens.tag) tagIndentMode = true;
233
- return ret;
234
- })
235
- });
236
- };
237
- };
238
- var alignTransform_default = alignTransform;
143
+ * @param {{
144
+ * customSpacings: import('../src/rules/checkLineAlignment.js').CustomSpacings,
145
+ * tags: string[],
146
+ * indent: string,
147
+ * preserveMainDescriptionPostDelimiter: boolean,
148
+ * wrapIndent: string,
149
+ * disableWrapIndent: boolean,
150
+ * }} cfg
151
+ * @returns {(
152
+ * block: import('comment-parser').Block
153
+ * ) => import('comment-parser').Block}
154
+ */
155
+ const alignTransform = ({
156
+ customSpacings,
157
+ disableWrapIndent,
158
+ indent,
159
+ preserveMainDescriptionPostDelimiter,
160
+ tags,
161
+ wrapIndent
162
+ }) => {
163
+ let intoTags = false;
164
+ /** @type {Width} */
165
+ let width;
166
+
167
+ /**
168
+ * @param {import('comment-parser').Tokens} tokens
169
+ * @param {TypelessInfo} typelessInfo
170
+ * @returns {import('comment-parser').Tokens}
171
+ */
172
+ const alignTokens = (tokens, typelessInfo) => {
173
+ const nothingAfter = {
174
+ delim: false,
175
+ name: false,
176
+ tag: false,
177
+ type: false
178
+ };
179
+ if (tokens.description === '') {
180
+ nothingAfter.name = true;
181
+ tokens.postName = '';
182
+ if (tokens.name === '') {
183
+ nothingAfter.type = true;
184
+ tokens.postType = '';
185
+ if (tokens.type === '') {
186
+ nothingAfter.tag = true;
187
+ tokens.postTag = '';
188
+
189
+ /* c8 ignore next: Never happens because the !intoTags return. But it's here for consistency with the original align transform */
190
+ if (tokens.tag === '') {
191
+ nothingAfter.delim = true;
192
+ }
193
+ }
194
+ }
195
+ }
196
+ let untypedNameAdjustment = 0;
197
+ let untypedTypeAdjustment = 0;
198
+ if (typelessInfo.hasNoTypes) {
199
+ nothingAfter.tag = true;
200
+ tokens.postTag = '';
201
+ if (tokens.name === '') {
202
+ untypedNameAdjustment = typelessInfo.maxNamedTagLength - tokens.tag.length;
203
+ } else {
204
+ untypedNameAdjustment = typelessInfo.maxNamedTagLength > typelessInfo.maxUnnamedTagLength ? 0 : Math.max(0, typelessInfo.maxUnnamedTagLength - (tokens.tag.length + tokens.name.length + 1));
205
+ untypedTypeAdjustment = typelessInfo.maxNamedTagLength - tokens.tag.length;
206
+ }
207
+ }
208
+
209
+ // Todo: Avoid fixing alignment of blocks with multiline wrapping of type
210
+ if (tokens.tag === '' && tokens.type) {
211
+ return tokens;
212
+ }
213
+ const spacings = {
214
+ postDelimiter: customSpacings?.postDelimiter || 1,
215
+ postName: customSpacings?.postName || 1,
216
+ postTag: customSpacings?.postTag || 1,
217
+ postType: customSpacings?.postType || 1
218
+ };
219
+ tokens.postDelimiter = nothingAfter.delim ? '' : space(spacings.postDelimiter);
220
+ if (!nothingAfter.tag) {
221
+ tokens.postTag = space(width.tag - tokens.tag.length + spacings.postTag);
222
+ }
223
+ if (!nothingAfter.type) {
224
+ tokens.postType = space(width.type - tokens.type.length + spacings.postType + untypedTypeAdjustment);
225
+ }
226
+ if (!nothingAfter.name) {
227
+ // If post name is empty for all lines (name width 0), don't add post name spacing.
228
+ tokens.postName = width.name === 0 ? '' : space(width.name - tokens.name.length + spacings.postName + untypedNameAdjustment);
229
+ }
230
+ return tokens;
231
+ };
239
232
 
240
- //#endregion
241
- exports.default = alignTransform_default;
233
+ /**
234
+ * @param {import('comment-parser').Line} line
235
+ * @param {import('./iterateJsdoc.js').Integer} index
236
+ * @param {import('comment-parser').Line[]} source
237
+ * @param {TypelessInfo} typelessInfo
238
+ * @param {string|false} indentTag
239
+ * @returns {import('comment-parser').Line}
240
+ */
241
+ const update = (line, index, source, typelessInfo, indentTag) => {
242
+ /** @type {import('comment-parser').Tokens} */
243
+ const tokens = {
244
+ ...line.tokens
245
+ };
246
+ if (tokens.tag !== '') {
247
+ intoTags = true;
248
+ }
249
+ const isEmpty = tokens.tag === '' && tokens.name === '' && tokens.type === '' && tokens.description === '';
250
+
251
+ // dangling '*/'
252
+ if (tokens.end === '*/' && isEmpty) {
253
+ tokens.start = indent + ' ';
254
+ return {
255
+ ...line,
256
+ tokens
257
+ };
258
+ }
259
+ switch (tokens.delimiter) {
260
+ case '*':
261
+ tokens.start = indent + ' ';
262
+ break;
263
+ case '/**':
264
+ tokens.start = indent;
265
+ break;
266
+ default:
267
+ tokens.delimiter = '';
268
+
269
+ // compensate delimiter
270
+ tokens.start = indent + ' ';
271
+ }
272
+ if (!intoTags) {
273
+ if (tokens.description === '') {
274
+ tokens.postDelimiter = '';
275
+ } else if (!preserveMainDescriptionPostDelimiter) {
276
+ tokens.postDelimiter = ' ';
277
+ }
278
+ return {
279
+ ...line,
280
+ tokens
281
+ };
282
+ }
283
+ const postHyphenSpacing = customSpacings?.postHyphen ?? 1;
284
+ const hyphenSpacing = /^\s*-\s+/v;
285
+ tokens.description = tokens.description.replace(hyphenSpacing, '-' + ''.padStart(postHyphenSpacing, ' '));
286
+
287
+ // Not align.
288
+ if (shouldAlign(tags, index, source)) {
289
+ alignTokens(tokens, typelessInfo);
290
+ if (!disableWrapIndent && indentTag) {
291
+ tokens.postDelimiter += wrapIndent;
292
+ }
293
+ }
294
+ return {
295
+ ...line,
296
+ tokens
297
+ };
298
+ };
299
+ return ({
300
+ source,
301
+ ...fields
302
+ }) => {
303
+ width = source.reduce(getWidth(tags), {
304
+ ...zeroWidth
305
+ });
306
+ const typelessInfo = getTypelessInfo(fields);
307
+ let tagIndentMode = false;
308
+ return rewireSource({
309
+ ...fields,
310
+ source: source.map((line, index) => {
311
+ const indentTag = !disableWrapIndent && tagIndentMode && !line.tokens.tag && line.tokens.description;
312
+ const ret = update(line, index, source, typelessInfo, indentTag);
313
+ if (!disableWrapIndent && line.tokens.tag) {
314
+ tagIndentMode = true;
315
+ }
316
+ return ret;
317
+ })
318
+ });
319
+ };
320
+ };
321
+ var _default = exports.default = alignTransform;
322
+ module.exports = exports.default;
242
323
  //# sourceMappingURL=alignTransform.cjs.map