eslint-plugin-jsdoc 63.3.3 → 64.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 (269) hide show
  1. package/package.json +23 -48
  2. package/src/index.js +3 -6
  3. package/dist/WarnSettings.cjs +0 -38
  4. package/dist/WarnSettings.cjs.map +0 -1
  5. package/dist/alignTransform.cjs +0 -402
  6. package/dist/alignTransform.cjs.map +0 -1
  7. package/dist/buildForbidRuleDefinition.cjs +0 -101
  8. package/dist/buildForbidRuleDefinition.cjs.map +0 -1
  9. package/dist/buildRejectOrPreferRuleDefinition.cjs +0 -352
  10. package/dist/buildRejectOrPreferRuleDefinition.cjs.map +0 -1
  11. package/dist/cjs/WarnSettings.d.ts +0 -16
  12. package/dist/cjs/alignTransform.d.ts +0 -33
  13. package/dist/cjs/buildForbidRuleDefinition.d.ts +0 -14
  14. package/dist/cjs/buildRejectOrPreferRuleDefinition.d.ts +0 -8
  15. package/dist/cjs/defaultTagOrder.d.ts +0 -4
  16. package/dist/cjs/exportParser.d.ts +0 -40
  17. package/dist/cjs/getDefaultTagStructureForMode.d.ts +0 -10
  18. package/dist/cjs/getJsdocProcessorPlugin.d.cts +0 -5
  19. package/dist/cjs/getJsdocProcessorPlugin.d.ts +0 -66
  20. package/dist/cjs/index-cjs.d.ts +0 -26
  21. package/dist/cjs/index.cjs.d.cts +0 -2
  22. package/dist/cjs/iterateJsdoc.d.cts +0 -7
  23. package/dist/cjs/iterateJsdoc.d.ts +0 -495
  24. package/dist/cjs/jsdocUtils.d.ts +0 -500
  25. package/dist/cjs/rules/checkAccess.d.ts +0 -2
  26. package/dist/cjs/rules/checkAlignment.d.ts +0 -2
  27. package/dist/cjs/rules/checkExamples.d.ts +0 -3
  28. package/dist/cjs/rules/checkIndentation.d.ts +0 -2
  29. package/dist/cjs/rules/checkLineAlignment.d.ts +0 -9
  30. package/dist/cjs/rules/checkParamNames.d.ts +0 -2
  31. package/dist/cjs/rules/checkPropertyNames.d.ts +0 -2
  32. package/dist/cjs/rules/checkSyntax.d.ts +0 -2
  33. package/dist/cjs/rules/checkTagNames.d.ts +0 -2
  34. package/dist/cjs/rules/checkTemplateNames.d.ts +0 -2
  35. package/dist/cjs/rules/checkTypes.d.ts +0 -7
  36. package/dist/cjs/rules/checkValues.d.ts +0 -2
  37. package/dist/cjs/rules/convertToJsdocComments.d.ts +0 -266
  38. package/dist/cjs/rules/emptyTags.d.ts +0 -2
  39. package/dist/cjs/rules/escapeInlineTags.d.ts +0 -2
  40. package/dist/cjs/rules/implementsOnClasses.d.ts +0 -2
  41. package/dist/cjs/rules/importsAsDependencies.d.ts +0 -2
  42. package/dist/cjs/rules/informativeDocs.d.ts +0 -2
  43. package/dist/cjs/rules/linesBeforeBlock.d.ts +0 -2
  44. package/dist/cjs/rules/matchDescription.d.ts +0 -2
  45. package/dist/cjs/rules/matchName.d.ts +0 -2
  46. package/dist/cjs/rules/multilineBlocks.d.ts +0 -2
  47. package/dist/cjs/rules/noBadBlocks.d.ts +0 -2
  48. package/dist/cjs/rules/noBlankBlockDescriptions.d.ts +0 -2
  49. package/dist/cjs/rules/noBlankBlocks.d.ts +0 -2
  50. package/dist/cjs/rules/noDefaults.d.ts +0 -2
  51. package/dist/cjs/rules/noMissingSyntax.d.ts +0 -9
  52. package/dist/cjs/rules/noMultiAsterisks.d.ts +0 -2
  53. package/dist/cjs/rules/noRestrictedSyntax.d.ts +0 -2
  54. package/dist/cjs/rules/noTypes.d.ts +0 -2
  55. package/dist/cjs/rules/noUndefinedTypes.d.ts +0 -2
  56. package/dist/cjs/rules/normalizeSeeLinks.d.ts +0 -2
  57. package/dist/cjs/rules/preferImportTag.d.ts +0 -2
  58. package/dist/cjs/rules/requireAsteriskPrefix.d.ts +0 -2
  59. package/dist/cjs/rules/requireDescription.d.ts +0 -2
  60. package/dist/cjs/rules/requireDescriptionCompleteSentence.d.ts +0 -2
  61. package/dist/cjs/rules/requireExample.d.ts +0 -2
  62. package/dist/cjs/rules/requireFileOverview.d.ts +0 -2
  63. package/dist/cjs/rules/requireHyphenBeforeParamDescription.d.ts +0 -2
  64. package/dist/cjs/rules/requireJsdoc.d.ts +0 -24
  65. package/dist/cjs/rules/requireParam.d.ts +0 -3
  66. package/dist/cjs/rules/requireParamDescription.d.ts +0 -2
  67. package/dist/cjs/rules/requireParamName.d.ts +0 -2
  68. package/dist/cjs/rules/requireParamType.d.ts +0 -2
  69. package/dist/cjs/rules/requireProperty.d.ts +0 -2
  70. package/dist/cjs/rules/requirePropertyDescription.d.ts +0 -2
  71. package/dist/cjs/rules/requirePropertyName.d.ts +0 -2
  72. package/dist/cjs/rules/requirePropertyType.d.ts +0 -2
  73. package/dist/cjs/rules/requireRejects.d.ts +0 -2
  74. package/dist/cjs/rules/requireReturns.d.ts +0 -2
  75. package/dist/cjs/rules/requireReturnsCheck.d.ts +0 -2
  76. package/dist/cjs/rules/requireReturnsDescription.d.ts +0 -2
  77. package/dist/cjs/rules/requireReturnsType.d.ts +0 -2
  78. package/dist/cjs/rules/requireTags.d.ts +0 -2
  79. package/dist/cjs/rules/requireTemplate.d.ts +0 -2
  80. package/dist/cjs/rules/requireThrows.d.ts +0 -2
  81. package/dist/cjs/rules/requireYields.d.ts +0 -2
  82. package/dist/cjs/rules/requireYieldsCheck.d.ts +0 -2
  83. package/dist/cjs/rules/sortTags.d.ts +0 -2
  84. package/dist/cjs/rules/tagLines.d.ts +0 -2
  85. package/dist/cjs/rules/textEscaping.d.ts +0 -2
  86. package/dist/cjs/rules/tsMethodSignatureStyle.d.ts +0 -2
  87. package/dist/cjs/rules/tsNoEmptyObjectType.d.ts +0 -2
  88. package/dist/cjs/rules/tsNoUnnecessaryTemplateExpression.d.ts +0 -2
  89. package/dist/cjs/rules/tsPreferFunctionType.d.ts +0 -2
  90. package/dist/cjs/rules/typeFormatting.d.ts +0 -2
  91. package/dist/cjs/rules/validTypes.d.ts +0 -2
  92. package/dist/cjs/tagNames.d.ts +0 -15
  93. package/dist/cjs/utils/hasReturnValue.d.ts +0 -19
  94. package/dist/defaultTagOrder.cjs +0 -46
  95. package/dist/defaultTagOrder.cjs.map +0 -1
  96. package/dist/exportParser.cjs +0 -732
  97. package/dist/exportParser.cjs.map +0 -1
  98. package/dist/generateDocs.cjs +0 -342
  99. package/dist/generateDocs.cjs.map +0 -1
  100. package/dist/generateOptions.cjs +0 -62
  101. package/dist/generateOptions.cjs.map +0 -1
  102. package/dist/generateRule.cjs +0 -248
  103. package/dist/generateRule.cjs.map +0 -1
  104. package/dist/generateRuleTypes.cjs +0 -24
  105. package/dist/generateRuleTypes.cjs.map +0 -1
  106. package/dist/getDefaultTagStructureForMode.cjs +0 -289
  107. package/dist/getDefaultTagStructureForMode.cjs.map +0 -1
  108. package/dist/getJsdocProcessorPlugin.cjs +0 -587
  109. package/dist/getJsdocProcessorPlugin.cjs.map +0 -1
  110. package/dist/getJsdocProcessorPlugin.cts +0 -5
  111. package/dist/index-cjs.cjs +0 -600
  112. package/dist/index-cjs.cjs.map +0 -1
  113. package/dist/index-cjs.d.ts +0 -27
  114. package/dist/index-esm.cjs +0 -162
  115. package/dist/index-esm.cjs.map +0 -1
  116. package/dist/index-esm.d.ts +0 -72
  117. package/dist/index.cjs +0 -748
  118. package/dist/index.cjs.cts +0 -3
  119. package/dist/index.cjs.map +0 -1
  120. package/dist/iterateJsdoc.cjs +0 -2150
  121. package/dist/iterateJsdoc.cjs.map +0 -1
  122. package/dist/iterateJsdoc.cts +0 -7
  123. package/dist/jsdocUtils.cjs +0 -1786
  124. package/dist/jsdocUtils.cjs.map +0 -1
  125. package/dist/rules/checkAccess.cjs +0 -40
  126. package/dist/rules/checkAccess.cjs.map +0 -1
  127. package/dist/rules/checkAlignment.cjs +0 -78
  128. package/dist/rules/checkAlignment.cjs.map +0 -1
  129. package/dist/rules/checkExamples.cjs +0 -521
  130. package/dist/rules/checkExamples.cjs.map +0 -1
  131. package/dist/rules/checkIndentation.cjs +0 -170
  132. package/dist/rules/checkIndentation.cjs.map +0 -1
  133. package/dist/rules/checkLineAlignment.cjs +0 -398
  134. package/dist/rules/checkLineAlignment.cjs.map +0 -1
  135. package/dist/rules/checkParamNames.cjs +0 -407
  136. package/dist/rules/checkParamNames.cjs.map +0 -1
  137. package/dist/rules/checkPropertyNames.cjs +0 -135
  138. package/dist/rules/checkPropertyNames.cjs.map +0 -1
  139. package/dist/rules/checkSyntax.cjs +0 -38
  140. package/dist/rules/checkSyntax.cjs.map +0 -1
  141. package/dist/rules/checkTagNames.cjs +0 -312
  142. package/dist/rules/checkTagNames.cjs.map +0 -1
  143. package/dist/rules/checkTemplateNames.cjs +0 -192
  144. package/dist/rules/checkTemplateNames.cjs.map +0 -1
  145. package/dist/rules/checkTypes.cjs +0 -111
  146. package/dist/rules/checkTypes.cjs.map +0 -1
  147. package/dist/rules/checkValues.cjs +0 -166
  148. package/dist/rules/checkValues.cjs.map +0 -1
  149. package/dist/rules/convertToJsdocComments.cjs +0 -356
  150. package/dist/rules/convertToJsdocComments.cjs.map +0 -1
  151. package/dist/rules/emptyTags.cjs +0 -98
  152. package/dist/rules/emptyTags.cjs.map +0 -1
  153. package/dist/rules/escapeInlineTags.cjs +0 -234
  154. package/dist/rules/escapeInlineTags.cjs.map +0 -1
  155. package/dist/rules/implementsOnClasses.cjs +0 -74
  156. package/dist/rules/implementsOnClasses.cjs.map +0 -1
  157. package/dist/rules/importsAsDependencies.cjs +0 -104
  158. package/dist/rules/importsAsDependencies.cjs.map +0 -1
  159. package/dist/rules/informativeDocs.cjs +0 -187
  160. package/dist/rules/informativeDocs.cjs.map +0 -1
  161. package/dist/rules/linesBeforeBlock.cjs +0 -120
  162. package/dist/rules/linesBeforeBlock.cjs.map +0 -1
  163. package/dist/rules/matchDescription.cjs +0 -356
  164. package/dist/rules/matchDescription.cjs.map +0 -1
  165. package/dist/rules/matchName.cjs +0 -160
  166. package/dist/rules/matchName.cjs.map +0 -1
  167. package/dist/rules/multilineBlocks.cjs +0 -431
  168. package/dist/rules/multilineBlocks.cjs.map +0 -1
  169. package/dist/rules/noBadBlocks.cjs +0 -100
  170. package/dist/rules/noBadBlocks.cjs.map +0 -1
  171. package/dist/rules/noBlankBlockDescriptions.cjs +0 -63
  172. package/dist/rules/noBlankBlockDescriptions.cjs.map +0 -1
  173. package/dist/rules/noBlankBlocks.cjs +0 -54
  174. package/dist/rules/noBlankBlocks.cjs.map +0 -1
  175. package/dist/rules/noDefaults.cjs +0 -102
  176. package/dist/rules/noDefaults.cjs.map +0 -1
  177. package/dist/rules/noMissingSyntax.cjs +0 -196
  178. package/dist/rules/noMissingSyntax.cjs.map +0 -1
  179. package/dist/rules/noMultiAsterisks.cjs +0 -126
  180. package/dist/rules/noMultiAsterisks.cjs.map +0 -1
  181. package/dist/rules/noRestrictedSyntax.cjs +0 -68
  182. package/dist/rules/noRestrictedSyntax.cjs.map +0 -1
  183. package/dist/rules/noTypes.cjs +0 -101
  184. package/dist/rules/noTypes.cjs.map +0 -1
  185. package/dist/rules/noUndefinedTypes.cjs +0 -616
  186. package/dist/rules/noUndefinedTypes.cjs.map +0 -1
  187. package/dist/rules/normalizeSeeLinks.cjs +0 -271
  188. package/dist/rules/normalizeSeeLinks.cjs.map +0 -1
  189. package/dist/rules/preferImportTag.cjs +0 -362
  190. package/dist/rules/preferImportTag.cjs.map +0 -1
  191. package/dist/rules/requireAsteriskPrefix.cjs +0 -190
  192. package/dist/rules/requireAsteriskPrefix.cjs.map +0 -1
  193. package/dist/rules/requireDescription.cjs +0 -164
  194. package/dist/rules/requireDescription.cjs.map +0 -1
  195. package/dist/rules/requireDescriptionCompleteSentence.cjs +0 -321
  196. package/dist/rules/requireDescriptionCompleteSentence.cjs.map +0 -1
  197. package/dist/rules/requireExample.cjs +0 -136
  198. package/dist/rules/requireExample.cjs.map +0 -1
  199. package/dist/rules/requireFileOverview.cjs +0 -194
  200. package/dist/rules/requireFileOverview.cjs.map +0 -1
  201. package/dist/rules/requireHyphenBeforeParamDescription.cjs +0 -166
  202. package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +0 -1
  203. package/dist/rules/requireJsdoc.cjs +0 -721
  204. package/dist/rules/requireJsdoc.cjs.map +0 -1
  205. package/dist/rules/requireParam.cjs +0 -772
  206. package/dist/rules/requireParam.cjs.map +0 -1
  207. package/dist/rules/requireParamDescription.cjs +0 -105
  208. package/dist/rules/requireParamDescription.cjs.map +0 -1
  209. package/dist/rules/requireParamName.cjs +0 -68
  210. package/dist/rules/requireParamName.cjs.map +0 -1
  211. package/dist/rules/requireParamType.cjs +0 -104
  212. package/dist/rules/requireParamType.cjs.map +0 -1
  213. package/dist/rules/requireProperty.cjs +0 -63
  214. package/dist/rules/requireProperty.cjs.map +0 -1
  215. package/dist/rules/requirePropertyDescription.cjs +0 -29
  216. package/dist/rules/requirePropertyDescription.cjs.map +0 -1
  217. package/dist/rules/requirePropertyName.cjs +0 -29
  218. package/dist/rules/requirePropertyName.cjs.map +0 -1
  219. package/dist/rules/requirePropertyType.cjs +0 -29
  220. package/dist/rules/requirePropertyType.cjs.map +0 -1
  221. package/dist/rules/requireRejects.cjs +0 -226
  222. package/dist/rules/requireRejects.cjs.map +0 -1
  223. package/dist/rules/requireReturns.cjs +0 -262
  224. package/dist/rules/requireReturns.cjs.map +0 -1
  225. package/dist/rules/requireReturnsCheck.cjs +0 -225
  226. package/dist/rules/requireReturnsCheck.cjs.map +0 -1
  227. package/dist/rules/requireReturnsDescription.cjs +0 -72
  228. package/dist/rules/requireReturnsDescription.cjs.map +0 -1
  229. package/dist/rules/requireReturnsType.cjs +0 -68
  230. package/dist/rules/requireReturnsType.cjs.map +0 -1
  231. package/dist/rules/requireTags.cjs +0 -74
  232. package/dist/rules/requireTags.cjs.map +0 -1
  233. package/dist/rules/requireTemplate.cjs +0 -220
  234. package/dist/rules/requireTemplate.cjs.map +0 -1
  235. package/dist/rules/requireThrows.cjs +0 -118
  236. package/dist/rules/requireThrows.cjs.map +0 -1
  237. package/dist/rules/requireYields.cjs +0 -224
  238. package/dist/rules/requireYields.cjs.map +0 -1
  239. package/dist/rules/requireYieldsCheck.cjs +0 -179
  240. package/dist/rules/requireYieldsCheck.cjs.map +0 -1
  241. package/dist/rules/sortTags.cjs +0 -656
  242. package/dist/rules/sortTags.cjs.map +0 -1
  243. package/dist/rules/tagLines.cjs +0 -374
  244. package/dist/rules/tagLines.cjs.map +0 -1
  245. package/dist/rules/textEscaping.cjs +0 -141
  246. package/dist/rules/textEscaping.cjs.map +0 -1
  247. package/dist/rules/tsMethodSignatureStyle.cjs +0 -240
  248. package/dist/rules/tsMethodSignatureStyle.cjs.map +0 -1
  249. package/dist/rules/tsNoEmptyObjectType.cjs +0 -62
  250. package/dist/rules/tsNoEmptyObjectType.cjs.map +0 -1
  251. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs +0 -104
  252. package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs.map +0 -1
  253. package/dist/rules/tsPreferFunctionType.cjs +0 -110
  254. package/dist/rules/tsPreferFunctionType.cjs.map +0 -1
  255. package/dist/rules/typeFormatting.cjs +0 -607
  256. package/dist/rules/typeFormatting.cjs.map +0 -1
  257. package/dist/rules/validTypes.cjs +0 -324
  258. package/dist/rules/validTypes.cjs.map +0 -1
  259. package/dist/tagNames.cjs +0 -244
  260. package/dist/tagNames.cjs.map +0 -1
  261. package/dist/to-valid-identifier.cjs +0 -263
  262. package/dist/utils/hasReturnValue.cjs +0 -495
  263. package/dist/utils/hasReturnValue.cjs.map +0 -1
  264. package/rollup.config.js +0 -16
  265. package/src/getJsdocProcessorPlugin.cts +0 -5
  266. package/src/index-cjs.js +0 -760
  267. package/src/index-esm.js +0 -196
  268. package/src/index.cjs.cts +0 -3
  269. package/src/iterateJsdoc.cts +0 -7
@@ -1,220 +0,0 @@
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 _jsdoccomment = require("@es-joy/jsdoccomment");
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- var _default = exports.default = (0, _iterateJsdoc.default)(({
11
- context,
12
- node,
13
- report,
14
- settings,
15
- utils
16
- }) => {
17
- if (utils.avoidDocs()) {
18
- return;
19
- }
20
- const {
21
- requireSeparateTemplates = false
22
- } = context.options[0] || {};
23
- const {
24
- mode
25
- } = settings;
26
- const usedNames = new Set();
27
- const tgName = /** @type {string} */utils.getPreferredTagName({
28
- tagName: 'template'
29
- });
30
- if (!tgName) {
31
- return;
32
- }
33
- const templateTags = utils.getTags(tgName);
34
- const templateNames = templateTags.flatMap(tag => {
35
- return utils.parseClosureTemplateTag(tag);
36
- });
37
- if (requireSeparateTemplates) {
38
- for (const tag of templateTags) {
39
- const names = utils.parseClosureTemplateTag(tag);
40
- if (names.length > 1) {
41
- report(`Missing separate @${tgName} for ${names[1]}`, null, tag);
42
- }
43
- }
44
- }
45
-
46
- /**
47
- * @param {import('@typescript-eslint/types').TSESTree.FunctionDeclaration|
48
- * import('@typescript-eslint/types').TSESTree.ClassDeclaration|
49
- * import('@typescript-eslint/types').TSESTree.TSDeclareFunction|
50
- * import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration|
51
- * import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration
52
- */
53
- const checkTypeParams = aliasDeclaration => {
54
- const {
55
- params
56
- /* c8 ignore next -- Guard */
57
- } = aliasDeclaration.typeParameters ?? {
58
- /* c8 ignore next -- Guard */
59
- params: []
60
- };
61
- for (const {
62
- name: {
63
- name
64
- }
65
- } of params) {
66
- usedNames.add(name);
67
- }
68
- for (const usedName of usedNames) {
69
- if (!templateNames.includes(usedName)) {
70
- report(`Missing @${tgName} ${usedName}`);
71
- }
72
- }
73
- };
74
- const handleTypes = () => {
75
- const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */
76
- node;
77
- if (!nde) {
78
- return;
79
- }
80
- switch (nde.type) {
81
- case 'ClassDeclaration':
82
- case 'FunctionDeclaration':
83
- case 'TSDeclareFunction':
84
- case 'TSInterfaceDeclaration':
85
- case 'TSTypeAliasDeclaration':
86
- checkTypeParams(nde);
87
- break;
88
- case 'ExportDefaultDeclaration':
89
- switch (nde.declaration?.type) {
90
- case 'ClassDeclaration':
91
- case 'FunctionDeclaration':
92
- case 'TSInterfaceDeclaration':
93
- checkTypeParams(nde.declaration);
94
- break;
95
- }
96
- break;
97
- case 'ExportNamedDeclaration':
98
- switch (nde.declaration?.type) {
99
- case 'ClassDeclaration':
100
- case 'FunctionDeclaration':
101
- case 'TSDeclareFunction':
102
- case 'TSInterfaceDeclaration':
103
- case 'TSTypeAliasDeclaration':
104
- checkTypeParams(nde.declaration);
105
- break;
106
- }
107
- break;
108
- }
109
- };
110
- const usedNameToTag = new Map();
111
-
112
- /**
113
- * @param {import('comment-parser').Spec} potentialTag
114
- */
115
- const checkForUsedTypes = potentialTag => {
116
- let parsedType;
117
- try {
118
- parsedType = mode === 'permissive' ? (0, _jsdoccomment.tryParse)(/** @type {string} */potentialTag.type) : (0, _jsdoccomment.parse)(/** @type {string} */potentialTag.type, mode);
119
- } catch {
120
- return;
121
- }
122
- (0, _jsdoccomment.traverse)(parsedType, nde => {
123
- if (nde.type === 'JsdocTypeTypeParameter') {
124
- templateNames.push(nde.name.value);
125
- return;
126
- }
127
- if (nde.type === 'JsdocTypeInfer') {
128
- templateNames.push(nde.element.value);
129
- return;
130
- }
131
- const {
132
- type,
133
- value
134
- } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */nde;
135
- if (type === 'JsdocTypeName' && /^[A-Z]$/v.test(value)) {
136
- usedNames.add(value);
137
- if (!usedNameToTag.has(value)) {
138
- usedNameToTag.set(value, potentialTag);
139
- }
140
- }
141
- });
142
- };
143
-
144
- /**
145
- * @param {string[]} tagNames
146
- */
147
- const checkTagsAndTemplates = tagNames => {
148
- for (const tagName of tagNames) {
149
- const preferredTagName = /** @type {string} */utils.getPreferredTagName({
150
- tagName
151
- });
152
- const matchingTags = utils.getTags(preferredTagName);
153
- for (const matchingTag of matchingTags) {
154
- checkForUsedTypes(matchingTag);
155
- }
156
- }
157
-
158
- // Could check against whitelist/blacklist
159
- for (const usedName of usedNames) {
160
- if (!templateNames.includes(usedName)) {
161
- report(`Missing @${tgName} ${usedName}`, null, usedNameToTag.get(usedName));
162
- }
163
- }
164
- };
165
- const callbackTags = utils.getTags('callback');
166
- const functionTags = utils.getTags('function');
167
- if (callbackTags.length || functionTags.length) {
168
- checkTagsAndTemplates(['param', 'returns']);
169
- return;
170
- }
171
- const typedefTags = utils.getTags('typedef');
172
- if (!typedefTags.length || typedefTags.length >= 2) {
173
- handleTypes();
174
- return;
175
- }
176
- const potentialTypedef = typedefTags[0];
177
- checkForUsedTypes(potentialTypedef);
178
- checkTagsAndTemplates(['property']);
179
- }, {
180
- iterateAllJsdocs: true,
181
- meta: {
182
- docs: {
183
- description: 'Requires `@template` tags be present when type parameters are used.',
184
- url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header'
185
- },
186
- schema: [{
187
- additionalProperties: false,
188
- properties: {
189
- exemptedBy: {
190
- description: `Array of tags (e.g., \`['type']\`) whose presence on the document
191
- block avoids the need for a \`@template\`. Defaults to an array with
192
- \`inheritdoc\`. If you set this array, it will overwrite the default,
193
- so be sure to add back \`inheritdoc\` if you wish its presence to cause
194
- exemption of the rule.`,
195
- items: {
196
- type: 'string'
197
- },
198
- type: 'array'
199
- },
200
- requireSeparateTemplates: {
201
- description: `Requires that each template have its own separate line, i.e., preventing
202
- templates of this format:
203
-
204
- \`\`\`js
205
- /**
206
- * @template T, U, V
207
- */
208
- \`\`\`
209
-
210
- Defaults to \`false\`.`,
211
- type: 'boolean'
212
- }
213
- },
214
- type: 'object'
215
- }],
216
- type: 'suggestion'
217
- }
218
- });
219
- module.exports = exports.default;
220
- //# sourceMappingURL=requireTemplate.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requireTemplate.cjs","names":["iterateJsdoc","tryParseType","parseType","traverse"],"sources":["../../src/rules/requireTemplate.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n parse as parseType,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n utils,\n}) => {\n if (utils.avoidDocs()) {\n return;\n }\n\n const {\n requireSeparateTemplates = false,\n } = context.options[0] || {};\n\n const {\n mode,\n } = settings;\n\n const usedNames = new Set();\n\n const tgName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'template',\n }));\n if (!tgName) {\n return;\n }\n\n const templateTags = utils.getTags(tgName);\n\n const templateNames = templateTags.flatMap((tag) => {\n return utils.parseClosureTemplateTag(tag);\n });\n\n if (requireSeparateTemplates) {\n for (const tag of templateTags) {\n const names = utils.parseClosureTemplateTag(tag);\n if (names.length > 1) {\n report(`Missing separate @${tgName} for ${names[1]}`, null, tag);\n }\n }\n }\n\n /**\n * @param {import('@typescript-eslint/types').TSESTree.FunctionDeclaration|\n * import('@typescript-eslint/types').TSESTree.ClassDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSDeclareFunction|\n * import('@typescript-eslint/types').TSESTree.TSInterfaceDeclaration|\n * import('@typescript-eslint/types').TSESTree.TSTypeAliasDeclaration} aliasDeclaration\n */\n const checkTypeParams = (aliasDeclaration) => {\n const {\n params,\n /* c8 ignore next -- Guard */\n } = aliasDeclaration.typeParameters ?? {\n /* c8 ignore next -- Guard */\n params: [],\n };\n for (const {\n name: {\n name,\n },\n } of params) {\n usedNames.add(name);\n }\n\n for (const usedName of usedNames) {\n if (!templateNames.includes(usedName)) {\n report(`Missing @${tgName} ${usedName}`);\n }\n }\n };\n\n const handleTypes = () => {\n const nde = /** @type {import('@typescript-eslint/types').TSESTree.Node} */ (\n node\n );\n if (!nde) {\n return;\n }\n\n switch (nde.type) {\n case 'ClassDeclaration':\n case 'FunctionDeclaration':\n case 'TSDeclareFunction':\n case 'TSInterfaceDeclaration':\n case 'TSTypeAliasDeclaration':\n checkTypeParams(nde);\n break;\n case 'ExportDefaultDeclaration':\n switch (nde.declaration?.type) {\n case 'ClassDeclaration':\n case 'FunctionDeclaration':\n case 'TSInterfaceDeclaration':\n checkTypeParams(nde.declaration);\n break;\n }\n\n break;\n case 'ExportNamedDeclaration':\n switch (nde.declaration?.type) {\n case 'ClassDeclaration':\n case 'FunctionDeclaration':\n case 'TSDeclareFunction':\n case 'TSInterfaceDeclaration':\n case 'TSTypeAliasDeclaration':\n checkTypeParams(nde.declaration);\n break;\n }\n\n break;\n }\n };\n\n const usedNameToTag = new Map();\n\n /**\n * @param {import('comment-parser').Spec} potentialTag\n */\n const checkForUsedTypes = (potentialTag) => {\n let parsedType;\n try {\n parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialTag.type)) :\n parseType(/** @type {string} */ (potentialTag.type), mode);\n } catch {\n return;\n }\n\n traverse(parsedType, (nde) => {\n if (nde.type === 'JsdocTypeTypeParameter') {\n templateNames.push(nde.name.value);\n return;\n }\n\n if (nde.type === 'JsdocTypeInfer') {\n templateNames.push(nde.element.value);\n return;\n }\n\n const {\n type,\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n\n if (type === 'JsdocTypeName' && (/^[A-Z]$/v).test(value)) {\n usedNames.add(value);\n if (!usedNameToTag.has(value)) {\n usedNameToTag.set(value, potentialTag);\n }\n }\n });\n };\n\n /**\n * @param {string[]} tagNames\n */\n const checkTagsAndTemplates = (tagNames) => {\n for (const tagName of tagNames) {\n const preferredTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName,\n }));\n const matchingTags = utils.getTags(preferredTagName);\n for (const matchingTag of matchingTags) {\n checkForUsedTypes(matchingTag);\n }\n }\n\n // Could check against whitelist/blacklist\n for (const usedName of usedNames) {\n if (!templateNames.includes(usedName)) {\n report(`Missing @${tgName} ${usedName}`, null, usedNameToTag.get(usedName));\n }\n }\n };\n\n const callbackTags = utils.getTags('callback');\n const functionTags = utils.getTags('function');\n if (callbackTags.length || functionTags.length) {\n checkTagsAndTemplates([\n 'param', 'returns',\n ]);\n return;\n }\n\n const typedefTags = utils.getTags('typedef');\n if (!typedefTags.length || typedefTags.length >= 2) {\n handleTypes();\n return;\n }\n\n const potentialTypedef = typedefTags[0];\n checkForUsedTypes(potentialTypedef);\n\n checkTagsAndTemplates([\n 'property',\n ]);\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires `@template` tags be present when type parameters are used.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n exemptedBy: {\n description: `Array of tags (e.g., \\`['type']\\`) whose presence on the document\nblock avoids the need for a \\`@template\\`. 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 requireSeparateTemplates: {\n description: `Requires that each template have its own separate line, i.e., preventing\ntemplates of this format:\n\n\\`\\`\\`js\n/**\n * @template T, U, V\n */\n\\`\\`\\`\n\nDefaults to \\`false\\`.`,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA;AACA;AAI8B;AAAA,iCAEf,IAAAA,qBAAY,EAAC,CAAC;EAC3B,OAAO;EACP,IAAI;EACJ,MAAM;EACN,QAAQ;EACR;AACF,CAAC,KAAK;EACJ,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE;IACrB;EACF;EAEA,MAAM;IACJ,wBAAwB,GAAG;EAC7B,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAM;IACJ;EACF,CAAC,GAAG,QAAQ;EAEZ,MAAM,SAAS,GAAG,IAAI,GAAG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5C,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,MAAM,IAAI,CAAC,EAAE;IAClD,WAAW,CAAC,CAAC;IACb;EACF;EAEA,MAAM,gBAAgB,GAAG,WAAW,CAAC,CAAC,CAAC;EACvC,iBAAiB,CAAC,gBAAgB,CAAC;EAEnC,qBAAqB,CAAC,CACpB,UAAU,CACX,CAAC;AACJ,CAAC,EAAE;EACD,gBAAgB,EAAE,IAAI;EACtB,IAAI,EAAE;IACJ,IAAI,EAAE;MACJ,WAAW,EAAE,qEAAqE;MAClF,GAAG,EAAE;IACP,CAAC;IACD,MAAM,EAAE,CACN;MACE,oBAAoB,EAAE,KAAK;MAC3B,UAAU,EAAE;QACV,UAAU,EAAE;UACV,WAAW,EAAE;AACzB;AACA;AACA;AACA,uBAAuB;UACX,KAAK,EAAE;YACL,IAAI,EAAE;UACR,CAAC;UACD,IAAI,EAAE;QACR,CAAC;QACD,wBAAwB,EAAE;UACxB,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;UACX,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA","ignoreList":[]}
@@ -1,118 +0,0 @@
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
- /**
10
- * We can skip checking for a throws value, in case the documentation is inherited
11
- * or the method is either a constructor or an abstract method.
12
- * @param {import('../iterateJsdoc.js').Utils} utils a reference to the utils which are used to probe if a tag is present or not.
13
- * @returns {boolean} true in case deep checking can be skipped; otherwise false.
14
- */
15
- const canSkip = utils => {
16
- return utils.hasATag([
17
- // inheritdoc implies that all documentation is inherited
18
- // see https://jsdoc.app/tags-inheritdoc.html
19
- //
20
- // Abstract methods are by definition incomplete,
21
- // so it is not necessary to document that they throw an error.
22
- 'abstract', 'virtual',
23
- // The designated type can itself document `@throws`
24
- 'type']) || utils.avoidDocs(false);
25
- };
26
- var _default = exports.default = (0, _iterateJsdoc.default)(({
27
- report,
28
- utils
29
- }) => {
30
- // A preflight check. We do not need to run a deep check for abstract
31
- // functions.
32
- if (canSkip(utils)) {
33
- return;
34
- }
35
- const tagName = /** @type {string} */utils.getPreferredTagName({
36
- tagName: 'throws'
37
- });
38
- if (!tagName) {
39
- return;
40
- }
41
- const tags = utils.getTags(tagName);
42
- const iteratingFunction = utils.isIteratingFunction();
43
-
44
- // In case the code returns something, we expect a return value in JSDoc.
45
- const [tag] = tags;
46
- const missingThrowsTag = typeof tag === 'undefined' || tag === null;
47
- const shouldReport = () => {
48
- if (!missingThrowsTag) {
49
- if (tag.type.trim() === 'never' && iteratingFunction && utils.hasThrowValue()) {
50
- report(`JSDoc @${tagName} declaration set to "never" but throw value found.`);
51
- }
52
- return false;
53
- }
54
- return iteratingFunction && utils.hasThrowValue();
55
- };
56
- if (shouldReport()) {
57
- report(`Missing JSDoc @${tagName} declaration.`);
58
- }
59
- }, {
60
- contextDefaults: true,
61
- meta: {
62
- docs: {
63
- description: 'Requires that throw statements are documented with `@throws` tags.',
64
- url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws.md#repos-sticky-header'
65
- },
66
- schema: [{
67
- additionalProperties: false,
68
- properties: {
69
- contexts: {
70
- description: `Set this to an array of strings representing the AST context
71
- (or objects with optional \`context\` and \`comment\` properties) where you wish
72
- the rule to be applied.
73
-
74
- \`context\` defaults to \`any\` and \`comment\` defaults to no specific comment context.
75
-
76
- Overrides the default contexts (\`ArrowFunctionExpression\`, \`FunctionDeclaration\`,
77
- \`FunctionExpression\`). Set to \`"any"\` if you want
78
- the rule to apply to any JSDoc block throughout your files (as is necessary
79
- for finding function blocks not attached to a function declaration or
80
- expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
81
- \`@method\`) (including those associated with an \`@interface\`).`,
82
- items: {
83
- anyOf: [{
84
- type: 'string'
85
- }, {
86
- additionalProperties: false,
87
- properties: {
88
- comment: {
89
- type: 'string'
90
- },
91
- context: {
92
- type: 'string'
93
- }
94
- },
95
- type: 'object'
96
- }]
97
- },
98
- type: 'array'
99
- },
100
- exemptedBy: {
101
- description: `Array of tags (e.g., \`['type']\`) whose presence on the
102
- document block avoids the need for a \`@throws\`. Defaults to an array
103
- with \`inheritdoc\`. If you set this array, it will overwrite the default,
104
- so be sure to add back \`inheritdoc\` if you wish its presence to cause
105
- exemption of the rule.`,
106
- items: {
107
- type: 'string'
108
- },
109
- type: 'array'
110
- }
111
- },
112
- type: 'object'
113
- }],
114
- type: 'suggestion'
115
- }
116
- });
117
- module.exports = exports.default;
118
- //# sourceMappingURL=requireThrows.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requireThrows.cjs","names":["iterateJsdoc"],"sources":["../../src/rules/requireThrows.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * We can skip checking for a throws value, in case the documentation is inherited\n * or the method is either a constructor or an abstract method.\n * @param {import('../iterateJsdoc.js').Utils} utils a reference to the utils which are used to probe if a tag is present or not.\n * @returns {boolean} true in case deep checking can be skipped; otherwise false.\n */\nconst canSkip = (utils) => {\n return utils.hasATag([\n // inheritdoc implies that all documentation is inherited\n // see https://jsdoc.app/tags-inheritdoc.html\n //\n // Abstract methods are by definition incomplete,\n // so it is not necessary to document that they throw an error.\n 'abstract',\n 'virtual',\n\n // The designated type can itself document `@throws`\n 'type',\n ]) ||\n utils.avoidDocs(false);\n};\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n // A preflight check. We do not need to run a deep check for abstract\n // functions.\n if (canSkip(utils)) {\n return;\n }\n\n const tagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'throws',\n }));\n if (!tagName) {\n return;\n }\n\n const tags = utils.getTags(tagName);\n const iteratingFunction = utils.isIteratingFunction();\n\n // In case the code returns something, we expect a return value in JSDoc.\n const [\n tag,\n ] = tags;\n const missingThrowsTag = typeof tag === 'undefined' || tag === null;\n\n const shouldReport = () => {\n if (!missingThrowsTag) {\n if (tag.type.trim() === 'never' && iteratingFunction && utils.hasThrowValue()) {\n report(`JSDoc @${tagName} declaration set to \"never\" but throw value found.`);\n }\n\n return false;\n }\n\n return iteratingFunction && utils.hasThrowValue();\n };\n\n if (shouldReport()) {\n report(`Missing JSDoc @${tagName} declaration.`);\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that throw statements are documented with `@throws` tags.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n description: `Set this to an array of strings representing the AST context\n(or objects with optional \\`context\\` and \\`comment\\` properties) where you wish\nthe rule to be applied.\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\nthe rule to apply to any JSDoc block throughout your files (as is necessary\nfor finding function blocks not attached to a function declaration or\nexpression, i.e., \\`@callback\\` or \\`@function\\` (or its aliases \\`@func\\` or\n\\`@method\\`) (including those associated with an \\`@interface\\`).`,\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 exemptedBy: {\n description: `Array of tags (e.g., \\`['type']\\`) whose presence on the\ndocument block avoids the need for a \\`@throws\\`. Defaults to an array\nwith \\`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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AClD;AACF,CAAC,EAAE;EACD,eAAe,EAAE,IAAI;EACrB,IAAI,EAAE;IACJ,IAAI,EAAE;MACJ,WAAW,EAAE,oEAAoE;MACjF,GAAG,EAAE;IACP,CAAC;IACD,MAAM,EAAE,CACN;MACE,oBAAoB,EAAE,KAAK;MAC3B,UAAU,EAAE;QACV,QAAQ,EAAE;UACR,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;UACtD,KAAK,EAAE;YACL,KAAK,EAAE,CACL;cACE,IAAI,EAAE;YACR,CAAC,EACD;cACE,oBAAoB,EAAE,KAAK;cAC3B,UAAU,EAAE;gBACV,OAAO,EAAE;kBACP,IAAI,EAAE;gBACR,CAAC;gBACD,OAAO,EAAE;kBACP,IAAI,EAAE;gBACR;cACF,CAAC;cACD,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACD,IAAI,EAAE;QACR,CAAC;QACD,UAAU,EAAE;UACV,WAAW,EAAE;AACzB;AACA;AACA;AACA,uBAAuB;UACX,KAAK,EAAE;YACL,IAAI,EAAE;UACR,CAAC;UACD,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA","ignoreList":[]}
@@ -1,224 +0,0 @@
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
- /**
10
- * We can skip checking for a yield value, in case the documentation is inherited
11
- * or the method has a constructor or abstract tag.
12
- *
13
- * In either of these cases the yield value is optional or not defined.
14
- * @param {import('../iterateJsdoc.js').Utils} utils a reference to the utils which are used to probe if a tag is present or not.
15
- * @returns {boolean} true in case deep checking can be skipped; otherwise false.
16
- */
17
- const canSkip = utils => {
18
- return utils.hasATag([
19
- // inheritdoc implies that all documentation is inherited
20
- // see https://jsdoc.app/tags-inheritdoc.html
21
- //
22
- // Abstract methods are by definition incomplete,
23
- // so it is not an error if it declares a yield value but does not implement it.
24
- 'abstract', 'virtual',
25
- // Constructors do not have a yield value
26
- // so we can bail out here, too.
27
- 'class', 'constructor',
28
- // Yield (and any `next`) type is specified accompanying the targeted
29
- // @type
30
- 'type',
31
- // This seems to imply a class as well
32
- 'interface']) || utils.avoidDocs();
33
- };
34
-
35
- /**
36
- * @param {import('../iterateJsdoc.js').Utils} utils
37
- * @param {import('../iterateJsdoc.js').Report} report
38
- * @param {string} tagName
39
- * @returns {[preferredTagName?: string, missingTag?: boolean]}
40
- */
41
- const checkTagName = (utils, report, tagName) => {
42
- const preferredTagName = /** @type {string} */utils.getPreferredTagName({
43
- tagName
44
- });
45
- if (!preferredTagName) {
46
- return [];
47
- }
48
- const tags = utils.getTags(preferredTagName);
49
- if (tags.length > 1) {
50
- report(`Found more than one @${preferredTagName} declaration.`);
51
- }
52
-
53
- // In case the code yields something, we expect a yields value in JSDoc.
54
- const [tag] = tags;
55
- const missingTag = typeof tag === 'undefined' || tag === null;
56
- return [preferredTagName, missingTag];
57
- };
58
- var _default = exports.default = (0, _iterateJsdoc.default)(({
59
- context,
60
- report,
61
- utils
62
- }) => {
63
- const {
64
- forceRequireNext = false,
65
- forceRequireYields = false,
66
- next = false,
67
- nextWithGeneratorTag = false,
68
- withGeneratorTag = true
69
- } = context.options[0] || {};
70
-
71
- // A preflight check. We do not need to run a deep check
72
- // in case the @yield comment is optional or undefined.
73
- if (canSkip(utils)) {
74
- return;
75
- }
76
- const iteratingFunction = utils.isIteratingFunction();
77
- const [preferredYieldTagName, missingYieldTag] = checkTagName(utils, report, 'yields');
78
- if (preferredYieldTagName) {
79
- const shouldReportYields = () => {
80
- if (!missingYieldTag) {
81
- return false;
82
- }
83
- if (withGeneratorTag && utils.hasTag('generator') || forceRequireYields && iteratingFunction && utils.isGenerator()) {
84
- return true;
85
- }
86
- return iteratingFunction && utils.isGenerator() && utils.hasYieldValue();
87
- };
88
- if (shouldReportYields()) {
89
- report(`Missing JSDoc @${preferredYieldTagName} declaration.`);
90
- }
91
- }
92
- if (next || nextWithGeneratorTag || forceRequireNext) {
93
- const [preferredNextTagName, missingNextTag] = checkTagName(utils, report, 'next');
94
- if (!preferredNextTagName) {
95
- return;
96
- }
97
- const shouldReportNext = () => {
98
- if (!missingNextTag) {
99
- return false;
100
- }
101
- if (nextWithGeneratorTag && utils.hasTag('generator')) {
102
- return true;
103
- }
104
- if (!next && !forceRequireNext || !iteratingFunction || !utils.isGenerator()) {
105
- return false;
106
- }
107
- return forceRequireNext || utils.hasYieldReturnValue();
108
- };
109
- if (shouldReportNext()) {
110
- report(`Missing JSDoc @${preferredNextTagName} declaration.`);
111
- }
112
- }
113
- }, {
114
- contextDefaults: true,
115
- meta: {
116
- docs: {
117
- description: 'Requires yields are documented with `@yields` tags.',
118
- url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields.md#repos-sticky-header'
119
- },
120
- schema: [{
121
- additionalProperties: false,
122
- properties: {
123
- contexts: {
124
- description: `Set this to an array of strings representing the AST context
125
- (or objects with optional \`context\` and \`comment\` properties) where you wish
126
- the rule to be applied.
127
-
128
- \`context\` defaults to \`any\` and \`comment\` defaults to no specific comment context.
129
-
130
- Overrides the default contexts (\`ArrowFunctionExpression\`, \`FunctionDeclaration\`,
131
- \`FunctionExpression\`). Set to \`"any"\` if you want
132
- the rule to apply to any JSDoc block throughout your files (as is necessary
133
- for finding function blocks not attached to a function declaration or
134
- expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
135
- \`@method\`) (including those associated with an \`@interface\`). This
136
- rule will only apply on non-default contexts when there is such a tag
137
- present and the \`forceRequireYields\` option is set or if the
138
- \`withGeneratorTag\` option is set with a present \`@generator\` tag
139
- (since we are not checking against the actual \`yield\` values in these
140
- cases).`,
141
- items: {
142
- anyOf: [{
143
- type: 'string'
144
- }, {
145
- additionalProperties: false,
146
- properties: {
147
- comment: {
148
- type: 'string'
149
- },
150
- context: {
151
- type: 'string'
152
- }
153
- },
154
- type: 'object'
155
- }]
156
- },
157
- type: 'array'
158
- },
159
- exemptedBy: {
160
- description: `Array of tags (e.g., \`['type']\`) whose presence on the
161
- document block avoids the need for a \`@yields\`. Defaults to an array
162
- with \`inheritdoc\`. If you set this array, it will overwrite the default,
163
- so be sure to add back \`inheritdoc\` if you wish its presence to cause
164
- exemption of the rule.`,
165
- items: {
166
- type: 'string'
167
- },
168
- type: 'array'
169
- },
170
- forceRequireNext: {
171
- default: false,
172
- description: `Set to \`true\` to always insist on
173
- \`@next\` documentation even if there are no \`yield\` statements in the
174
- function or none return values. May be desired to flag that a project is
175
- aware of the expected yield return being \`undefined\`. Defaults to \`false\`.`,
176
- type: 'boolean'
177
- },
178
- forceRequireYields: {
179
- default: false,
180
- description: `Set to \`true\` to always insist on
181
- \`@yields\` documentation for generators even if there are only
182
- expressionless \`yield\` statements in the function. May be desired to flag
183
- that a project is aware of an \`undefined\`/\`void\` yield. Defaults to
184
- \`false\`.`,
185
- type: 'boolean'
186
- },
187
- next: {
188
- default: false,
189
- description: `If \`true\`, this option will insist that any use of a \`yield\` return
190
- value (e.g., \`const rv = yield;\` or \`const rv = yield value;\`) has a
191
- (non-standard) \`@next\` tag (in addition to any \`@yields\` tag) so as to be
192
- able to document the type expected to be supplied into the iterator
193
- (the \`Generator\` iterator that is returned by the call to the generator
194
- function) to the iterator (e.g., \`it.next(value)\`). The tag will not be
195
- expected if the generator function body merely has plain \`yield;\` or
196
- \`yield value;\` statements without returning the values. Defaults to
197
- \`false\`.`,
198
- type: 'boolean'
199
- },
200
- nextWithGeneratorTag: {
201
- default: false,
202
- description: `If a \`@generator\` tag is present on a block, require
203
- (non-standard ) \`@next\` (see \`next\` option). This will require using \`void\`
204
- or \`undefined\` in cases where generators do not use the \`next()\`-supplied
205
- incoming \`yield\`-returned value. Defaults to \`false\`. See \`contexts\` to
206
- \`any\` if you want to catch \`@generator\` with \`@callback\` or such not
207
- attached to a function.`,
208
- type: 'boolean'
209
- },
210
- withGeneratorTag: {
211
- default: true,
212
- description: `If a \`@generator\` tag is present on a block, require
213
- \`@yields\`/\`@yield\`. Defaults to \`true\`. See \`contexts\` to \`any\` if you want
214
- to catch \`@generator\` with \`@callback\` or such not attached to a function.`,
215
- type: 'boolean'
216
- }
217
- },
218
- type: 'object'
219
- }],
220
- type: 'suggestion'
221
- }
222
- });
223
- module.exports = exports.default;
224
- //# sourceMappingURL=requireYields.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requireYields.cjs","names":["iterateJsdoc"],"sources":["../../src/rules/requireYields.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * We can skip checking for a yield value, in case the documentation is inherited\n * or the method has a constructor or abstract tag.\n *\n * In either of these cases the yield value is optional or not defined.\n * @param {import('../iterateJsdoc.js').Utils} utils a reference to the utils which are used to probe if a tag is present or not.\n * @returns {boolean} true in case deep checking can be skipped; otherwise false.\n */\nconst canSkip = (utils) => {\n return utils.hasATag([\n // inheritdoc implies that all documentation is inherited\n // see https://jsdoc.app/tags-inheritdoc.html\n //\n // Abstract methods are by definition incomplete,\n // so it is not an error if it declares a yield value but does not implement it.\n 'abstract',\n 'virtual',\n\n // Constructors do not have a yield value\n // so we can bail out here, too.\n 'class',\n 'constructor',\n\n // Yield (and any `next`) type is specified accompanying the targeted\n // @type\n 'type',\n\n // This seems to imply a class as well\n 'interface',\n ]) ||\n utils.avoidDocs();\n};\n\n/**\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @param {import('../iterateJsdoc.js').Report} report\n * @param {string} tagName\n * @returns {[preferredTagName?: string, missingTag?: boolean]}\n */\nconst checkTagName = (utils, report, tagName) => {\n const preferredTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName,\n }));\n if (!preferredTagName) {\n return [];\n }\n\n const tags = utils.getTags(preferredTagName);\n\n if (tags.length > 1) {\n report(`Found more than one @${preferredTagName} declaration.`);\n }\n\n // In case the code yields something, we expect a yields value in JSDoc.\n const [\n tag,\n ] = tags;\n const missingTag = typeof tag === 'undefined' || tag === null;\n\n return [\n preferredTagName, missingTag,\n ];\n};\n\nexport default iterateJsdoc(({\n context,\n report,\n utils,\n}) => {\n const {\n forceRequireNext = false,\n forceRequireYields = false,\n next = false,\n nextWithGeneratorTag = false,\n withGeneratorTag = true,\n } = context.options[0] || {};\n\n // A preflight check. We do not need to run a deep check\n // in case the @yield comment is optional or undefined.\n if (canSkip(utils)) {\n return;\n }\n\n const iteratingFunction = utils.isIteratingFunction();\n\n const [\n preferredYieldTagName,\n missingYieldTag,\n ] = checkTagName(\n utils, report, 'yields',\n );\n if (preferredYieldTagName) {\n const shouldReportYields = () => {\n if (!missingYieldTag) {\n return false;\n }\n\n if (\n withGeneratorTag && utils.hasTag('generator') ||\n forceRequireYields && iteratingFunction && utils.isGenerator()\n ) {\n return true;\n }\n\n return iteratingFunction && utils.isGenerator() && utils.hasYieldValue();\n };\n\n if (shouldReportYields()) {\n report(`Missing JSDoc @${preferredYieldTagName} declaration.`);\n }\n }\n\n if (next || nextWithGeneratorTag || forceRequireNext) {\n const [\n preferredNextTagName,\n missingNextTag,\n ] = checkTagName(\n utils, report, 'next',\n );\n if (!preferredNextTagName) {\n return;\n }\n\n const shouldReportNext = () => {\n if (!missingNextTag) {\n return false;\n }\n\n if (\n nextWithGeneratorTag && utils.hasTag('generator')) {\n return true;\n }\n\n if (\n !next && !forceRequireNext ||\n !iteratingFunction ||\n !utils.isGenerator()\n ) {\n return false;\n }\n\n return forceRequireNext || utils.hasYieldReturnValue();\n };\n\n if (shouldReportNext()) {\n report(`Missing JSDoc @${preferredNextTagName} declaration.`);\n }\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires yields are documented with `@yields` tags.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n description: `Set this to an array of strings representing the AST context\n(or objects with optional \\`context\\` and \\`comment\\` properties) where you wish\nthe rule to be applied.\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\nthe rule to apply to any JSDoc block throughout your files (as is necessary\nfor finding function blocks not attached to a function declaration or\nexpression, i.e., \\`@callback\\` or \\`@function\\` (or its aliases \\`@func\\` or\n\\`@method\\`) (including those associated with an \\`@interface\\`). This\nrule will only apply on non-default contexts when there is such a tag\npresent and the \\`forceRequireYields\\` option is set or if the\n\\`withGeneratorTag\\` option is set with a present \\`@generator\\` tag\n(since we are not checking against the actual \\`yield\\` values in these\ncases).`,\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 exemptedBy: {\n description: `Array of tags (e.g., \\`['type']\\`) whose presence on the\ndocument block avoids the need for a \\`@yields\\`. Defaults to an array\nwith \\`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 forceRequireNext: {\n default: false,\n description: `Set to \\`true\\` to always insist on\n\\`@next\\` documentation even if there are no \\`yield\\` statements in the\nfunction or none return values. May be desired to flag that a project is\naware of the expected yield return being \\`undefined\\`. Defaults to \\`false\\`.`,\n type: 'boolean',\n },\n forceRequireYields: {\n default: false,\n description: `Set to \\`true\\` to always insist on\n\\`@yields\\` documentation for generators even if there are only\nexpressionless \\`yield\\` statements in the function. May be desired to flag\nthat a project is aware of an \\`undefined\\`/\\`void\\` yield. Defaults to\n\\`false\\`.`,\n type: 'boolean',\n },\n next: {\n default: false,\n description: `If \\`true\\`, this option will insist that any use of a \\`yield\\` return\nvalue (e.g., \\`const rv = yield;\\` or \\`const rv = yield value;\\`) has a\n(non-standard) \\`@next\\` tag (in addition to any \\`@yields\\` tag) so as to be\nable to document the type expected to be supplied into the iterator\n(the \\`Generator\\` iterator that is returned by the call to the generator\nfunction) to the iterator (e.g., \\`it.next(value)\\`). The tag will not be\nexpected if the generator function body merely has plain \\`yield;\\` or\n\\`yield value;\\` statements without returning the values. Defaults to\n\\`false\\`.`,\n type: 'boolean',\n },\n nextWithGeneratorTag: {\n default: false,\n description: `If a \\`@generator\\` tag is present on a block, require\n(non-standard ) \\`@next\\` (see \\`next\\` option). This will require using \\`void\\`\nor \\`undefined\\` in cases where generators do not use the \\`next()\\`-supplied\nincoming \\`yield\\`-returned value. Defaults to \\`false\\`. See \\`contexts\\` to\n\\`any\\` if you want to catch \\`@generator\\` with \\`@callback\\` or such not\nattached to a function.`,\n type: 'boolean',\n },\n withGeneratorTag: {\n default: true,\n description: `If a \\`@generator\\` tag is present on a block, require\n\\`@yields\\`/\\`@yield\\`. Defaults to \\`true\\`. See \\`contexts\\` to \\`any\\` if you want\nto catch \\`@generator\\` with \\`@callback\\` or such not attached to a function.`,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA;AAA8C;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,OAAO,GAAI,KAAK,IAAK;EACzB,OAAO,KAAK,CAAC,OAAO,CAAC;EACnB;EACA;EACA;EACA;EACA;EACA,UAAU,EACV,SAAS;EAET;EACA;EACA,OAAO,EACP,aAAa;EAEb;EACA;EACA,MAAM;EAEN;EACA,WAAW,CACZ,CAAC,IACA,KAAK,CAAC,SAAS,CAAC,CAAC;AACrB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,KAAK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K,EAAE;YACL,KAAK,EAAE,CACL;cACE,IAAI,EAAE;YACR,CAAC,EACD;cACE,oBAAoB,EAAE,KAAK;cAC3B,UAAU,EAAE;gBACV,OAAO,EAAE;kBACP,IAAI,EAAE;gBACR,CAAC;gBACD,OAAO,EAAE;kBACP,IAAI,EAAE;gBACR;cACF,CAAC;cACD,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACD,IAAI,EAAE;QACR,CAAC;QACD,UAAU,EAAE;UACV,WAAW,EAAE;AACzB;AACA;AACA;AACA,uBAAuB;UACX,KAAK,EAAE;YACL,IAAI,EAAE;UACR,CAAC;UACD,IAAI,EAAE;QACR,CAAC;QACD,gBAAgB,EAAE;UAChB,OAAO,EAAE,KAAK;UACd,WAAW,EAAE;AACzB;AACA;AACA,+EAA+E;UACnE,IAAI,EAAE;QACR,CAAC;QACD,kBAAkB,EAAE;UAClB,OAAO,EAAE,KAAK;UACd,WAAW,EAAE;AACzB;AACA;AACA;AACA,WAAW;UACC,IAAI,EAAE;QACR,CAAC;QACD,IAAI,EAAE;UACJ,OAAO,EAAE,KAAK;UACd,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;UACC,IAAI,EAAE;QACR,CAAC;QACD,oBAAoB,EAAE;UACpB,OAAO,EAAE,KAAK;UACd,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA,wBAAwB;UACZ,IAAI,EAAE;QACR,CAAC;QACD,gBAAgB,EAAE;UAChB,OAAO,EAAE,IAAI;UACb,WAAW,EAAE;AACzB;AACA,+EAA+E;UACnE,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA","ignoreList":[]}