eslint-plugin-jsdoc 63.3.3 → 64.0.1

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 (270) hide show
  1. package/dist/index.d.ts +14 -0
  2. package/package.json +23 -48
  3. package/src/index.js +22 -6
  4. package/dist/WarnSettings.cjs +0 -38
  5. package/dist/WarnSettings.cjs.map +0 -1
  6. package/dist/alignTransform.cjs +0 -402
  7. package/dist/alignTransform.cjs.map +0 -1
  8. package/dist/buildForbidRuleDefinition.cjs +0 -101
  9. package/dist/buildForbidRuleDefinition.cjs.map +0 -1
  10. package/dist/buildRejectOrPreferRuleDefinition.cjs +0 -352
  11. package/dist/buildRejectOrPreferRuleDefinition.cjs.map +0 -1
  12. package/dist/cjs/WarnSettings.d.ts +0 -16
  13. package/dist/cjs/alignTransform.d.ts +0 -33
  14. package/dist/cjs/buildForbidRuleDefinition.d.ts +0 -14
  15. package/dist/cjs/buildRejectOrPreferRuleDefinition.d.ts +0 -8
  16. package/dist/cjs/defaultTagOrder.d.ts +0 -4
  17. package/dist/cjs/exportParser.d.ts +0 -40
  18. package/dist/cjs/getDefaultTagStructureForMode.d.ts +0 -10
  19. package/dist/cjs/getJsdocProcessorPlugin.d.cts +0 -5
  20. package/dist/cjs/getJsdocProcessorPlugin.d.ts +0 -66
  21. package/dist/cjs/index-cjs.d.ts +0 -26
  22. package/dist/cjs/index.cjs.d.cts +0 -2
  23. package/dist/cjs/iterateJsdoc.d.cts +0 -7
  24. package/dist/cjs/iterateJsdoc.d.ts +0 -495
  25. package/dist/cjs/jsdocUtils.d.ts +0 -500
  26. package/dist/cjs/rules/checkAccess.d.ts +0 -2
  27. package/dist/cjs/rules/checkAlignment.d.ts +0 -2
  28. package/dist/cjs/rules/checkExamples.d.ts +0 -3
  29. package/dist/cjs/rules/checkIndentation.d.ts +0 -2
  30. package/dist/cjs/rules/checkLineAlignment.d.ts +0 -9
  31. package/dist/cjs/rules/checkParamNames.d.ts +0 -2
  32. package/dist/cjs/rules/checkPropertyNames.d.ts +0 -2
  33. package/dist/cjs/rules/checkSyntax.d.ts +0 -2
  34. package/dist/cjs/rules/checkTagNames.d.ts +0 -2
  35. package/dist/cjs/rules/checkTemplateNames.d.ts +0 -2
  36. package/dist/cjs/rules/checkTypes.d.ts +0 -7
  37. package/dist/cjs/rules/checkValues.d.ts +0 -2
  38. package/dist/cjs/rules/convertToJsdocComments.d.ts +0 -266
  39. package/dist/cjs/rules/emptyTags.d.ts +0 -2
  40. package/dist/cjs/rules/escapeInlineTags.d.ts +0 -2
  41. package/dist/cjs/rules/implementsOnClasses.d.ts +0 -2
  42. package/dist/cjs/rules/importsAsDependencies.d.ts +0 -2
  43. package/dist/cjs/rules/informativeDocs.d.ts +0 -2
  44. package/dist/cjs/rules/linesBeforeBlock.d.ts +0 -2
  45. package/dist/cjs/rules/matchDescription.d.ts +0 -2
  46. package/dist/cjs/rules/matchName.d.ts +0 -2
  47. package/dist/cjs/rules/multilineBlocks.d.ts +0 -2
  48. package/dist/cjs/rules/noBadBlocks.d.ts +0 -2
  49. package/dist/cjs/rules/noBlankBlockDescriptions.d.ts +0 -2
  50. package/dist/cjs/rules/noBlankBlocks.d.ts +0 -2
  51. package/dist/cjs/rules/noDefaults.d.ts +0 -2
  52. package/dist/cjs/rules/noMissingSyntax.d.ts +0 -9
  53. package/dist/cjs/rules/noMultiAsterisks.d.ts +0 -2
  54. package/dist/cjs/rules/noRestrictedSyntax.d.ts +0 -2
  55. package/dist/cjs/rules/noTypes.d.ts +0 -2
  56. package/dist/cjs/rules/noUndefinedTypes.d.ts +0 -2
  57. package/dist/cjs/rules/normalizeSeeLinks.d.ts +0 -2
  58. package/dist/cjs/rules/preferImportTag.d.ts +0 -2
  59. package/dist/cjs/rules/requireAsteriskPrefix.d.ts +0 -2
  60. package/dist/cjs/rules/requireDescription.d.ts +0 -2
  61. package/dist/cjs/rules/requireDescriptionCompleteSentence.d.ts +0 -2
  62. package/dist/cjs/rules/requireExample.d.ts +0 -2
  63. package/dist/cjs/rules/requireFileOverview.d.ts +0 -2
  64. package/dist/cjs/rules/requireHyphenBeforeParamDescription.d.ts +0 -2
  65. package/dist/cjs/rules/requireJsdoc.d.ts +0 -24
  66. package/dist/cjs/rules/requireParam.d.ts +0 -3
  67. package/dist/cjs/rules/requireParamDescription.d.ts +0 -2
  68. package/dist/cjs/rules/requireParamName.d.ts +0 -2
  69. package/dist/cjs/rules/requireParamType.d.ts +0 -2
  70. package/dist/cjs/rules/requireProperty.d.ts +0 -2
  71. package/dist/cjs/rules/requirePropertyDescription.d.ts +0 -2
  72. package/dist/cjs/rules/requirePropertyName.d.ts +0 -2
  73. package/dist/cjs/rules/requirePropertyType.d.ts +0 -2
  74. package/dist/cjs/rules/requireRejects.d.ts +0 -2
  75. package/dist/cjs/rules/requireReturns.d.ts +0 -2
  76. package/dist/cjs/rules/requireReturnsCheck.d.ts +0 -2
  77. package/dist/cjs/rules/requireReturnsDescription.d.ts +0 -2
  78. package/dist/cjs/rules/requireReturnsType.d.ts +0 -2
  79. package/dist/cjs/rules/requireTags.d.ts +0 -2
  80. package/dist/cjs/rules/requireTemplate.d.ts +0 -2
  81. package/dist/cjs/rules/requireThrows.d.ts +0 -2
  82. package/dist/cjs/rules/requireYields.d.ts +0 -2
  83. package/dist/cjs/rules/requireYieldsCheck.d.ts +0 -2
  84. package/dist/cjs/rules/sortTags.d.ts +0 -2
  85. package/dist/cjs/rules/tagLines.d.ts +0 -2
  86. package/dist/cjs/rules/textEscaping.d.ts +0 -2
  87. package/dist/cjs/rules/tsMethodSignatureStyle.d.ts +0 -2
  88. package/dist/cjs/rules/tsNoEmptyObjectType.d.ts +0 -2
  89. package/dist/cjs/rules/tsNoUnnecessaryTemplateExpression.d.ts +0 -2
  90. package/dist/cjs/rules/tsPreferFunctionType.d.ts +0 -2
  91. package/dist/cjs/rules/typeFormatting.d.ts +0 -2
  92. package/dist/cjs/rules/validTypes.d.ts +0 -2
  93. package/dist/cjs/tagNames.d.ts +0 -15
  94. package/dist/cjs/utils/hasReturnValue.d.ts +0 -19
  95. package/dist/defaultTagOrder.cjs +0 -46
  96. package/dist/defaultTagOrder.cjs.map +0 -1
  97. package/dist/exportParser.cjs +0 -732
  98. package/dist/exportParser.cjs.map +0 -1
  99. package/dist/generateDocs.cjs +0 -342
  100. package/dist/generateDocs.cjs.map +0 -1
  101. package/dist/generateOptions.cjs +0 -62
  102. package/dist/generateOptions.cjs.map +0 -1
  103. package/dist/generateRule.cjs +0 -248
  104. package/dist/generateRule.cjs.map +0 -1
  105. package/dist/generateRuleTypes.cjs +0 -24
  106. package/dist/generateRuleTypes.cjs.map +0 -1
  107. package/dist/getDefaultTagStructureForMode.cjs +0 -289
  108. package/dist/getDefaultTagStructureForMode.cjs.map +0 -1
  109. package/dist/getJsdocProcessorPlugin.cjs +0 -587
  110. package/dist/getJsdocProcessorPlugin.cjs.map +0 -1
  111. package/dist/getJsdocProcessorPlugin.cts +0 -5
  112. package/dist/index-cjs.cjs +0 -600
  113. package/dist/index-cjs.cjs.map +0 -1
  114. package/dist/index-cjs.d.ts +0 -27
  115. package/dist/index-esm.cjs +0 -162
  116. package/dist/index-esm.cjs.map +0 -1
  117. package/dist/index-esm.d.ts +0 -72
  118. package/dist/index.cjs +0 -748
  119. package/dist/index.cjs.cts +0 -3
  120. package/dist/index.cjs.map +0 -1
  121. package/dist/iterateJsdoc.cjs +0 -2150
  122. package/dist/iterateJsdoc.cjs.map +0 -1
  123. package/dist/iterateJsdoc.cts +0 -7
  124. package/dist/jsdocUtils.cjs +0 -1786
  125. package/dist/jsdocUtils.cjs.map +0 -1
  126. package/dist/rules/checkAccess.cjs +0 -40
  127. package/dist/rules/checkAccess.cjs.map +0 -1
  128. package/dist/rules/checkAlignment.cjs +0 -78
  129. package/dist/rules/checkAlignment.cjs.map +0 -1
  130. package/dist/rules/checkExamples.cjs +0 -521
  131. package/dist/rules/checkExamples.cjs.map +0 -1
  132. package/dist/rules/checkIndentation.cjs +0 -170
  133. package/dist/rules/checkIndentation.cjs.map +0 -1
  134. package/dist/rules/checkLineAlignment.cjs +0 -398
  135. package/dist/rules/checkLineAlignment.cjs.map +0 -1
  136. package/dist/rules/checkParamNames.cjs +0 -407
  137. package/dist/rules/checkParamNames.cjs.map +0 -1
  138. package/dist/rules/checkPropertyNames.cjs +0 -135
  139. package/dist/rules/checkPropertyNames.cjs.map +0 -1
  140. package/dist/rules/checkSyntax.cjs +0 -38
  141. package/dist/rules/checkSyntax.cjs.map +0 -1
  142. package/dist/rules/checkTagNames.cjs +0 -312
  143. package/dist/rules/checkTagNames.cjs.map +0 -1
  144. package/dist/rules/checkTemplateNames.cjs +0 -192
  145. package/dist/rules/checkTemplateNames.cjs.map +0 -1
  146. package/dist/rules/checkTypes.cjs +0 -111
  147. package/dist/rules/checkTypes.cjs.map +0 -1
  148. package/dist/rules/checkValues.cjs +0 -166
  149. package/dist/rules/checkValues.cjs.map +0 -1
  150. package/dist/rules/convertToJsdocComments.cjs +0 -356
  151. package/dist/rules/convertToJsdocComments.cjs.map +0 -1
  152. package/dist/rules/emptyTags.cjs +0 -98
  153. package/dist/rules/emptyTags.cjs.map +0 -1
  154. package/dist/rules/escapeInlineTags.cjs +0 -234
  155. package/dist/rules/escapeInlineTags.cjs.map +0 -1
  156. package/dist/rules/implementsOnClasses.cjs +0 -74
  157. package/dist/rules/implementsOnClasses.cjs.map +0 -1
  158. package/dist/rules/importsAsDependencies.cjs +0 -104
  159. package/dist/rules/importsAsDependencies.cjs.map +0 -1
  160. package/dist/rules/informativeDocs.cjs +0 -187
  161. package/dist/rules/informativeDocs.cjs.map +0 -1
  162. package/dist/rules/linesBeforeBlock.cjs +0 -120
  163. package/dist/rules/linesBeforeBlock.cjs.map +0 -1
  164. package/dist/rules/matchDescription.cjs +0 -356
  165. package/dist/rules/matchDescription.cjs.map +0 -1
  166. package/dist/rules/matchName.cjs +0 -160
  167. package/dist/rules/matchName.cjs.map +0 -1
  168. package/dist/rules/multilineBlocks.cjs +0 -431
  169. package/dist/rules/multilineBlocks.cjs.map +0 -1
  170. package/dist/rules/noBadBlocks.cjs +0 -100
  171. package/dist/rules/noBadBlocks.cjs.map +0 -1
  172. package/dist/rules/noBlankBlockDescriptions.cjs +0 -63
  173. package/dist/rules/noBlankBlockDescriptions.cjs.map +0 -1
  174. package/dist/rules/noBlankBlocks.cjs +0 -54
  175. package/dist/rules/noBlankBlocks.cjs.map +0 -1
  176. package/dist/rules/noDefaults.cjs +0 -102
  177. package/dist/rules/noDefaults.cjs.map +0 -1
  178. package/dist/rules/noMissingSyntax.cjs +0 -196
  179. package/dist/rules/noMissingSyntax.cjs.map +0 -1
  180. package/dist/rules/noMultiAsterisks.cjs +0 -126
  181. package/dist/rules/noMultiAsterisks.cjs.map +0 -1
  182. package/dist/rules/noRestrictedSyntax.cjs +0 -68
  183. package/dist/rules/noRestrictedSyntax.cjs.map +0 -1
  184. package/dist/rules/noTypes.cjs +0 -101
  185. package/dist/rules/noTypes.cjs.map +0 -1
  186. package/dist/rules/noUndefinedTypes.cjs +0 -616
  187. package/dist/rules/noUndefinedTypes.cjs.map +0 -1
  188. package/dist/rules/normalizeSeeLinks.cjs +0 -271
  189. package/dist/rules/normalizeSeeLinks.cjs.map +0 -1
  190. package/dist/rules/preferImportTag.cjs +0 -362
  191. package/dist/rules/preferImportTag.cjs.map +0 -1
  192. package/dist/rules/requireAsteriskPrefix.cjs +0 -190
  193. package/dist/rules/requireAsteriskPrefix.cjs.map +0 -1
  194. package/dist/rules/requireDescription.cjs +0 -164
  195. package/dist/rules/requireDescription.cjs.map +0 -1
  196. package/dist/rules/requireDescriptionCompleteSentence.cjs +0 -321
  197. package/dist/rules/requireDescriptionCompleteSentence.cjs.map +0 -1
  198. package/dist/rules/requireExample.cjs +0 -136
  199. package/dist/rules/requireExample.cjs.map +0 -1
  200. package/dist/rules/requireFileOverview.cjs +0 -194
  201. package/dist/rules/requireFileOverview.cjs.map +0 -1
  202. package/dist/rules/requireHyphenBeforeParamDescription.cjs +0 -166
  203. package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +0 -1
  204. package/dist/rules/requireJsdoc.cjs +0 -721
  205. package/dist/rules/requireJsdoc.cjs.map +0 -1
  206. package/dist/rules/requireParam.cjs +0 -772
  207. package/dist/rules/requireParam.cjs.map +0 -1
  208. package/dist/rules/requireParamDescription.cjs +0 -105
  209. package/dist/rules/requireParamDescription.cjs.map +0 -1
  210. package/dist/rules/requireParamName.cjs +0 -68
  211. package/dist/rules/requireParamName.cjs.map +0 -1
  212. package/dist/rules/requireParamType.cjs +0 -104
  213. package/dist/rules/requireParamType.cjs.map +0 -1
  214. package/dist/rules/requireProperty.cjs +0 -63
  215. package/dist/rules/requireProperty.cjs.map +0 -1
  216. package/dist/rules/requirePropertyDescription.cjs +0 -29
  217. package/dist/rules/requirePropertyDescription.cjs.map +0 -1
  218. package/dist/rules/requirePropertyName.cjs +0 -29
  219. package/dist/rules/requirePropertyName.cjs.map +0 -1
  220. package/dist/rules/requirePropertyType.cjs +0 -29
  221. package/dist/rules/requirePropertyType.cjs.map +0 -1
  222. package/dist/rules/requireRejects.cjs +0 -226
  223. package/dist/rules/requireRejects.cjs.map +0 -1
  224. package/dist/rules/requireReturns.cjs +0 -262
  225. package/dist/rules/requireReturns.cjs.map +0 -1
  226. package/dist/rules/requireReturnsCheck.cjs +0 -225
  227. package/dist/rules/requireReturnsCheck.cjs.map +0 -1
  228. package/dist/rules/requireReturnsDescription.cjs +0 -72
  229. package/dist/rules/requireReturnsDescription.cjs.map +0 -1
  230. package/dist/rules/requireReturnsType.cjs +0 -68
  231. package/dist/rules/requireReturnsType.cjs.map +0 -1
  232. package/dist/rules/requireTags.cjs +0 -74
  233. package/dist/rules/requireTags.cjs.map +0 -1
  234. package/dist/rules/requireTemplate.cjs +0 -220
  235. package/dist/rules/requireTemplate.cjs.map +0 -1
  236. package/dist/rules/requireThrows.cjs +0 -118
  237. package/dist/rules/requireThrows.cjs.map +0 -1
  238. package/dist/rules/requireYields.cjs +0 -224
  239. package/dist/rules/requireYields.cjs.map +0 -1
  240. package/dist/rules/requireYieldsCheck.cjs +0 -179
  241. package/dist/rules/requireYieldsCheck.cjs.map +0 -1
  242. package/dist/rules/sortTags.cjs +0 -656
  243. package/dist/rules/sortTags.cjs.map +0 -1
  244. package/dist/rules/tagLines.cjs +0 -374
  245. package/dist/rules/tagLines.cjs.map +0 -1
  246. package/dist/rules/textEscaping.cjs +0 -141
  247. package/dist/rules/textEscaping.cjs.map +0 -1
  248. package/dist/rules/tsMethodSignatureStyle.cjs +0 -240
  249. package/dist/rules/tsMethodSignatureStyle.cjs.map +0 -1
  250. package/dist/rules/tsNoEmptyObjectType.cjs +0 -62
  251. package/dist/rules/tsNoEmptyObjectType.cjs.map +0 -1
  252. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs +0 -104
  253. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs.map +0 -1
  254. package/dist/rules/tsPreferFunctionType.cjs +0 -110
  255. package/dist/rules/tsPreferFunctionType.cjs.map +0 -1
  256. package/dist/rules/typeFormatting.cjs +0 -607
  257. package/dist/rules/typeFormatting.cjs.map +0 -1
  258. package/dist/rules/validTypes.cjs +0 -324
  259. package/dist/rules/validTypes.cjs.map +0 -1
  260. package/dist/tagNames.cjs +0 -244
  261. package/dist/tagNames.cjs.map +0 -1
  262. package/dist/to-valid-identifier.cjs +0 -263
  263. package/dist/utils/hasReturnValue.cjs +0 -495
  264. package/dist/utils/hasReturnValue.cjs.map +0 -1
  265. package/rollup.config.js +0 -16
  266. package/src/getJsdocProcessorPlugin.cts +0 -5
  267. package/src/index-cjs.js +0 -760
  268. package/src/index-esm.js +0 -196
  269. package/src/index.cjs.cts +0 -3
  270. package/src/iterateJsdoc.cts +0 -7
package/dist/index.d.ts CHANGED
@@ -1,4 +1,18 @@
1
1
  export default index;
2
+ /** @type {import('eslint').ESLint.Plugin['rules']} */
3
+ export const rules: import("eslint").ESLint.Plugin["rules"];
4
+ /**
5
+ * @type {Record<
6
+ * FlatConfigNames,
7
+ * import('eslint').Linter.Config
8
+ * > &
9
+ * Record<
10
+ * "examples"|"default-expressions"|"examples-and-default-expressions",
11
+ * import('eslint').Linter.Config[]
12
+ * > &
13
+ * Record<"flat/recommended-mixed", import('eslint').Linter.Config[]>
14
+ } */
15
+ export const configs: Record<FlatConfigNames, import("eslint").Linter.Config> & Record<"examples" | "default-expressions" | "examples-and-default-expressions", import("eslint").Linter.Config[]> & Record<"flat/recommended-mixed", import("eslint").Linter.Config[]>;
2
16
  /**
3
17
  * @type {((
4
18
  * cfg?: import('eslint').Linter.Config & {
package/package.json CHANGED
@@ -5,12 +5,12 @@
5
5
  "url": "http://gajus.com"
6
6
  },
7
7
  "dependencies": {
8
- "@es-joy/jsdoccomment": "~0.91.0",
8
+ "@es-joy/jsdoccomment": "~0.93.1",
9
9
  "@es-joy/resolve.exports": "1.2.0",
10
- "are-docs-informative": "^0.0.2",
11
- "comment-parser": "1.4.7",
10
+ "are-docs-informative": "^0.1.1",
11
+ "comment-parser": "1.4.8",
12
12
  "debug": "^4.4.3",
13
- "escape-string-regexp": "^4.0.0",
13
+ "escape-string-regexp": "^5.0.0",
14
14
  "espree": "^11.2.0",
15
15
  "esquery": "^1.7.0",
16
16
  "html-entities": "^2.6.0",
@@ -23,16 +23,14 @@
23
23
  "description": "JSDoc linting rules for ESLint.",
24
24
  "devDependencies": {
25
25
  "@arethetypeswrong/cli": "^0.18.5",
26
- "@babel/cli": "8.0.4",
27
26
  "@babel/core": "8.0.1",
28
27
  "@babel/eslint-parser": "8.0.1",
29
28
  "@babel/plugin-transform-flow-strip-types": "8.0.1",
30
29
  "@babel/preset-env": "8.0.2",
31
30
  "@es-joy/escodegen": "^4.2.0",
32
- "@es-joy/jsdoc-eslint-parser": "^0.27.0",
31
+ "@es-joy/jsdoc-eslint-parser": "^0.28.0",
33
32
  "@eslint/core": "^1.2.1",
34
33
  "@hkdobrev/run-if-changed": "^0.9.0",
35
- "@rollup/plugin-node-resolve": "^16.0.3",
36
34
  "@semantic-release/commit-analyzer": "^13.0.1",
37
35
  "@semantic-release/github": "^12.0.9",
38
36
  "@semantic-release/npm": "^13.1.5",
@@ -42,41 +40,39 @@
42
40
  "@types/estree": "^1.0.9",
43
41
  "@types/json-schema": "^7.0.15",
44
42
  "@types/mocha": "^10.0.10",
45
- "@types/node": "^26.1.2",
43
+ "@types/node": "^26.2.0",
46
44
  "@types/semver": "^7.8.0",
47
45
  "@types/spdx-expression-parse": "^4.0.0",
48
- "@typescript-eslint/types": "8.65.0",
46
+ "@typescript-eslint/types": "8.66.0",
49
47
  "babel-plugin-add-module-exports": "^1.0.4",
50
- "babel-plugin-istanbul": "^8.0.0",
51
48
  "babel-plugin-transform-import-meta": "^3.0.0",
52
49
  "c8": "^12.0.0",
53
50
  "camelcase": "^9.0.0",
54
51
  "chai": "^6.2.2",
55
52
  "decamelize": "^6.0.1",
56
- "eslint": "10.8.0",
53
+ "eslint": "10.8.1",
57
54
  "eslint-config-canonical": "^47.4.2",
58
55
  "gitdown": "^4.1.1",
59
56
  "glob": "^13.0.6",
60
57
  "globals": "^17.9.0",
61
58
  "husky": "^9.1.7",
62
- "jsdoc-type-pratt-parser": "^8.0.0",
59
+ "jsdoc-type-pratt-parser": "^9.0.0",
63
60
  "json-schema": "^0.4.0",
64
61
  "json-schema-to-typescript": "^15.0.4",
65
62
  "lint-staged": "^17.3.0",
66
- "mocha": "^11.7.6",
63
+ "mocha": "^11.8.0",
67
64
  "open-editor": "^6.0.0",
68
65
  "playwright": "^1.62.1",
69
66
  "replace": "^1.2.2",
70
67
  "rimraf": "^6.1.3",
71
- "rollup": "^4.62.4",
72
- "semantic-release": "^25.0.8",
68
+ "semantic-release": "^25.0.9",
73
69
  "sinon": "^22.1.0",
74
70
  "ts-api-utils": "^2.5.0",
75
71
  "typescript": "5.9.3",
76
- "typescript-eslint": "8.65.0"
72
+ "typescript-eslint": "8.66.0"
77
73
  },
78
74
  "engines": {
79
- "node": "^22.13.0 || >=24"
75
+ "node": "^22.22.2 || >=24.15.0"
80
76
  },
81
77
  "keywords": [
82
78
  "eslint",
@@ -88,38 +84,19 @@
88
84
  "*.js": "eslint --fix"
89
85
  },
90
86
  "type": "module",
91
- "main": "./dist/index.cjs",
92
87
  "types": "./dist/index.d.ts",
93
88
  "exports": {
94
89
  ".": {
95
- "import": {
96
- "types": "./dist/index.d.ts",
97
- "default": "./src/index.js"
98
- },
99
- "require": {
100
- "types": "./dist/cjs/index.cjs.d.cts",
101
- "default": "./dist/index-cjs.cjs"
102
- }
90
+ "types": "./dist/index.d.ts",
91
+ "default": "./src/index.js"
103
92
  },
104
93
  "./getJsdocProcessorPlugin.js": {
105
- "import": {
106
- "types": "./dist/getJsdocProcessorPlugin.d.ts",
107
- "default": "./src/getJsdocProcessorPlugin.js"
108
- },
109
- "require": {
110
- "types": "./dist/cjs/getJsdocProcessorPlugin.d.cts",
111
- "default": "./dist/getJsdocProcessorPlugin.cjs"
112
- }
94
+ "types": "./dist/getJsdocProcessorPlugin.d.ts",
95
+ "default": "./src/getJsdocProcessorPlugin.js"
113
96
  },
114
97
  "./iterateJsdoc.js": {
115
- "import": {
116
- "types": "./dist/iterateJsdoc.d.ts",
117
- "default": "./src/iterateJsdoc.js"
118
- },
119
- "require": {
120
- "types": "./dist/cjs/iterateJsdoc.d.cts",
121
- "default": "./dist/iterateJsdoc.cjs"
122
- }
98
+ "types": "./dist/iterateJsdoc.d.ts",
99
+ "default": "./src/iterateJsdoc.js"
123
100
  }
124
101
  },
125
102
  "name": "eslint-plugin-jsdoc",
@@ -162,10 +139,8 @@
162
139
  "ruleTypes": "node ./src/bin/generateRuleTypes.js",
163
140
  "tsc": "tsc",
164
141
  "tsc-build": "tsc -p tsconfig-prod.json",
165
- "tsc-cjs": "tsc -p tsconfig-cjs.json",
166
- "rollup": "rollup -c",
167
- "build": "node ./src/bin/buildEntryFileForTS.js && rimraf ./dist && mkdir dist && pnpm rollup && NODE_ENV=production babel ./src --out-file-extension .cjs --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored && replace 'to-valid-identifier' '../to-valid-identifier.cjs' 'dist' -r --include=\"*.cjs\" && replace 'require\\(\"\\.(.*?)\\.[^.]*?\"\\)' 'require(\".$1.cjs\")' 'dist' -r --include=\"*.cjs\" && pnpm tsc-build && pnpm tsc-cjs",
168
- "attw": "attw --pack .",
142
+ "build": "rimraf ./dist && mkdir dist && pnpm tsc-build && cp src/rules.d.ts dist/rules.d.ts",
143
+ "attw": "attw --profile esm-only --pack .",
169
144
  "check-docs": "node ./src/bin/generateDocs.js --check",
170
145
  "create-docs": "pnpm run create-options && node ./src/bin/generateDocs.js && pnpm ruleTypes",
171
146
  "create-rule": "node ./src/bin/generateRule.js",
@@ -175,10 +150,10 @@
175
150
  "lint": "eslint",
176
151
  "lint-fix": "eslint --fix",
177
152
  "prepare": "husky",
178
- "test-no-cov": "BABEL_ENV=test mocha",
153
+ "test-no-cov": "mocha",
179
154
  "test": "c8 pnpm run test-no-cov",
180
155
  "test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
181
156
  "test-index": "pnpm run test-no-cov test/rules/index.js"
182
157
  },
183
- "version": "63.3.3"
158
+ "version": "64.0.1"
184
159
  }
package/src/index.js CHANGED
@@ -1,9 +1,3 @@
1
- /* AUTO-GENERATED BY build SCRIPT */
2
- /* eslint-disable perfectionist/sort-imports -- For auto-generate; Do not remove */
3
- import {
4
- merge,
5
- } from 'object-deep-merge';
6
-
7
1
  import {
8
2
  buildForbidRuleDefinition,
9
3
  } from './buildForbidRuleDefinition.js';
@@ -83,6 +77,9 @@ import validTypes from './rules/validTypes.js';
83
77
  import {
84
78
  ESLint,
85
79
  } from 'eslint';
80
+ import {
81
+ merge,
82
+ } from 'object-deep-merge';
86
83
  import semver from 'semver';
87
84
 
88
85
  /**
@@ -765,6 +762,25 @@ index.configs['flat/recommended-mixed'] = [
765
762
 
766
763
  export default index;
767
764
 
765
+ // Named exports (rather than only properties of the default export) so that
766
+ // Node's `require(esm)` interop exposes `.rules`/`.configs` directly, as
767
+ // needed by legacy `plugin:jsdoc/*` config resolution in CJS.
768
+ /** @type {import('eslint').ESLint.Plugin['rules']} */
769
+ export const rules = index.rules;
770
+
771
+ /**
772
+ * @type {Record<
773
+ * FlatConfigNames,
774
+ * import('eslint').Linter.Config
775
+ * > &
776
+ * Record<
777
+ * "examples"|"default-expressions"|"examples-and-default-expressions",
778
+ * import('eslint').Linter.Config[]
779
+ * > &
780
+ * Record<"flat/recommended-mixed", import('eslint').Linter.Config[]>
781
+ } */
782
+ export const configs = index.configs;
783
+
768
784
  /**
769
785
  * @type {((
770
786
  * cfg?: import('eslint').Linter.Config & {
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
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 {import('eslint').Rule.RuleContext} 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 {import('eslint').Rule.RuleContext} 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
- }
30
-
31
- /** @type {Set<string>} */
32
- warnedSettings.get(context).add(setting);
33
- }
34
- };
35
- };
36
- var _default = exports.default = WarnSettings;
37
- module.exports = exports.default;
38
- //# sourceMappingURL=WarnSettings.cjs.map
@@ -1 +0,0 @@
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 {import('eslint').Rule.RuleContext} 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 {import('eslint').Rule.RuleContext} 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,YAAY,GAAG,YAAY;EAC/B;EACA,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,CAAC;EAEpC,OAAO;IACL;AACJ;AACA;AACA;AACA;AACA;IACI,aAAa,CAAE,OAAO,EAAE,OAAO,EAAE;MAC/B,OAAO,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,0BACpC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAC3B,GAAG,CAAC,OAAO,CAAC;IAChB,CAAC;IAED;AACJ;AACA;AACA;AACA;IACI,mBAAmB,CAAE,OAAO,EAAE,OAAO,EAAE;MACrC;MACA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAChC,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC;MACxC;;MAEA;MAA4B,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAE,GAAG,CAAC,OAAO,CAAC;IACvE;EACF,CAAC;AACH,CAAC;AAAC,iCAEa,YAAY;AAAA","ignoreList":[]}
@@ -1,402 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _commentParser = require("comment-parser");
8
- /**
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
-
14
- /**
15
- * Detects if a line starts with a markdown list marker
16
- * Supports: -, *, numbered lists (1., 2., etc.)
17
- * This explicitly excludes hyphens that are part of JSDoc tag syntax
18
- * @param {string} text - The text to check
19
- * @param {boolean} isFirstLineOfTag - True if this is the first line (tag line)
20
- * @returns {boolean} - True if the text starts with a list marker
21
- */
22
- const startsWithListMarker = (text, isFirstLineOfTag = false) => {
23
- // On the first line of a tag, the hyphen is typically the JSDoc separator,
24
- // not a list marker
25
- if (isFirstLineOfTag) {
26
- return false;
27
- }
28
-
29
- // Match lines that start with optional whitespace, then a list marker
30
- // - or * followed by a space
31
- // or a number followed by . or ) and a space
32
- return /^\s*(?:[\-*]|\d+(?:\.|\)))\s+/v.test(text);
33
- };
34
-
35
- /**
36
- * @typedef {{
37
- * hasNoTypes: boolean,
38
- * maxNamedTagLength: import('./iterateJsdoc.js').Integer,
39
- * maxUnnamedTagLength: import('./iterateJsdoc.js').Integer
40
- * }} TypelessInfo
41
- */
42
-
43
- const {
44
- rewireSource
45
- } = _commentParser.util;
46
-
47
- /**
48
- * @typedef {{
49
- * name: import('./iterateJsdoc.js').Integer,
50
- * start: import('./iterateJsdoc.js').Integer,
51
- * tag: import('./iterateJsdoc.js').Integer,
52
- * type: import('./iterateJsdoc.js').Integer
53
- * }} Width
54
- */
55
-
56
- /** @type {Width} */
57
- const zeroWidth = {
58
- name: 0,
59
- start: 0,
60
- tag: 0,
61
- type: 0
62
- };
63
-
64
- /**
65
- * @param {string[]} tags
66
- * @param {import('./iterateJsdoc.js').Integer} index
67
- * @param {import('comment-parser').Line[]} source
68
- * @returns {boolean}
69
- */
70
- const shouldAlign = (tags, index, source) => {
71
- const tag = source[index].tokens.tag.replace('@', '');
72
- const includesTag = tags.includes(tag);
73
- if (includesTag) {
74
- return true;
75
- }
76
- if (tag !== '') {
77
- return false;
78
- }
79
- for (let iterator = index; iterator >= 0; iterator--) {
80
- const previousTag = source[iterator].tokens.tag.replace('@', '');
81
- if (previousTag !== '') {
82
- if (tags.includes(previousTag)) {
83
- return true;
84
- }
85
- return false;
86
- }
87
- }
88
- return true;
89
- };
90
-
91
- /**
92
- * @param {string[]} tags
93
- * @returns {(
94
- * width: Width,
95
- * line: {
96
- * tokens: import('comment-parser').Tokens
97
- * },
98
- * index: import('./iterateJsdoc.js').Integer,
99
- * source: import('comment-parser').Line[]
100
- * ) => Width}
101
- */
102
- const getWidth = tags => {
103
- return (width, {
104
- tokens
105
- }, index, source) => {
106
- if (!shouldAlign(tags, index, source)) {
107
- return width;
108
- }
109
- return {
110
- name: Math.max(width.name, tokens.name.length),
111
- start: tokens.delimiter === '/**' ? tokens.start.length : width.start,
112
- tag: Math.max(width.tag, tokens.tag.length),
113
- type: Math.max(width.type, tokens.type.length)
114
- };
115
- };
116
- };
117
-
118
- /**
119
- * @param {{
120
- * description: string;
121
- * tags: import('comment-parser').Spec[];
122
- * problems: import('comment-parser').Problem[];
123
- * }} fields
124
- * @returns {TypelessInfo}
125
- */
126
- const getTypelessInfo = fields => {
127
- const hasNoTypes = fields.tags.every(({
128
- type
129
- }) => {
130
- return !type;
131
- });
132
- const maxNamedTagLength = Math.max(...fields.tags.map(({
133
- name,
134
- tag
135
- }) => {
136
- return name.length === 0 ? -1 : tag.length;
137
- }).filter(length => {
138
- return length !== -1;
139
- })) + 1;
140
- const maxUnnamedTagLength = Math.max(...fields.tags.map(({
141
- name,
142
- tag
143
- }) => {
144
- return name.length === 0 ? tag.length : -1;
145
- }).filter(length => {
146
- return length !== -1;
147
- })) + 1;
148
- return {
149
- hasNoTypes,
150
- maxNamedTagLength,
151
- maxUnnamedTagLength
152
- };
153
- };
154
-
155
- /**
156
- * @param {import('./iterateJsdoc.js').Integer} len
157
- * @returns {string}
158
- */
159
- const space = len => {
160
- return ''.padStart(len, ' ');
161
- };
162
-
163
- /**
164
- * Check if a tag or any of its lines contain list markers
165
- * @param {import('./iterateJsdoc.js').Integer} index - Current line index
166
- * @param {import('comment-parser').Line[]} source - All source lines
167
- * @returns {{hasListMarker: boolean, tagStartIndex: import('./iterateJsdoc.js').Integer}}
168
- */
169
- const checkForListMarkers = (index, source) => {
170
- let hasListMarker = false;
171
- let tagStartIndex = index;
172
- while (tagStartIndex > 0 && source[tagStartIndex].tokens.tag === '') {
173
- tagStartIndex--;
174
- }
175
- for (let idx = tagStartIndex; idx <= index; idx++) {
176
- const isFirstLine = idx === tagStartIndex;
177
- if (source[idx]?.tokens?.description && startsWithListMarker(source[idx].tokens.description, isFirstLine)) {
178
- hasListMarker = true;
179
- break;
180
- }
181
- }
182
- return {
183
- hasListMarker,
184
- tagStartIndex
185
- };
186
- };
187
-
188
- /**
189
- * Calculate extra indentation for list items relative to the first continuation line
190
- * @param {import('./iterateJsdoc.js').Integer} index - Current line index
191
- * @param {import('./iterateJsdoc.js').Integer} tagStartIndex - Index of the tag line
192
- * @param {import('comment-parser').Line[]} source - All source lines
193
- * @returns {string} - Extra indentation spaces
194
- */
195
- const calculateListExtraIndent = (index, tagStartIndex, source) => {
196
- // Find the first continuation line to use as baseline
197
- let firstContinuationIndent = null;
198
- for (let idx = tagStartIndex + 1; idx < source.length; idx++) {
199
- if (source[idx].tokens.description && !source[idx].tokens.tag) {
200
- firstContinuationIndent = source[idx].tokens.postDelimiter.length;
201
- break;
202
- }
203
- }
204
-
205
- // Calculate the extra indentation of current line relative to the first continuation line
206
- const currentOriginalIndent = source[index].tokens.postDelimiter.length;
207
- const extraIndent = firstContinuationIndent !== null && currentOriginalIndent > firstContinuationIndent ? ' '.repeat(currentOriginalIndent - firstContinuationIndent) : '';
208
- return extraIndent;
209
- };
210
-
211
- /**
212
- * @param {{
213
- * customSpacings: import('../src/rules/checkLineAlignment.js').CustomSpacings,
214
- * tags: string[],
215
- * indent: string,
216
- * preserveMainDescriptionPostDelimiter: boolean,
217
- * wrapIndent: string,
218
- * disableWrapIndent: boolean,
219
- * }} cfg
220
- * @returns {(
221
- * block: import('comment-parser').Block
222
- * ) => import('comment-parser').Block}
223
- */
224
- const alignTransform = ({
225
- customSpacings,
226
- disableWrapIndent,
227
- indent,
228
- preserveMainDescriptionPostDelimiter,
229
- tags,
230
- wrapIndent
231
- }) => {
232
- let intoTags = false;
233
- /** @type {Width} */
234
- let width;
235
-
236
- /**
237
- * @param {import('comment-parser').Tokens} tokens
238
- * @param {TypelessInfo} typelessInfo
239
- * @returns {import('comment-parser').Tokens}
240
- */
241
- const alignTokens = (tokens, typelessInfo) => {
242
- const nothingAfter = {
243
- delim: false,
244
- name: false,
245
- tag: false,
246
- type: false
247
- };
248
- if (tokens.description === '') {
249
- nothingAfter.name = true;
250
- tokens.postName = '';
251
- if (tokens.name === '') {
252
- nothingAfter.type = true;
253
- tokens.postType = '';
254
- if (tokens.type === '') {
255
- nothingAfter.tag = true;
256
- tokens.postTag = '';
257
-
258
- /* c8 ignore next: Never happens because the !intoTags return. But it's here for consistency with the original align transform */
259
- if (tokens.tag === '') {
260
- nothingAfter.delim = true;
261
- }
262
- }
263
- }
264
- }
265
- let untypedNameAdjustment = 0;
266
- let untypedTypeAdjustment = 0;
267
- if (typelessInfo.hasNoTypes) {
268
- nothingAfter.tag = true;
269
- tokens.postTag = '';
270
- if (tokens.name === '') {
271
- untypedNameAdjustment = typelessInfo.maxNamedTagLength - tokens.tag.length;
272
- } else {
273
- untypedNameAdjustment = typelessInfo.maxNamedTagLength > typelessInfo.maxUnnamedTagLength ? 0 : Math.max(0, typelessInfo.maxUnnamedTagLength - (tokens.tag.length + tokens.name.length + 1));
274
- untypedTypeAdjustment = typelessInfo.maxNamedTagLength - tokens.tag.length;
275
- }
276
- }
277
-
278
- // Todo: Avoid fixing alignment of blocks with multiline wrapping of type
279
- if (tokens.tag === '' && tokens.type) {
280
- return tokens;
281
- }
282
- const spacings = {
283
- postDelimiter: customSpacings?.postDelimiter || 1,
284
- postName: customSpacings?.postName || 1,
285
- postTag: customSpacings?.postTag || 1,
286
- postType: customSpacings?.postType || 1
287
- };
288
- tokens.postDelimiter = nothingAfter.delim ? '' : space(spacings.postDelimiter);
289
- if (!nothingAfter.tag) {
290
- tokens.postTag = space(width.tag - tokens.tag.length + spacings.postTag);
291
- }
292
- if (!nothingAfter.type) {
293
- tokens.postType = space(width.type - tokens.type.length + spacings.postType + untypedTypeAdjustment);
294
- }
295
- if (!nothingAfter.name) {
296
- // If post name is empty for all lines (name width 0), don't add post name spacing.
297
- tokens.postName = width.name === 0 ? '' : space(width.name - tokens.name.length + spacings.postName + untypedNameAdjustment);
298
- }
299
- return tokens;
300
- };
301
-
302
- /**
303
- * @param {import('comment-parser').Line} line
304
- * @param {import('./iterateJsdoc.js').Integer} index
305
- * @param {import('comment-parser').Line[]} source
306
- * @param {TypelessInfo} typelessInfo
307
- * @param {string|false} indentTag
308
- * @returns {import('comment-parser').Line}
309
- */
310
- const update = (line, index, source, typelessInfo, indentTag) => {
311
- /** @type {import('comment-parser').Tokens} */
312
- const tokens = {
313
- ...line.tokens
314
- };
315
- if (tokens.tag !== '') {
316
- intoTags = true;
317
- }
318
- const isEmpty = tokens.tag === '' && tokens.name === '' && tokens.type === '' && tokens.description === '';
319
-
320
- // dangling '*/'
321
- if (tokens.end === '*/' && isEmpty) {
322
- tokens.start = indent + ' ';
323
- return {
324
- ...line,
325
- tokens
326
- };
327
- }
328
- switch (tokens.delimiter) {
329
- case '*':
330
- tokens.start = indent + ' ';
331
- break;
332
- case '/**':
333
- tokens.start = indent;
334
- break;
335
- default:
336
- tokens.delimiter = '';
337
-
338
- // compensate delimiter
339
- tokens.start = indent + ' ';
340
- }
341
- if (!intoTags) {
342
- if (tokens.description === '') {
343
- tokens.postDelimiter = '';
344
- } else if (!preserveMainDescriptionPostDelimiter) {
345
- tokens.postDelimiter = ' ';
346
- }
347
- return {
348
- ...line,
349
- tokens
350
- };
351
- }
352
- const postHyphenSpacing = customSpacings?.postHyphen ?? 1;
353
- const hyphenSpacing = /^\s*-\s+/v;
354
- tokens.description = tokens.description.replace(hyphenSpacing, '-' + ''.padStart(postHyphenSpacing, ' '));
355
-
356
- // Not align.
357
- if (shouldAlign(tags, index, source)) {
358
- alignTokens(tokens, typelessInfo);
359
- if (!disableWrapIndent && indentTag) {
360
- const {
361
- hasListMarker,
362
- tagStartIndex
363
- } = checkForListMarkers(index, source);
364
- if (hasListMarker && index > tagStartIndex) {
365
- const extraIndent = calculateListExtraIndent(index, tagStartIndex, source);
366
- tokens.postDelimiter += wrapIndent + extraIndent;
367
- } else {
368
- // Normal case: add wrapIndent after the aligned delimiter
369
- tokens.postDelimiter += wrapIndent;
370
- }
371
- }
372
- }
373
- return {
374
- ...line,
375
- tokens
376
- };
377
- };
378
- return ({
379
- source,
380
- ...fields
381
- }) => {
382
- width = source.reduce(getWidth(tags), {
383
- ...zeroWidth
384
- });
385
- const typelessInfo = getTypelessInfo(fields);
386
- let tagIndentMode = false;
387
- return rewireSource({
388
- ...fields,
389
- source: source.map((line, index) => {
390
- const indentTag = !disableWrapIndent && tagIndentMode && !line.tokens.tag && line.tokens.description;
391
- const ret = update(line, index, source, typelessInfo, indentTag);
392
- if (!disableWrapIndent && line.tokens.tag) {
393
- tagIndentMode = true;
394
- }
395
- return ret;
396
- })
397
- });
398
- };
399
- };
400
- var _default = exports.default = alignTransform;
401
- module.exports = exports.default;
402
- //# sourceMappingURL=alignTransform.cjs.map