eslint-plugin-jsdoc 44.2.4 → 44.2.5

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 (67) hide show
  1. package/dist/WarnSettings.js +0 -1
  2. package/dist/WarnSettings.js.map +1 -1
  3. package/dist/alignTransform.js +1 -1
  4. package/dist/alignTransform.js.map +1 -1
  5. package/dist/bin/generateRule.js +4 -3
  6. package/dist/bin/generateRule.js.map +1 -1
  7. package/dist/exportParser.js +206 -135
  8. package/dist/exportParser.js.map +1 -1
  9. package/dist/generateRule.js +4 -3
  10. package/dist/generateRule.js.map +1 -1
  11. package/dist/iterateJsdoc.js +21 -48
  12. package/dist/iterateJsdoc.js.map +1 -1
  13. package/dist/jsdocUtils.js +126 -92
  14. package/dist/jsdocUtils.js.map +1 -1
  15. package/dist/rules/checkExamples.js +3 -3
  16. package/dist/rules/checkExamples.js.map +1 -1
  17. package/dist/rules/checkIndentation.js +1 -1
  18. package/dist/rules/checkIndentation.js.map +1 -1
  19. package/dist/rules/checkLineAlignment.js +3 -3
  20. package/dist/rules/checkLineAlignment.js.map +1 -1
  21. package/dist/rules/checkParamNames.js +17 -4
  22. package/dist/rules/checkParamNames.js.map +1 -1
  23. package/dist/rules/checkTagNames.js +2 -6
  24. package/dist/rules/checkTagNames.js.map +1 -1
  25. package/dist/rules/checkTypes.js +1 -5
  26. package/dist/rules/checkTypes.js.map +1 -1
  27. package/dist/rules/checkValues.js +1 -1
  28. package/dist/rules/checkValues.js.map +1 -1
  29. package/dist/rules/informativeDocs.js +1 -1
  30. package/dist/rules/informativeDocs.js.map +1 -1
  31. package/dist/rules/noBadBlocks.js +1 -1
  32. package/dist/rules/noBadBlocks.js.map +1 -1
  33. package/dist/rules/noMissingSyntax.js +3 -9
  34. package/dist/rules/noMissingSyntax.js.map +1 -1
  35. package/dist/rules/noRestrictedSyntax.js +3 -9
  36. package/dist/rules/noRestrictedSyntax.js.map +1 -1
  37. package/dist/rules/noUndefinedTypes.js +5 -8
  38. package/dist/rules/noUndefinedTypes.js.map +1 -1
  39. package/dist/rules/requireDescriptionCompleteSentence.js +3 -3
  40. package/dist/rules/requireDescriptionCompleteSentence.js.map +1 -1
  41. package/dist/rules/requireHyphenBeforeParamDescription.js +3 -6
  42. package/dist/rules/requireHyphenBeforeParamDescription.js.map +1 -1
  43. package/dist/rules/requireJsdoc.js +12 -7
  44. package/dist/rules/requireJsdoc.js.map +1 -1
  45. package/dist/rules/requireParam.js +83 -21
  46. package/dist/rules/requireParam.js.map +1 -1
  47. package/dist/rules/requireReturns.js +0 -1
  48. package/dist/rules/requireReturns.js.map +1 -1
  49. package/dist/rules/requireThrows.js +0 -1
  50. package/dist/rules/requireThrows.js.map +1 -1
  51. package/dist/rules/requireYields.js +0 -1
  52. package/dist/rules/requireYields.js.map +1 -1
  53. package/dist/rules/sortTags.js +1 -1
  54. package/dist/rules/sortTags.js.map +1 -1
  55. package/dist/rules/textEscaping.js +2 -2
  56. package/dist/rules/textEscaping.js.map +1 -1
  57. package/dist/rules/validTypes.js +1 -1
  58. package/dist/rules/validTypes.js.map +1 -1
  59. package/dist/tagNames.js +0 -2
  60. package/dist/tagNames.js.map +1 -1
  61. package/dist/utils/hasReturnValue.js +0 -5
  62. package/dist/utils/hasReturnValue.js.map +1 -1
  63. package/docs/rules/check-line-alignment.md +7 -0
  64. package/docs/rules/no-undefined-types.md +6 -0
  65. package/docs/rules/require-param.md +4 -0
  66. package/docs/settings.md +2 -0
  67. package/package.json +9 -9
@@ -7,12 +7,15 @@ exports.default = void 0;
7
7
  var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
9
  /**
10
- * @template T
10
+ * @typedef {[string, boolean, () => RootNamerReturn]} RootNamerReturn
11
+ */
12
+ /**
11
13
  * @param {string[]} desiredRoots
12
14
  * @param {number} currentIndex
13
- * @returns {[string, boolean, () => T]}
15
+ * @returns {RootNamerReturn}
14
16
  */
15
17
  const rootNamer = (desiredRoots, currentIndex) => {
18
+ /** @type {string} */
16
19
  let name;
17
20
  let idx = currentIndex;
18
21
  const incremented = desiredRoots.length <= 1;
@@ -21,7 +24,7 @@ const rootNamer = (desiredRoots, currentIndex) => {
21
24
  const suffix = idx++;
22
25
  name = `${base}${suffix}`;
23
26
  } else {
24
- name = desiredRoots.shift();
27
+ name = /** @type {string} */desiredRoots.shift();
25
28
  }
26
29
  return [name, incremented, () => {
27
30
  return rootNamer(desiredRoots, idx);
@@ -65,7 +68,15 @@ var _default = (0, _iterateJsdoc.default)(({
65
68
  if (!functionParameterNames.length) {
66
69
  return;
67
70
  }
68
- const jsdocParameterNames = utils.getJsdocTagsDeep(preferredTagName);
71
+ const jsdocParameterNames =
72
+ /**
73
+ * @type {{
74
+ * idx: import('../iterateJsdoc.js').Integer;
75
+ * name: string;
76
+ * type: string;
77
+ * }[]}
78
+ */
79
+ utils.getJsdocTagsDeep(preferredTagName);
69
80
  const shallowJsdocParameterNames = jsdocParameterNames.filter(tag => {
70
81
  return !tag.name.includes('.');
71
82
  }).map((tag, idx) => {
@@ -75,17 +86,38 @@ var _default = (0, _iterateJsdoc.default)(({
75
86
  };
76
87
  });
77
88
  const checkTypesRegex = utils.getRegexFromString(checkTypesPattern);
89
+
90
+ /**
91
+ * @type {{
92
+ * functionParameterIdx: import('../iterateJsdoc.js').Integer,
93
+ * functionParameterName: string,
94
+ * inc: boolean|undefined,
95
+ * remove?: true,
96
+ * type?: string|undefined
97
+ * }[]}
98
+ */
78
99
  const missingTags = [];
79
100
  const flattenedRoots = utils.flattenRoots(functionParameterNames).names;
101
+
102
+ /**
103
+ * @type {{
104
+ * [key: string]: import('../iterateJsdoc.js').Integer
105
+ * }}
106
+ */
80
107
  const paramIndex = {};
108
+
109
+ /**
110
+ * @param {string} cur
111
+ * @returns {boolean}
112
+ */
81
113
  const hasParamIndex = cur => {
82
114
  return utils.dropPathSegmentQuotes(String(cur)) in paramIndex;
83
115
  };
84
116
 
85
117
  /**
86
118
  *
87
- * @param {} cur
88
- * @returns {}
119
+ * @param {string|number|undefined} cur
120
+ * @returns {import('../iterateJsdoc.js').Integer}
89
121
  */
90
122
  const getParamIndex = cur => {
91
123
  return paramIndex[utils.dropPathSegmentQuotes(String(cur))];
@@ -93,8 +125,8 @@ var _default = (0, _iterateJsdoc.default)(({
93
125
 
94
126
  /**
95
127
  *
96
- * @param {} cur
97
- * @param {} idx
128
+ * @param {string} cur
129
+ * @param {import('../iterateJsdoc.js').Integer} idx
98
130
  * @returns {void}
99
131
  */
100
132
  const setParamIndex = (cur, idx) => {
@@ -106,8 +138,10 @@ var _default = (0, _iterateJsdoc.default)(({
106
138
 
107
139
  /**
108
140
  *
109
- * @param {} jsdocTags
110
- * @param {} indexAtFunctionParams
141
+ * @param {(import('@es-joy/jsdoccomment').JsdocTagWithInline & {
142
+ * newAdd?: boolean
143
+ * })[]} jsdocTags
144
+ * @param {import('../iterateJsdoc.js').Integer} indexAtFunctionParams
111
145
  * @returns {import('../iterateJsdoc.js').Integer}
112
146
  */
113
147
  const findExpectedIndex = (jsdocTags, indexAtFunctionParams) => {
@@ -118,7 +152,14 @@ var _default = (0, _iterateJsdoc.default)(({
118
152
  }) => {
119
153
  return !newAdd && remainingRoots.some(remainingRoot => {
120
154
  if (Array.isArray(remainingRoot)) {
121
- return remainingRoot[1].names.includes(name);
155
+ return (
156
+ /**
157
+ * @type {import('../jsdocUtils.js').FlattendRootInfo & {
158
+ * annotationParamName?: string|undefined;
159
+ * }}
160
+ */
161
+ remainingRoot[1].names.includes(name)
162
+ );
122
163
  }
123
164
  if (typeof remainingRoot === 'object') {
124
165
  return name === remainingRoot.name;
@@ -152,6 +193,8 @@ var _default = (0, _iterateJsdoc.default)(({
152
193
  let inc;
153
194
  if (Array.isArray(functionParameterName)) {
154
195
  const matchedJsdoc = shallowJsdocParameterNames[functionParameterIdx] || jsdocParameterNames[functionParameterIdx];
196
+
197
+ /** @type {string} */
155
198
  let rootName;
156
199
  if (functionParameterName[0]) {
157
200
  rootName = functionParameterName[0];
@@ -170,7 +213,13 @@ var _default = (0, _iterateJsdoc.default)(({
170
213
  hasPropertyRest,
171
214
  rests,
172
215
  names
173
- } = functionParameterName[1];
216
+ } =
217
+ /**
218
+ * @type {import('../jsdocUtils.js').FlattendRootInfo & {
219
+ * annotationParamName?: string | undefined;
220
+ * }}
221
+ */
222
+ functionParameterName[1];
174
223
  const notCheckingNames = [];
175
224
  if (!enableRestElementFixer && hasRestElement) {
176
225
  continue;
@@ -246,16 +295,18 @@ var _default = (0, _iterateJsdoc.default)(({
246
295
  }
247
296
  continue;
248
297
  }
298
+
299
+ /** @type {string} */
249
300
  let funcParamName;
250
301
  let type;
251
302
  if (typeof functionParameterName === 'object') {
252
303
  if (!enableRestElementFixer && functionParameterName.restElement) {
253
304
  continue;
254
305
  }
255
- funcParamName = functionParameterName.name;
306
+ funcParamName = /** @type {string} */functionParameterName.name;
256
307
  type = '{...any}';
257
308
  } else {
258
- funcParamName = functionParameterName;
309
+ funcParamName = /** @type {string} */functionParameterName;
259
310
  }
260
311
  if (jsdocParameterNames && !jsdocParameterNames.find(({
261
312
  name
@@ -276,9 +327,9 @@ var _default = (0, _iterateJsdoc.default)(({
276
327
  * @param {{
277
328
  * functionParameterIdx: import('../iterateJsdoc.js').Integer,
278
329
  * functionParameterName: string,
279
- * remove: true,
280
- * inc: boolean,
281
- * type: string
330
+ * remove?: true,
331
+ * inc?: boolean,
332
+ * type?: string
282
333
  * }} cfg
283
334
  */
284
335
  const fix = ({
@@ -294,15 +345,16 @@ var _default = (0, _iterateJsdoc.default)(({
294
345
 
295
346
  /**
296
347
  *
297
- * @param {} tagIndex
298
- * @param {} sourceIndex
299
- * @param {} spliceCount
300
- * @returns {}
348
+ * @param {import('../iterateJsdoc.js').Integer} tagIndex
349
+ * @param {import('../iterateJsdoc.js').Integer} sourceIndex
350
+ * @param {import('../iterateJsdoc.js').Integer} spliceCount
351
+ * @returns {void}
301
352
  */
302
353
  const createTokens = (tagIndex, sourceIndex, spliceCount) => {
303
354
  // console.log(sourceIndex, tagIndex, jsdoc.tags, jsdoc.source);
304
355
  const tokens = {
305
356
  number: sourceIndex + 1,
357
+ source: '',
306
358
  tokens: {
307
359
  delimiter: '*',
308
360
  description: '',
@@ -319,9 +371,19 @@ var _default = (0, _iterateJsdoc.default)(({
319
371
  type: type ?? ''
320
372
  }
321
373
  };
374
+
375
+ /**
376
+ * @type {(import('@es-joy/jsdoccomment').JsdocTagWithInline & {
377
+ * newAdd?: true
378
+ * })[]}
379
+ */
322
380
  jsdoc.tags.splice(tagIndex, spliceCount, {
381
+ description: '',
382
+ inlineTags: [],
323
383
  name: functionParameterName,
324
384
  newAdd: true,
385
+ optional: false,
386
+ problems: [],
325
387
  source: [tokens],
326
388
  tag: preferredTagName,
327
389
  type: type ?? ''
@@ -1 +1 @@
1
- {"version":3,"file":"requireParam.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","rootNamer","desiredRoots","currentIndex","name","idx","incremented","length","base","suffix","shift","_default","iterateJsdoc","jsdoc","utils","context","avoidDocs","hasTag","autoIncrementBase","checkRestProperty","checkDestructured","checkDestructuredRoots","checkTypesPattern","enableFixer","enableRootFixer","enableRestElementFixer","unnamedRootBase","useDefaultObjectProperties","options","preferredTagName","getPreferredTagName","tagName","functionParameterNames","getFunctionParameterNames","jsdocParameterNames","getJsdocTagsDeep","shallowJsdocParameterNames","filter","tag","includes","map","checkTypesRegex","getRegexFromString","missingTags","flattenedRoots","flattenRoots","names","paramIndex","hasParamIndex","cur","dropPathSegmentQuotes","String","getParamIndex","setParamIndex","entries","findExpectedIndex","jsdocTags","indexAtFunctionParams","remainingRoots","slice","foundIndex","findIndex","newAdd","some","remainingRoot","Array","isArray","tags","tagLineCount","source","tokens","end","nextRootName","namer","functionParameterIdx","functionParameterName","inc","matchedJsdoc","rootName","type","search","hasRestElement","hasPropertyRest","rests","notCheckingNames","paramName","find","fpn","emptyParamIdx","push","remove","fullParamName","notCheckingName","paramType","comparePaths","undefined","startsWith","funcParamName","restElement","fix","createTokens","tagIndex","sourceIndex","spliceCount","number","delimiter","description","lineEnd","postDelimiter","postName","postTag","postType","start","splice","firstNumber","src","offset","expectedIdx","fixer","missingTag","makeMultiline","reportJSDoc","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","checkConstructors","checkGetters","checkSetters","contexts","items","anyOf","comment","exemptedBy","noTracking","exports","module"],"sources":["../../src/rules/requireParam.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\n/**\n * @template T\n * @param {string[]} desiredRoots\n * @param {number} currentIndex\n * @returns {[string, boolean, () => T]}\n */\nconst rootNamer = (desiredRoots, currentIndex) => {\n let name;\n let idx = currentIndex;\n const incremented = desiredRoots.length <= 1;\n if (incremented) {\n const base = desiredRoots[0];\n const suffix = idx++;\n name = `${base}${suffix}`;\n } else {\n name = desiredRoots.shift();\n }\n\n return [\n name,\n incremented,\n () => {\n return rootNamer(desiredRoots, idx);\n },\n ];\n};\n\n/* eslint-disable complexity -- Temporary */\nexport default iterateJsdoc(({\n jsdoc,\n utils,\n context,\n}) => {\n /* eslint-enable complexity -- Temporary */\n if (utils.avoidDocs()) {\n return;\n }\n\n // Param type is specified by type in @type\n if (utils.hasTag('type')) {\n return;\n }\n\n const {\n autoIncrementBase = 0,\n checkRestProperty = false,\n checkDestructured = true,\n checkDestructuredRoots = true,\n checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/',\n enableFixer = true,\n enableRootFixer = true,\n enableRestElementFixer = true,\n unnamedRootBase = [\n 'root',\n ],\n useDefaultObjectProperties = false,\n } = context.options[0] || {};\n\n const preferredTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'param',\n }));\n if (!preferredTagName) {\n return;\n }\n\n const functionParameterNames = utils.getFunctionParameterNames(useDefaultObjectProperties);\n if (!functionParameterNames.length) {\n return;\n }\n\n const jsdocParameterNames = utils.getJsdocTagsDeep(preferredTagName);\n\n const shallowJsdocParameterNames = jsdocParameterNames.filter((tag) => {\n return !tag.name.includes('.');\n }).map((tag, idx) => {\n return {\n ...tag,\n idx,\n };\n });\n\n const checkTypesRegex = utils.getRegexFromString(checkTypesPattern);\n\n const missingTags = [];\n const flattenedRoots = utils.flattenRoots(functionParameterNames).names;\n\n const paramIndex = {};\n const hasParamIndex = (cur) => {\n return utils.dropPathSegmentQuotes(String(cur)) in paramIndex;\n };\n\n /**\n *\n * @param {} cur\n * @returns {}\n */\n const getParamIndex = (cur) => {\n return paramIndex[utils.dropPathSegmentQuotes(String(cur))];\n };\n\n /**\n *\n * @param {} cur\n * @param {} idx\n * @returns {void}\n */\n const setParamIndex = (cur, idx) => {\n paramIndex[utils.dropPathSegmentQuotes(String(cur))] = idx;\n };\n\n for (const [\n idx,\n cur,\n ] of flattenedRoots.entries()) {\n setParamIndex(cur, idx);\n }\n\n /**\n *\n * @param {} jsdocTags\n * @param {} indexAtFunctionParams\n * @returns {import('../iterateJsdoc.js').Integer}\n */\n const findExpectedIndex = (jsdocTags, indexAtFunctionParams) => {\n const remainingRoots = functionParameterNames.slice(indexAtFunctionParams || 0);\n const foundIndex = jsdocTags.findIndex(({\n name,\n newAdd,\n }) => {\n return !newAdd && remainingRoots.some((remainingRoot) => {\n if (Array.isArray(remainingRoot)) {\n return remainingRoot[1].names.includes(name);\n }\n\n if (typeof remainingRoot === 'object') {\n return name === remainingRoot.name;\n }\n\n return name === remainingRoot;\n });\n });\n\n const tags = foundIndex > -1 ?\n jsdocTags.slice(0, foundIndex) :\n jsdocTags.filter(({\n tag,\n }) => {\n return tag === preferredTagName;\n });\n\n let tagLineCount = 0;\n for (const {\n source,\n } of tags) {\n for (const {\n tokens: {\n end,\n },\n } of source) {\n if (!end) {\n tagLineCount++;\n }\n }\n }\n\n return tagLineCount;\n };\n\n let [\n nextRootName,\n incremented,\n namer,\n ] = rootNamer([\n ...unnamedRootBase,\n ], autoIncrementBase);\n\n for (const [\n functionParameterIdx,\n functionParameterName,\n ] of functionParameterNames.entries()) {\n let inc;\n if (Array.isArray(functionParameterName)) {\n const matchedJsdoc = shallowJsdocParameterNames[functionParameterIdx] ||\n jsdocParameterNames[functionParameterIdx];\n\n let rootName;\n if (functionParameterName[0]) {\n rootName = functionParameterName[0];\n } else if (matchedJsdoc && matchedJsdoc.name) {\n rootName = matchedJsdoc.name;\n if (matchedJsdoc.type && matchedJsdoc.type.search(checkTypesRegex) === -1) {\n continue;\n }\n } else {\n rootName = nextRootName;\n inc = incremented;\n [\n nextRootName,\n incremented,\n namer,\n ] = namer();\n }\n\n const {\n hasRestElement,\n hasPropertyRest,\n rests,\n names,\n } = functionParameterName[1];\n const notCheckingNames = [];\n if (!enableRestElementFixer && hasRestElement) {\n continue;\n }\n\n if (!checkDestructuredRoots) {\n continue;\n }\n\n for (const [\n idx,\n paramName,\n ] of names.entries()) {\n // Add root if the root name is not in the docs (and is not already\n // in the tags to be fixed)\n if (!jsdocParameterNames.find(({\n name,\n }) => {\n return name === rootName;\n }) && !missingTags.find(({\n functionParameterName: fpn,\n }) => {\n return fpn === rootName;\n })) {\n const emptyParamIdx = jsdocParameterNames.findIndex(({\n name,\n }) => {\n return !name;\n });\n\n if (emptyParamIdx > -1) {\n missingTags.push({\n functionParameterIdx: emptyParamIdx,\n functionParameterName: rootName,\n inc,\n remove: true,\n });\n } else {\n missingTags.push({\n functionParameterIdx: hasParamIndex(rootName) ?\n getParamIndex(rootName) :\n getParamIndex(paramName),\n functionParameterName: rootName,\n inc,\n });\n }\n }\n\n if (!checkDestructured) {\n continue;\n }\n\n if (!checkRestProperty && rests[idx]) {\n continue;\n }\n\n const fullParamName = `${rootName}.${paramName}`;\n\n const notCheckingName = jsdocParameterNames.find(({\n name,\n type: paramType,\n }) => {\n return utils.comparePaths(name)(fullParamName) && paramType.search(checkTypesRegex) === -1 && paramType !== '';\n });\n\n if (notCheckingName !== undefined) {\n notCheckingNames.push(notCheckingName.name);\n }\n\n if (notCheckingNames.find((name) => {\n return fullParamName.startsWith(name);\n })) {\n continue;\n }\n\n if (jsdocParameterNames && !jsdocParameterNames.find(({\n name,\n }) => {\n return utils.comparePaths(name)(fullParamName);\n })) {\n missingTags.push({\n functionParameterIdx: getParamIndex(\n functionParameterName[0] ? fullParamName : paramName,\n ),\n functionParameterName: fullParamName,\n inc,\n type: hasRestElement && !hasPropertyRest ? '{...any}' : undefined,\n });\n }\n }\n\n continue;\n }\n\n let funcParamName;\n let type;\n if (typeof functionParameterName === 'object') {\n if (!enableRestElementFixer && functionParameterName.restElement) {\n continue;\n }\n\n funcParamName = functionParameterName.name;\n type = '{...any}';\n } else {\n funcParamName = functionParameterName;\n }\n\n if (jsdocParameterNames && !jsdocParameterNames.find(({\n name,\n }) => {\n return name === funcParamName;\n }) && funcParamName !== 'this') {\n missingTags.push({\n functionParameterIdx: getParamIndex(funcParamName),\n functionParameterName: funcParamName,\n inc,\n type,\n });\n }\n }\n\n /**\n *\n * @param {{\n * functionParameterIdx: import('../iterateJsdoc.js').Integer,\n * functionParameterName: string,\n * remove: true,\n * inc: boolean,\n * type: string\n * }} cfg\n */\n const fix = ({\n functionParameterIdx,\n functionParameterName,\n remove,\n inc,\n type,\n }) => {\n if (inc && !enableRootFixer) {\n return;\n }\n\n /**\n *\n * @param {} tagIndex\n * @param {} sourceIndex\n * @param {} spliceCount\n * @returns {}\n */\n const createTokens = (tagIndex, sourceIndex, spliceCount) => {\n // console.log(sourceIndex, tagIndex, jsdoc.tags, jsdoc.source);\n const tokens = {\n number: sourceIndex + 1,\n tokens: {\n delimiter: '*',\n description: '',\n end: '',\n lineEnd: '',\n name: functionParameterName,\n newAdd: true,\n postDelimiter: ' ',\n postName: '',\n postTag: ' ',\n postType: type ? ' ' : '',\n start: jsdoc.source[sourceIndex].tokens.start,\n tag: `@${preferredTagName}`,\n type: type ?? '',\n },\n };\n jsdoc.tags.splice(tagIndex, spliceCount, {\n name: functionParameterName,\n newAdd: true,\n source: [\n tokens,\n ],\n tag: preferredTagName,\n type: type ?? '',\n });\n const firstNumber = jsdoc.source[0].number;\n jsdoc.source.splice(sourceIndex, spliceCount, tokens);\n for (const [\n idx,\n src,\n ] of jsdoc.source.slice(sourceIndex).entries()) {\n src.number = firstNumber + sourceIndex + idx;\n }\n };\n\n const offset = jsdoc.source.findIndex(({\n tokens: {\n tag,\n end,\n },\n }) => {\n return tag || end;\n });\n if (remove) {\n createTokens(functionParameterIdx, offset + functionParameterIdx, 1);\n } else {\n const expectedIdx = findExpectedIndex(jsdoc.tags, functionParameterIdx);\n createTokens(expectedIdx, offset + expectedIdx, 0);\n }\n };\n\n /**\n * @returns {void}\n */\n const fixer = () => {\n for (const missingTag of missingTags) {\n fix(missingTag);\n }\n };\n\n if (missingTags.length && jsdoc.source.length === 1) {\n utils.makeMultiline();\n }\n\n for (const {\n functionParameterName,\n } of missingTags) {\n utils.reportJSDoc(\n `Missing JSDoc @${preferredTagName} \"${functionParameterName}\" declaration.`,\n null,\n enableFixer ? fixer : null,\n );\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all function parameters are documented.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n autoIncrementBase: {\n default: 0,\n type: 'integer',\n },\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkDestructured: {\n default: true,\n type: 'boolean',\n },\n checkDestructuredRoots: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n default: false,\n type: 'boolean',\n },\n checkRestProperty: {\n default: false,\n type: 'boolean',\n },\n checkSetters: {\n default: false,\n type: 'boolean',\n },\n checkTypesPattern: {\n type: 'string',\n },\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n type: 'boolean',\n },\n enableRestElementFixer: {\n type: 'boolean',\n },\n enableRootFixer: {\n type: 'boolean',\n },\n exemptedBy: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n unnamedRootBase: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n useDefaultObjectProperties: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n\n // We cannot cache comment nodes as the contexts may recur with the\n // same comment node but a different JS node, and we may need the different\n // JS node to ensure we iterate its context\n noTracking: true,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,SAAS,GAAGA,CAACC,YAAY,EAAEC,YAAY,KAAK;EAChD,IAAIC,IAAI;EACR,IAAIC,GAAG,GAAGF,YAAY;EACtB,MAAMG,WAAW,GAAGJ,YAAY,CAACK,MAAM,IAAI,CAAC;EAC5C,IAAID,WAAW,EAAE;IACf,MAAME,IAAI,GAAGN,YAAY,CAAC,CAAC,CAAC;IAC5B,MAAMO,MAAM,GAAGJ,GAAG,EAAE;IACpBD,IAAI,GAAI,GAAEI,IAAK,GAAEC,MAAO,EAAC;EAC3B,CAAC,MAAM;IACLL,IAAI,GAAGF,YAAY,CAACQ,KAAK,CAAC,CAAC;EAC7B;EAEA,OAAO,CACLN,IAAI,EACJE,WAAW,EACX,MAAM;IACJ,OAAOL,SAAS,CAACC,YAAY,EAAEG,GAAG,CAAC;EACrC,CAAC,CACF;AACH,CAAC;;AAED;AAAA,IAAAM,QAAA,GACe,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,KAAK;EACLC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ;EACA,IAAID,KAAK,CAACE,SAAS,CAAC,CAAC,EAAE;IAC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EACR,CAAC;EAED;EACA;EACA;EACA2D,UAAU,EAAE;AACd,CAAC,CAAC;AAAAC,OAAA,CAAA3I,OAAA,GAAAW,QAAA;AAAAiI,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA3I,OAAA"}
1
+ {"version":3,"file":"requireParam.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","rootNamer","desiredRoots","currentIndex","name","idx","incremented","length","base","suffix","shift","_default","iterateJsdoc","jsdoc","utils","context","avoidDocs","hasTag","autoIncrementBase","checkRestProperty","checkDestructured","checkDestructuredRoots","checkTypesPattern","enableFixer","enableRootFixer","enableRestElementFixer","unnamedRootBase","useDefaultObjectProperties","options","preferredTagName","getPreferredTagName","tagName","functionParameterNames","getFunctionParameterNames","jsdocParameterNames","getJsdocTagsDeep","shallowJsdocParameterNames","filter","tag","includes","map","checkTypesRegex","getRegexFromString","missingTags","flattenedRoots","flattenRoots","names","paramIndex","hasParamIndex","cur","dropPathSegmentQuotes","String","getParamIndex","setParamIndex","entries","findExpectedIndex","jsdocTags","indexAtFunctionParams","remainingRoots","slice","foundIndex","findIndex","newAdd","some","remainingRoot","Array","isArray","tags","tagLineCount","source","tokens","end","nextRootName","namer","functionParameterIdx","functionParameterName","inc","matchedJsdoc","rootName","type","search","hasRestElement","hasPropertyRest","rests","notCheckingNames","paramName","find","fpn","emptyParamIdx","push","remove","fullParamName","notCheckingName","paramType","comparePaths","undefined","startsWith","funcParamName","restElement","fix","createTokens","tagIndex","sourceIndex","spliceCount","number","delimiter","description","lineEnd","postDelimiter","postName","postTag","postType","start","splice","inlineTags","optional","problems","firstNumber","src","offset","expectedIdx","fixer","missingTag","makeMultiline","reportJSDoc","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","checkConstructors","checkGetters","checkSetters","contexts","items","anyOf","comment","exemptedBy","noTracking","exports","module"],"sources":["../../src/rules/requireParam.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\n/**\n * @typedef {[string, boolean, () => RootNamerReturn]} RootNamerReturn\n */\n\n/**\n * @param {string[]} desiredRoots\n * @param {number} currentIndex\n * @returns {RootNamerReturn}\n */\nconst rootNamer = (desiredRoots, currentIndex) => {\n /** @type {string} */\n let name;\n let idx = currentIndex;\n const incremented = desiredRoots.length <= 1;\n if (incremented) {\n const base = desiredRoots[0];\n const suffix = idx++;\n name = `${base}${suffix}`;\n } else {\n name = /** @type {string} */ (desiredRoots.shift());\n }\n\n return [\n name,\n incremented,\n () => {\n return rootNamer(desiredRoots, idx);\n },\n ];\n};\n\n/* eslint-disable complexity -- Temporary */\nexport default iterateJsdoc(({\n jsdoc,\n utils,\n context,\n}) => {\n /* eslint-enable complexity -- Temporary */\n if (utils.avoidDocs()) {\n return;\n }\n\n // Param type is specified by type in @type\n if (utils.hasTag('type')) {\n return;\n }\n\n const {\n autoIncrementBase = 0,\n checkRestProperty = false,\n checkDestructured = true,\n checkDestructuredRoots = true,\n checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/',\n enableFixer = true,\n enableRootFixer = true,\n enableRestElementFixer = true,\n unnamedRootBase = [\n 'root',\n ],\n useDefaultObjectProperties = false,\n } = context.options[0] || {};\n\n const preferredTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'param',\n }));\n if (!preferredTagName) {\n return;\n }\n\n const functionParameterNames = utils.getFunctionParameterNames(useDefaultObjectProperties);\n if (!functionParameterNames.length) {\n return;\n }\n\n const jsdocParameterNames =\n /**\n * @type {{\n * idx: import('../iterateJsdoc.js').Integer;\n * name: string;\n * type: string;\n * }[]}\n */ (utils.getJsdocTagsDeep(preferredTagName));\n\n const shallowJsdocParameterNames = jsdocParameterNames.filter((tag) => {\n return !tag.name.includes('.');\n }).map((tag, idx) => {\n return {\n ...tag,\n idx,\n };\n });\n\n const checkTypesRegex = utils.getRegexFromString(checkTypesPattern);\n\n /**\n * @type {{\n * functionParameterIdx: import('../iterateJsdoc.js').Integer,\n * functionParameterName: string,\n * inc: boolean|undefined,\n * remove?: true,\n * type?: string|undefined\n * }[]}\n */\n const missingTags = [];\n const flattenedRoots = utils.flattenRoots(functionParameterNames).names;\n\n /**\n * @type {{\n * [key: string]: import('../iterateJsdoc.js').Integer\n * }}\n */\n const paramIndex = {};\n\n /**\n * @param {string} cur\n * @returns {boolean}\n */\n const hasParamIndex = (cur) => {\n return utils.dropPathSegmentQuotes(String(cur)) in paramIndex;\n };\n\n /**\n *\n * @param {string|number|undefined} cur\n * @returns {import('../iterateJsdoc.js').Integer}\n */\n const getParamIndex = (cur) => {\n return paramIndex[utils.dropPathSegmentQuotes(String(cur))];\n };\n\n /**\n *\n * @param {string} cur\n * @param {import('../iterateJsdoc.js').Integer} idx\n * @returns {void}\n */\n const setParamIndex = (cur, idx) => {\n paramIndex[utils.dropPathSegmentQuotes(String(cur))] = idx;\n };\n\n for (const [\n idx,\n cur,\n ] of flattenedRoots.entries()) {\n setParamIndex(cur, idx);\n }\n\n /**\n *\n * @param {(import('@es-joy/jsdoccomment').JsdocTagWithInline & {\n * newAdd?: boolean\n * })[]} jsdocTags\n * @param {import('../iterateJsdoc.js').Integer} indexAtFunctionParams\n * @returns {import('../iterateJsdoc.js').Integer}\n */\n const findExpectedIndex = (jsdocTags, indexAtFunctionParams) => {\n const remainingRoots = functionParameterNames.slice(indexAtFunctionParams || 0);\n const foundIndex = jsdocTags.findIndex(({\n name,\n newAdd,\n }) => {\n return !newAdd && remainingRoots.some((remainingRoot) => {\n if (Array.isArray(remainingRoot)) {\n return (\n /**\n * @type {import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string|undefined;\n * }}\n */ (remainingRoot[1]).names.includes(name)\n );\n }\n\n if (typeof remainingRoot === 'object') {\n return name === remainingRoot.name;\n }\n\n return name === remainingRoot;\n });\n });\n\n const tags = foundIndex > -1 ?\n jsdocTags.slice(0, foundIndex) :\n jsdocTags.filter(({\n tag,\n }) => {\n return tag === preferredTagName;\n });\n\n let tagLineCount = 0;\n for (const {\n source,\n } of tags) {\n for (const {\n tokens: {\n end,\n },\n } of source) {\n if (!end) {\n tagLineCount++;\n }\n }\n }\n\n return tagLineCount;\n };\n\n let [\n nextRootName,\n incremented,\n namer,\n ] = rootNamer([\n ...unnamedRootBase,\n ], autoIncrementBase);\n\n for (const [\n functionParameterIdx,\n functionParameterName,\n ] of functionParameterNames.entries()) {\n let inc;\n if (Array.isArray(functionParameterName)) {\n const matchedJsdoc = shallowJsdocParameterNames[functionParameterIdx] ||\n jsdocParameterNames[functionParameterIdx];\n\n /** @type {string} */\n let rootName;\n if (functionParameterName[0]) {\n rootName = functionParameterName[0];\n } else if (matchedJsdoc && matchedJsdoc.name) {\n rootName = matchedJsdoc.name;\n if (matchedJsdoc.type && matchedJsdoc.type.search(checkTypesRegex) === -1) {\n continue;\n }\n } else {\n rootName = nextRootName;\n inc = incremented;\n [\n nextRootName,\n incremented,\n namer,\n ] = namer();\n }\n\n const {\n hasRestElement,\n hasPropertyRest,\n rests,\n names,\n } = /**\n * @type {import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string | undefined;\n * }}\n */ (functionParameterName[1]);\n const notCheckingNames = [];\n if (!enableRestElementFixer && hasRestElement) {\n continue;\n }\n\n if (!checkDestructuredRoots) {\n continue;\n }\n\n for (const [\n idx,\n paramName,\n ] of names.entries()) {\n // Add root if the root name is not in the docs (and is not already\n // in the tags to be fixed)\n if (!jsdocParameterNames.find(({\n name,\n }) => {\n return name === rootName;\n }) && !missingTags.find(({\n functionParameterName: fpn,\n }) => {\n return fpn === rootName;\n })) {\n const emptyParamIdx = jsdocParameterNames.findIndex(({\n name,\n }) => {\n return !name;\n });\n\n if (emptyParamIdx > -1) {\n missingTags.push({\n functionParameterIdx: emptyParamIdx,\n functionParameterName: rootName,\n inc,\n remove: true,\n });\n } else {\n missingTags.push({\n functionParameterIdx: hasParamIndex(rootName) ?\n getParamIndex(rootName) :\n getParamIndex(paramName),\n functionParameterName: rootName,\n inc,\n });\n }\n }\n\n if (!checkDestructured) {\n continue;\n }\n\n if (!checkRestProperty && rests[idx]) {\n continue;\n }\n\n const fullParamName = `${rootName}.${paramName}`;\n\n const notCheckingName = jsdocParameterNames.find(({\n name,\n type: paramType,\n }) => {\n return utils.comparePaths(name)(fullParamName) && paramType.search(checkTypesRegex) === -1 && paramType !== '';\n });\n\n if (notCheckingName !== undefined) {\n notCheckingNames.push(notCheckingName.name);\n }\n\n if (notCheckingNames.find((name) => {\n return fullParamName.startsWith(name);\n })) {\n continue;\n }\n\n if (jsdocParameterNames && !jsdocParameterNames.find(({\n name,\n }) => {\n return utils.comparePaths(name)(fullParamName);\n })) {\n missingTags.push({\n functionParameterIdx: getParamIndex(\n functionParameterName[0] ? fullParamName : paramName,\n ),\n functionParameterName: fullParamName,\n inc,\n type: hasRestElement && !hasPropertyRest ? '{...any}' : undefined,\n });\n }\n }\n\n continue;\n }\n\n /** @type {string} */\n let funcParamName;\n let type;\n if (typeof functionParameterName === 'object') {\n if (!enableRestElementFixer && functionParameterName.restElement) {\n continue;\n }\n\n funcParamName = /** @type {string} */ (functionParameterName.name);\n type = '{...any}';\n } else {\n funcParamName = /** @type {string} */ (functionParameterName);\n }\n\n if (jsdocParameterNames && !jsdocParameterNames.find(({\n name,\n }) => {\n return name === funcParamName;\n }) && funcParamName !== 'this') {\n missingTags.push({\n functionParameterIdx: getParamIndex(funcParamName),\n functionParameterName: funcParamName,\n inc,\n type,\n });\n }\n }\n\n /**\n *\n * @param {{\n * functionParameterIdx: import('../iterateJsdoc.js').Integer,\n * functionParameterName: string,\n * remove?: true,\n * inc?: boolean,\n * type?: string\n * }} cfg\n */\n const fix = ({\n functionParameterIdx,\n functionParameterName,\n remove,\n inc,\n type,\n }) => {\n if (inc && !enableRootFixer) {\n return;\n }\n\n /**\n *\n * @param {import('../iterateJsdoc.js').Integer} tagIndex\n * @param {import('../iterateJsdoc.js').Integer} sourceIndex\n * @param {import('../iterateJsdoc.js').Integer} spliceCount\n * @returns {void}\n */\n const createTokens = (tagIndex, sourceIndex, spliceCount) => {\n // console.log(sourceIndex, tagIndex, jsdoc.tags, jsdoc.source);\n const tokens = {\n number: sourceIndex + 1,\n source: '',\n tokens: {\n delimiter: '*',\n description: '',\n end: '',\n lineEnd: '',\n name: functionParameterName,\n newAdd: true,\n postDelimiter: ' ',\n postName: '',\n postTag: ' ',\n postType: type ? ' ' : '',\n start: jsdoc.source[sourceIndex].tokens.start,\n tag: `@${preferredTagName}`,\n type: type ?? '',\n },\n };\n\n /**\n * @type {(import('@es-joy/jsdoccomment').JsdocTagWithInline & {\n * newAdd?: true\n * })[]}\n */ (jsdoc.tags).splice(tagIndex, spliceCount, {\n description: '',\n inlineTags: [],\n name: functionParameterName,\n newAdd: true,\n optional: false,\n problems: [],\n source: [\n tokens,\n ],\n tag: preferredTagName,\n type: type ?? '',\n });\n const firstNumber = jsdoc.source[0].number;\n jsdoc.source.splice(sourceIndex, spliceCount, tokens);\n for (const [\n idx,\n src,\n ] of jsdoc.source.slice(sourceIndex).entries()) {\n src.number = firstNumber + sourceIndex + idx;\n }\n };\n\n const offset = jsdoc.source.findIndex(({\n tokens: {\n tag,\n end,\n },\n }) => {\n return tag || end;\n });\n if (remove) {\n createTokens(functionParameterIdx, offset + functionParameterIdx, 1);\n } else {\n const expectedIdx = findExpectedIndex(jsdoc.tags, functionParameterIdx);\n createTokens(expectedIdx, offset + expectedIdx, 0);\n }\n };\n\n /**\n * @returns {void}\n */\n const fixer = () => {\n for (const missingTag of missingTags) {\n fix(missingTag);\n }\n };\n\n if (missingTags.length && jsdoc.source.length === 1) {\n utils.makeMultiline();\n }\n\n for (const {\n functionParameterName,\n } of missingTags) {\n utils.reportJSDoc(\n `Missing JSDoc @${preferredTagName} \"${functionParameterName}\" declaration.`,\n null,\n enableFixer ? fixer : null,\n );\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all function parameters are documented.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n autoIncrementBase: {\n default: 0,\n type: 'integer',\n },\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkDestructured: {\n default: true,\n type: 'boolean',\n },\n checkDestructuredRoots: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n default: false,\n type: 'boolean',\n },\n checkRestProperty: {\n default: false,\n type: 'boolean',\n },\n checkSetters: {\n default: false,\n type: 'boolean',\n },\n checkTypesPattern: {\n type: 'string',\n },\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n type: 'boolean',\n },\n enableRestElementFixer: {\n type: 'boolean',\n },\n enableRootFixer: {\n type: 'boolean',\n },\n exemptedBy: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n unnamedRootBase: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n useDefaultObjectProperties: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n\n // We cannot cache comment nodes as the contexts may recur with the\n // same comment node but a different JS node, and we may need the different\n // JS node to ensure we iterate its context\n noTracking: true,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMG,SAAS,GAAGA,CAACC,YAAY,EAAEC,YAAY,KAAK;EAChD;EACA,IAAIC,IAAI;EACR,IAAIC,GAAG,GAAGF,YAAY;EACtB,MAAMG,WAAW,GAAGJ,YAAY,CAACK,MAAM,IAAI,CAAC;EAC5C,IAAID,WAAW,EAAE;IACf,MAAME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AE,KAAK;UACd+E,IAAI,EAAE;QACR,CAAC;QACDzD,iBAAiB,EAAE;UACjByD,IAAI,EAAE;QACR,CAAC;QACDyD,QAAQ,EAAE;UACRC,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACE3D,IAAI,EAAE;YACR,CAAC,EACD;cACEoD,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVO,OAAO,EAAE;kBACP5D,IAAI,EAAE;gBACR,CAAC;gBACDhE,OAAO,EAAE;kBACPgE,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDxD,WAAW,EAAE;UACXwD,IAAI,EAAE;QACR,CAAC;QACDtD,sBAAsB,EAAE;UACtBsD,IAAI,EAAE;QACR,CAAC;QACDvD,eAAe,EAAE;UACfuD,IAAI,EAAE;QACR,CAAC;QACD6D,UAAU,EAAE;UACVH,KAAK,EAAE;YACL1D,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDrD,eAAe,EAAE;UACf+G,KAAK,EAAE;YACL1D,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDpD,0BAA0B,EAAE;UAC1BoD,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR,CAAC;EAED;EACA;EACA;EACA8D,UAAU,EAAE;AACd,CAAC,CAAC;AAAAC,OAAA,CAAA9I,OAAA,GAAAW,QAAA;AAAAoI,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA9I,OAAA"}
@@ -11,7 +11,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
  * or the method is either a constructor or an abstract method.
12
12
  *
13
13
  * In either of these cases the return value is optional or not defined.
14
- *
15
14
  * @param {import('../iterateJsdoc.js').Utils} utils
16
15
  * a reference to the utils which are used to probe if a tag is present or not.
17
16
  * @returns {boolean}
@@ -1 +1 @@
1
- {"version":3,"file":"requireReturns.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","canSkip","utils","hasATag","avoidDocs","_default","iterateJsdoc","report","context","forceRequireReturn","forceReturnsWithAsync","options","tagName","getPreferredTagName","tags","getTags","length","iteratingFunction","isIteratingFunction","tag","missingReturnTag","shouldReport","isVirtualFunction","isAsync","hasTag","hasValueOrExecutorHasNonEmptyResolveValue","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","checkConstructors","type","checkGetters","contexts","items","anyOf","comment","exemptedBy","exports","module"],"sources":["../../src/rules/requireReturns.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\n/**\n * We can skip checking for a return value, in case the documentation is inherited\n * or the method is either a constructor or an abstract method.\n *\n * In either of these cases the return value is optional or not defined.\n *\n * @param {import('../iterateJsdoc.js').Utils} utils\n * a reference to the utils which are used to probe if a tag is present or not.\n * @returns {boolean}\n * 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 return value but does not implement it.\n 'abstract',\n 'virtual',\n\n // Constructors do not have a return value by definition (https://jsdoc.app/tags-class.html)\n // So we can bail out here, too.\n 'class',\n 'constructor',\n\n // Return type is specified by type in @type\n 'type',\n\n // This seems to imply a class as well\n 'interface',\n ]) ||\n utils.avoidDocs();\n};\n\nexport default iterateJsdoc(({\n report,\n utils,\n context,\n}) => {\n const {\n forceRequireReturn = false,\n forceReturnsWithAsync = false,\n } = context.options[0] || {};\n\n // A preflight check. We do not need to run a deep check\n // in case the @returns comment is optional or undefined.\n if (canSkip(utils)) {\n return;\n }\n\n const tagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'returns',\n }));\n if (!tagName) {\n return;\n }\n\n const tags = utils.getTags(tagName);\n\n if (tags.length > 1) {\n report(`Found more than one @${tagName} declaration.`);\n }\n\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 missingReturnTag = typeof tag === 'undefined' || tag === null;\n\n const shouldReport = () => {\n if (!missingReturnTag) {\n return false;\n }\n\n if (forceRequireReturn && (\n iteratingFunction || utils.isVirtualFunction()\n )) {\n return true;\n }\n\n const isAsync = !iteratingFunction && utils.hasTag('async') ||\n iteratingFunction && utils.isAsync();\n\n if (forceReturnsWithAsync && isAsync) {\n return true;\n }\n\n return iteratingFunction && utils.hasValueOrExecutorHasNonEmptyResolveValue(\n forceReturnsWithAsync,\n );\n };\n\n if (shouldReport()) {\n report(`Missing JSDoc @${tagName} declaration.`);\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that returns are documented.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: false,\n type: 'boolean',\n },\n checkGetters: {\n default: true,\n type: 'boolean',\n },\n contexts: {\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 items: {\n type: 'string',\n },\n type: 'array',\n },\n forceRequireReturn: {\n default: false,\n type: 'boolean',\n },\n forceReturnsWithAsync: {\n default: false,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,CAAC;QACDzB,qBAAqB,EAAE;UACrBV,OAAO,EAAE,KAAK;UACdmC,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAO,OAAA,CAAA1C,OAAA,GAAAK,QAAA;AAAAsC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA1C,OAAA"}
1
+ {"version":3,"file":"requireReturns.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","canSkip","utils","hasATag","avoidDocs","_default","iterateJsdoc","report","context","forceRequireReturn","forceReturnsWithAsync","options","tagName","getPreferredTagName","tags","getTags","length","iteratingFunction","isIteratingFunction","tag","missingReturnTag","shouldReport","isVirtualFunction","isAsync","hasTag","hasValueOrExecutorHasNonEmptyResolveValue","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","checkConstructors","type","checkGetters","contexts","items","anyOf","comment","exemptedBy","exports","module"],"sources":["../../src/rules/requireReturns.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\n/**\n * We can skip checking for a return value, in case the documentation is inherited\n * or the method is either a constructor or an abstract method.\n *\n * In either of these cases the return value is optional or not defined.\n * @param {import('../iterateJsdoc.js').Utils} utils\n * a reference to the utils which are used to probe if a tag is present or not.\n * @returns {boolean}\n * 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 return value but does not implement it.\n 'abstract',\n 'virtual',\n\n // Constructors do not have a return value by definition (https://jsdoc.app/tags-class.html)\n // So we can bail out here, too.\n 'class',\n 'constructor',\n\n // Return type is specified by type in @type\n 'type',\n\n // This seems to imply a class as well\n 'interface',\n ]) ||\n utils.avoidDocs();\n};\n\nexport default iterateJsdoc(({\n report,\n utils,\n context,\n}) => {\n const {\n forceRequireReturn = false,\n forceReturnsWithAsync = false,\n } = context.options[0] || {};\n\n // A preflight check. We do not need to run a deep check\n // in case the @returns comment is optional or undefined.\n if (canSkip(utils)) {\n return;\n }\n\n const tagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName: 'returns',\n }));\n if (!tagName) {\n return;\n }\n\n const tags = utils.getTags(tagName);\n\n if (tags.length > 1) {\n report(`Found more than one @${tagName} declaration.`);\n }\n\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 missingReturnTag = typeof tag === 'undefined' || tag === null;\n\n const shouldReport = () => {\n if (!missingReturnTag) {\n return false;\n }\n\n if (forceRequireReturn && (\n iteratingFunction || utils.isVirtualFunction()\n )) {\n return true;\n }\n\n const isAsync = !iteratingFunction && utils.hasTag('async') ||\n iteratingFunction && utils.isAsync();\n\n if (forceReturnsWithAsync && isAsync) {\n return true;\n }\n\n return iteratingFunction && utils.hasValueOrExecutorHasNonEmptyResolveValue(\n forceReturnsWithAsync,\n );\n };\n\n if (shouldReport()) {\n report(`Missing JSDoc @${tagName} declaration.`);\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that returns are documented.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: false,\n type: 'boolean',\n },\n checkGetters: {\n default: true,\n type: 'boolean',\n },\n contexts: {\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 items: {\n type: 'string',\n },\n type: 'array',\n },\n forceRequireReturn: {\n default: false,\n type: 'boolean',\n },\n forceReturnsWithAsync: {\n default: false,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"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AAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDM,UAAU,EAAE;UACVH,KAAK,EAAE;YACLH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACD1B,kBAAkB,EAAE;UAClBT,OAAO,EAAE,KAAK;UACdmC,IAAI,EAAE;QACR,CAAC;QACDzB,qBAAqB,EAAE;UACrBV,OAAO,EAAE,KAAK;UACdmC,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAO,OAAA,CAAA1C,OAAA,GAAAK,QAAA;AAAAsC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA1C,OAAA"}
@@ -9,7 +9,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
9
9
  /**
10
10
  * We can skip checking for a throws value, in case the documentation is inherited
11
11
  * or the method is either a constructor or an abstract method.
12
- *
13
12
  * @param {import('../iterateJsdoc.js').Utils} utils a reference to the utils which are used to probe if a tag is present or not.
14
13
  * @returns {boolean} true in case deep checking can be skipped; otherwise false.
15
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"requireThrows.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","canSkip","utils","hasATag","avoidDocs","_default","iterateJsdoc","report","tagName","getPreferredTagName","tags","getTags","iteratingFunction","isIteratingFunction","tag","missingThrowsTag","shouldReport","type","trim","hasThrowValue","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","exemptedBy","exports","module"],"sources":["../../src/rules/requireThrows.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\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 *\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();\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.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-throws',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\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 items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,I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AM,CAAE,kBAAiBC,OAAQ,eAAc,CAAC;EAClD;AACF,CAAC,EAAE;EACDY,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,gDAAgD;MAC7DC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,QAAQ,EAAE;UACRC,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEb,IAAI,EAAE;YACR,CAAC,EACD;cACES,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVI,OAAO,EAAE;kBACPd,IAAI,EAAE;gBACR,CAAC;gBACDe,OAAO,EAAE;kBACPf,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDgB,UAAU,EAAE;UACVJ,KAAK,EAAE;YACLZ,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAiB,OAAA,CAAAlC,OAAA,GAAAK,QAAA;AAAA8B,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlC,OAAA"}
1
+ {"version":3,"file":"requireThrows.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","canSkip","utils","hasATag","avoidDocs","_default","iterateJsdoc","report","tagName","getPreferredTagName","tags","getTags","iteratingFunction","isIteratingFunction","tag","missingThrowsTag","shouldReport","type","trim","hasThrowValue","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","exemptedBy","exports","module"],"sources":["../../src/rules/requireThrows.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\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();\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.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-throws',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\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 items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;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AAK,CAACiB,aAAa,CAAC,CAAC;EACnD,CAAC;EAED,IAAIH,YAAY,CAAC,CAAC,EAAE;IAClBT,MAAM,CAAE,kBAAiBC,OAAQ,eAAc,CAAC;EAClD;AACF,CAAC,EAAE;EACDY,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,gDAAgD;MAC7DC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,QAAQ,EAAE;UACRC,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEb,IAAI,EAAE;YACR,CAAC,EACD;cACES,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVI,OAAO,EAAE;kBACPd,IAAI,EAAE;gBACR,CAAC;gBACDe,OAAO,EAAE;kBACPf,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDgB,UAAU,EAAE;UACVJ,KAAK,EAAE;YACLZ,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAiB,OAAA,CAAAlC,OAAA,GAAAK,QAAA;AAAA8B,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlC,OAAA"}
@@ -11,7 +11,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
  * or the method has a constructor or abstract tag.
12
12
  *
13
13
  * In either of these cases the yield value is optional or not defined.
14
- *
15
14
  * @param {import('../iterateJsdoc.js').Utils} utils a reference to the utils which are used to probe if a tag is present or not.
16
15
  * @returns {boolean} true in case deep checking can be skipped; otherwise false.
17
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"requireYields.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","canSkip","utils","hasATag","avoidDocs","checkTagName","report","tagName","preferredTagName","getPreferredTagName","tags","getTags","length","tag","missingTag","_default","iterateJsdoc","context","next","nextWithGeneratorTag","forceRequireNext","forceRequireYields","withGeneratorTag","options","iteratingFunction","isIteratingFunction","preferredYieldTagName","missingYieldTag","shouldReportYields","hasTag","isGenerator","hasYieldValue","preferredNextTagName","missingNextTag","shouldReportNext","hasYieldReturnValue","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","type","comment","exemptedBy","exports","module"],"sources":["../../src/rules/requireYields.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\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 *\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 report,\n utils,\n context,\n}) => {\n const {\n next = false,\n nextWithGeneratorTag = false,\n forceRequireNext = false,\n forceRequireYields = 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.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-yields',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\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 items: {\n type: 'string',\n },\n type: 'array',\n },\n forceRequireNext: {\n default: false,\n type: 'boolean',\n },\n forceRequireYields: {\n default: false,\n type: 'boolean',\n },\n next: {\n default: false,\n type: 'boolean',\n },\n nextWithGeneratorTag: {\n default: false,\n type: 'boolean',\n },\n withGeneratorTag: {\n default: true,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,OAAO,GAAIC,KAAK,IAAK;EACzB,OAAOA,KAAK,CAACC,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,IACAD,KAAK,CAACE,SAAS,CAAC,CAAC;AACrB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,YAAY,GAAGA,CAACH,KAAK,EAAEI,MAAM,EAAEC,OAAO,KAAK;EAC/C,MAAMC,gBAAgB,GAAG,qBAAuBN,KAAK,CAACO,mBAAmB,CAAC;IACxEF;EACF,CAAC,CAAE;EACH,IAAI,CAACC,gBAAgB,EAAE;IACrB,OAAO,EAAE;EACX;EAEA,MAAME,IAAI,GAAGR,KAAK,CAACS,OAAO,CAACH,gBAAgB,CAAC;EAE5C,IAAIE,IAAI,CAACE,MAAM,GAAG,CAAC,EAAE;IACnBN,MAAM,CAAE,wBAAuBE,gBAAiB,eAAc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IAAI,EAAE;QACR,CAAC;QACDE,UAAU,EAAE;UACVJ,KAAK,EAAE;YACLE,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACD3B,gBAAgB,EAAE;UAChBpB,OAAO,EAAE,KAAK;UACd+C,IAAI,EAAE;QACR,CAAC;QACD1B,kBAAkB,EAAE;UAClBrB,OAAO,EAAE,KAAK;UACd+C,IAAI,EAAE;QACR,CAAC;QACD7B,IAAI,EAAE;UACJlB,OAAO,EAAE,KAAK;UACd+C,IAAI,EAAE;QACR,CAAC;QACD5B,oBAAoB,EAAE;UACpBnB,OAAO,EAAE,KAAK;UACd+C,IAAI,EAAE;QACR,CAAC;QACDzB,gBAAgB,EAAE;UAChBtB,OAAO,EAAE,IAAI;UACb+C,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAG,OAAA,CAAAlD,OAAA,GAAAe,QAAA;AAAAoC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlD,OAAA"}
1
+ {"version":3,"file":"requireYields.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","canSkip","utils","hasATag","avoidDocs","checkTagName","report","tagName","preferredTagName","getPreferredTagName","tags","getTags","length","tag","missingTag","_default","iterateJsdoc","context","next","nextWithGeneratorTag","forceRequireNext","forceRequireYields","withGeneratorTag","options","iteratingFunction","isIteratingFunction","preferredYieldTagName","missingYieldTag","shouldReportYields","hasTag","isGenerator","hasYieldValue","preferredNextTagName","missingNextTag","shouldReportNext","hasYieldReturnValue","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","type","comment","exemptedBy","exports","module"],"sources":["../../src/rules/requireYields.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\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 report,\n utils,\n context,\n}) => {\n const {\n next = false,\n nextWithGeneratorTag = false,\n forceRequireNext = false,\n forceRequireYields = 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.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-yields',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\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 items: {\n type: 'string',\n },\n type: 'array',\n },\n forceRequireNext: {\n default: false,\n type: 'boolean',\n },\n forceRequireYields: {\n default: false,\n type: 'boolean',\n },\n next: {\n default: false,\n type: 'boolean',\n },\n nextWithGeneratorTag: {\n default: false,\n type: 'boolean',\n },\n withGeneratorTag: {\n default: true,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAA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ACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAG,OAAA,CAAAlD,OAAA,GAAAe,QAAA;AAAAoC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlD,OAAA"}
@@ -42,7 +42,7 @@ var _default = (0, _iterateJsdoc.default)(({
42
42
  for (const [idx, tag] of
43
43
  /**
44
44
  * @type {(
45
- * import('comment-parser').Spec & {
45
+ * import('@es-joy/jsdoccomment').JsdocTagWithInline & {
46
46
  * originalIndex: import('../iterateJsdoc.js').Integer,
47
47
  * originalLine: import('../iterateJsdoc.js').Integer,
48
48
  * }