eslint-plugin-jsdoc 63.0.0 → 63.0.2

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 (65) hide show
  1. package/dist/cjs/jsdocUtils.d.ts +10 -0
  2. package/dist/jsdocUtils.cjs +30 -2
  3. package/dist/jsdocUtils.cjs.map +1 -1
  4. package/dist/jsdocUtils.d.ts +10 -0
  5. package/dist/rules/emptyTags.cjs +14 -1
  6. package/dist/rules/emptyTags.cjs.map +1 -1
  7. package/dist/rules/implementsOnClasses.cjs +1 -1
  8. package/dist/rules/implementsOnClasses.cjs.map +1 -1
  9. package/dist/rules/matchDescription.cjs +1 -1
  10. package/dist/rules/matchDescription.cjs.map +1 -1
  11. package/dist/rules/matchName.cjs +1 -1
  12. package/dist/rules/matchName.cjs.map +1 -1
  13. package/dist/rules/noDefaults.cjs +1 -1
  14. package/dist/rules/noDefaults.cjs.map +1 -1
  15. package/dist/rules/noMissingSyntax.cjs +1 -1
  16. package/dist/rules/noMissingSyntax.cjs.map +1 -1
  17. package/dist/rules/noRestrictedSyntax.cjs +1 -1
  18. package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
  19. package/dist/rules/noTypes.cjs +1 -1
  20. package/dist/rules/noTypes.cjs.map +1 -1
  21. package/dist/rules/noUndefinedTypes.cjs +3 -12
  22. package/dist/rules/noUndefinedTypes.cjs.map +1 -1
  23. package/dist/rules/requireDescription.cjs +1 -1
  24. package/dist/rules/requireDescription.cjs.map +1 -1
  25. package/dist/rules/requireExample.cjs +1 -1
  26. package/dist/rules/requireExample.cjs.map +1 -1
  27. package/dist/rules/requireJsdoc.cjs +1 -1
  28. package/dist/rules/requireJsdoc.cjs.map +1 -1
  29. package/dist/rules/requireParam.cjs +1 -1
  30. package/dist/rules/requireParam.cjs.map +1 -1
  31. package/dist/rules/requireParamDescription.cjs +1 -1
  32. package/dist/rules/requireParamDescription.cjs.map +1 -1
  33. package/dist/rules/requireParamName.cjs +1 -1
  34. package/dist/rules/requireParamName.cjs.map +1 -1
  35. package/dist/rules/requireParamType.cjs +1 -1
  36. package/dist/rules/requireParamType.cjs.map +1 -1
  37. package/dist/rules/requireReturnsCheck.cjs +86 -1
  38. package/dist/rules/requireReturnsCheck.cjs.map +1 -1
  39. package/dist/rules/requireReturnsDescription.cjs +1 -1
  40. package/dist/rules/requireReturnsDescription.cjs.map +1 -1
  41. package/dist/rules/requireReturnsType.cjs +1 -1
  42. package/dist/rules/requireReturnsType.cjs.map +1 -1
  43. package/dist/rules.d.ts +16 -16
  44. package/package.json +13 -13
  45. package/src/jsdocUtils.js +38 -0
  46. package/src/rules/emptyTags.js +14 -0
  47. package/src/rules/implementsOnClasses.js +1 -1
  48. package/src/rules/matchDescription.js +1 -1
  49. package/src/rules/matchName.js +1 -1
  50. package/src/rules/noDefaults.js +1 -1
  51. package/src/rules/noMissingSyntax.js +1 -1
  52. package/src/rules/noRestrictedSyntax.js +1 -1
  53. package/src/rules/noTypes.js +1 -1
  54. package/src/rules/noUndefinedTypes.js +6 -21
  55. package/src/rules/requireDescription.js +1 -1
  56. package/src/rules/requireExample.js +1 -1
  57. package/src/rules/requireJsdoc.js +1 -1
  58. package/src/rules/requireParam.js +1 -1
  59. package/src/rules/requireParamDescription.js +1 -1
  60. package/src/rules/requireParamName.js +1 -1
  61. package/src/rules/requireParamType.js +1 -1
  62. package/src/rules/requireReturnsCheck.js +110 -1
  63. package/src/rules/requireReturnsDescription.js +1 -1
  64. package/src/rules/requireReturnsType.js +1 -1
  65. package/src/rules.d.ts +16 -16
@@ -1 +1 @@
1
- {"version":3,"file":"requireParam.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","rootNamer","desiredRoots","currentIndex","name","idx","incremented","length","base","suffix","shift","_default","exports","iterateJsdoc","context","jsdoc","node","utils","avoidDocs","hasTag","autoIncrementBase","checkDestructured","checkDestructuredRoots","checkRestProperty","checkTypesPattern","enableFixer","enableRestElementFixer","enableRootFixer","ignoreWhenAllParamsMissing","interfaceExemptsParamsCheck","unnamedRootBase","useDefaultObjectProperties","options","parent","type","id","typeAnnotation","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","remainingFlattenedRoots","slice","foundIndex","findIndex","newAdd","some","flattenedRoot","endsWith","tags","tagLineCount","source","tokens","end","nextRootName","namer","thisOffset","functionParameterIdx","functionParameterName","inc","Array","isArray","matchedJsdoc","rootName","search","hasPropertyRest","hasRestElement","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","firstParamLine","baseOffset","fixer","missingTag","makeMultiline","reportJSDoc","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","checkConstructors","checkGetters","checkSetters","contexts","items","anyOf","comment","exemptedBy","noTracking","module"],"sources":["../../src/rules/requireParam.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\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 context,\n jsdoc,\n node,\n utils,\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 checkDestructured = true,\n checkDestructuredRoots = true,\n checkRestProperty = false,\n checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/',\n enableFixer = true,\n enableRestElementFixer = true,\n enableRootFixer = true,\n ignoreWhenAllParamsMissing = false,\n interfaceExemptsParamsCheck = false,\n unnamedRootBase = [\n 'root',\n ],\n useDefaultObjectProperties = false,\n } = context.options[0] || {};\n\n if (interfaceExemptsParamsCheck && node &&\n node.parent?.type === 'VariableDeclarator' &&\n 'typeAnnotation' in node.parent.id && node.parent.id.typeAnnotation) {\n return;\n }\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, interfaceExemptsParamsCheck);\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 if (ignoreWhenAllParamsMissing && !jsdocParameterNames.length) {\n return;\n }\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 {{\n * foundIndex: import('../iterateJsdoc.js').Integer,\n * tagLineCount: import('../iterateJsdoc.js').Integer,\n * }}\n */\n const findExpectedIndex = (jsdocTags, indexAtFunctionParams) => {\n // Get the parameters that come after the current index in the flattened order\n const remainingFlattenedRoots = flattenedRoots.slice((indexAtFunctionParams || 0) + 1);\n\n // Find the first existing tag that comes after the current parameter in the flattened order\n const foundIndex = jsdocTags.findIndex(({\n name,\n newAdd,\n }) => {\n if (newAdd) {\n return false;\n }\n\n // Check if the tag name matches any of the remaining flattened roots\n return remainingFlattenedRoots.some((flattenedRoot) => {\n // The flattened roots don't have the root prefix (e.g., \"bar\", \"bar.baz\")\n // but JSDoc tags do (e.g., \"root0\", \"root0.bar\", \"root0.bar.baz\")\n // So we need to check if the tag name ends with the flattened root\n\n // Check if tag name ends with \".<flattenedRoot>\"\n if (name.endsWith(`.${flattenedRoot}`)) {\n return true;\n }\n\n // Also check if tag name exactly matches the flattenedRoot\n // (for single-level params)\n if (name === flattenedRoot) {\n return true;\n }\n\n return false;\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 {\n foundIndex,\n tagLineCount,\n };\n };\n\n let [\n nextRootName,\n incremented,\n namer,\n ] = rootNamer([\n ...unnamedRootBase,\n ], autoIncrementBase);\n\n const thisOffset = functionParameterNames[0] === 'this' ? 1 : 0;\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 - thisOffset];\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\n [\n nextRootName,\n incremented,\n namer,\n ] = namer();\n\n const {\n hasPropertyRest,\n hasRestElement,\n names,\n rests,\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 inc,\n remove,\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 end,\n tag,\n },\n }) => {\n return tag || end;\n });\n if (remove) {\n createTokens(functionParameterIdx, offset + functionParameterIdx, 1);\n } else {\n const {\n foundIndex,\n tagLineCount: expectedIdx,\n } =\n findExpectedIndex(jsdoc.tags, functionParameterIdx);\n\n const firstParamLine = jsdoc.source.findIndex(({\n tokens,\n }) => {\n return tokens.tag === `@${preferredTagName}`;\n });\n const baseOffset = foundIndex > -1 || firstParamLine === -1 ?\n offset :\n firstParamLine;\n\n createTokens(expectedIdx, baseOffset + 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 with a `@param` tag.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n autoIncrementBase: {\n default: 0,\n description: `Numeric to indicate the number at which to begin auto-incrementing roots.\nDefaults to \\`0\\`.`,\n type: 'integer',\n },\n checkConstructors: {\n default: true,\n description: `A value indicating whether \\`constructor\\`s should be checked. Defaults to\n\\`true\\`.`,\n type: 'boolean',\n },\n checkDestructured: {\n default: true,\n description: 'Whether to require destructured properties. Defaults to `true`.',\n type: 'boolean',\n },\n checkDestructuredRoots: {\n default: true,\n description: `Whether to check the existence of a corresponding \\`@param\\` for root objects\nof destructured properties (e.g., that for \\`function ({a, b}) {}\\`, that there\nis something like \\`@param myRootObj\\` defined that can correspond to\nthe \\`{a, b}\\` object parameter).\n\nIf \\`checkDestructuredRoots\\` is \\`false\\`, \\`checkDestructured\\` will also be\nimplied to be \\`false\\` (i.e., the inside of the roots will not be checked\neither, e.g., it will also not complain if \\`a\\` or \\`b\\` do not have their own\ndocumentation). Defaults to \\`true\\`.`,\n type: 'boolean',\n },\n checkGetters: {\n default: false,\n description: 'A value indicating whether getters should be checked. Defaults to `false`.',\n type: 'boolean',\n },\n checkRestProperty: {\n default: false,\n description: `If set to \\`true\\`, will report (and add fixer insertions) for missing rest\nproperties. Defaults to \\`false\\`.\n\nIf set to \\`true\\`, note that you can still document the subproperties of the\nrest property using other jsdoc features, e.g., \\`@typedef\\`:\n\n\\`\\`\\`js\n/**\n * @typedef ExtraOptions\n * @property innerProp1\n * @property innerProp2\n */\n\n/**\n * @param cfg\n * @param cfg.num\n * @param {ExtraOptions} extra\n */\nfunction quux ({num, ...extra}) {\n}\n\\`\\`\\`\n\nSetting this option to \\`false\\` (the default) may be useful in cases where\nyou already have separate \\`@param\\` definitions for each of the properties\nwithin the rest property.\n\nFor example, with the option disabled, this will not give an error despite\n\\`extra\\` not having any definition:\n\n\\`\\`\\`js\n/**\n * @param cfg\n * @param cfg.num\n */\nfunction quux ({num, ...extra}) {\n}\n\\`\\`\\`\n\nNor will this:\n\n\\`\\`\\`js\n/**\n * @param cfg\n * @param cfg.num\n * @param cfg.innerProp1\n * @param cfg.innerProp2\n */\nfunction quux ({num, ...extra}) {\n}\n\\`\\`\\``,\n type: 'boolean',\n },\n checkSetters: {\n default: false,\n description: 'A value indicating whether setters should be checked. Defaults to `false`.',\n type: 'boolean',\n },\n checkTypesPattern: {\n description: `When one specifies a type, unless it is of a generic type, like \\`object\\`\nor \\`array\\`, it may be considered unnecessary to have that object's\ndestructured components required, especially where generated docs will\nlink back to the specified type. For example:\n\n\\`\\`\\`js\n/**\n * @param {SVGRect} bbox - a SVGRect\n */\nexport const bboxToObj = function ({x, y, width, height}) {\n return {x, y, width, height};\n};\n\\`\\`\\`\n\nBy default \\`checkTypesPattern\\` is set to\n\\`/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/v\\`,\nmeaning that destructuring will be required only if the type of the \\`@param\\`\n(the text between curly brackets) is a match for \"Object\" or \"Array\" (with or\nwithout initial caps), \"PlainObject\", or \"GenericObject\", \"GenericArray\" (or\nif no type is present). So in the above example, the lack of a match will\nmean that no complaint will be given about the undocumented destructured\nparameters.\n\nNote that the \\`/\\` delimiters are optional, but necessary to add flags.\n\nDefaults to using (only) the \\`v\\` flag, so to add your own flags, encapsulate\nyour expression as a string, but like a literal, e.g., \\`/^object$/vi\\`.\n\nYou could set this regular expression to a more expansive list, or you\ncould restrict it such that even types matching those strings would not\nneed destructuring.`,\n type: 'string',\n },\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\n\\`context\\` defaults to \\`any\\` and \\`comment\\` defaults to no specific comment context.\n\nOverrides the default contexts (\\`ArrowFunctionExpression\\`, \\`FunctionDeclaration\\`,\n\\`FunctionExpression\\`). May be useful for adding such as\n\\`TSMethodSignature\\` in TypeScript or restricting the contexts\nwhich are checked.\n\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `true`.',\n type: 'boolean',\n },\n enableRestElementFixer: {\n description: `Whether to enable the rest element fixer.\n\nThe fixer will automatically report/insert\n[JSDoc repeatable parameters](https://jsdoc.app/tags-param.html#multiple-types-and-repeatable-parameters)\nif missing.\n\n\\`\\`\\`js\n/**\n * @param {GenericArray} cfg\n * @param {number} cfg.\"0\"\n */\nfunction baar ([a, ...extra]) {\n //\n}\n\\`\\`\\`\n\n...becomes:\n\n\\`\\`\\`js\n/**\n * @param {GenericArray} cfg\n * @param {number} cfg.\"0\"\n * @param {...any} cfg.\"1\"\n */\nfunction baar ([a, ...extra]) {\n //\n}\n\\`\\`\\`\n\nNote that the type \\`any\\` is included since we don't know of any specific\ntype to use.\n\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n enableRootFixer: {\n description: `Whether to enable the auto-adding of incrementing roots.\n\nThe default behavior of \\`true\\` is for \"root\" to be auto-inserted for missing\nroots, followed by a 0-based auto-incrementing number.\n\nSo for:\n\n\\`\\`\\`js\nfunction quux ({foo}, {bar}, {baz}) {\n}\n\\`\\`\\`\n\n...the default JSDoc that would be added if the fixer is enabled would be:\n\n\\`\\`\\`js\n/**\n* @param root0\n* @param root0.foo\n* @param root1\n* @param root1.bar\n* @param root2\n* @param root2.baz\n*/\n\\`\\`\\`\n\nHas no effect if \\`enableFixer\\` is set to \\`false\\`.`,\n type: 'boolean',\n },\n exemptedBy: {\n description: `Array of tags (e.g., \\`['type']\\`) whose presence on the document block\navoids the need for a \\`@param\\`. 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 ignoreWhenAllParamsMissing: {\n description: `Set to \\`true\\` to ignore reporting when all params are missing. Defaults to\n\\`false\\`.`,\n type: 'boolean',\n },\n interfaceExemptsParamsCheck: {\n description: `Set if you wish TypeScript interfaces to exempt checks for the existence of\n\\`@param\\`'s.\n\nWill check for a type defining the function itself (on a variable\ndeclaration) or if there is a single destructured object with a type.\nDefaults to \\`false\\`.`,\n type: 'boolean',\n },\n unnamedRootBase: {\n description: `An array of root names to use in the fixer when roots are missing. Defaults\nto \\`['root']\\`. Note that only when all items in the array besides the last\nare exhausted will auto-incrementing occur. So, with\n\\`unnamedRootBase: ['arg', 'config']\\`, the following:\n\n\\`\\`\\`js\nfunction quux ({foo}, [bar], {baz}) {\n}\n\\`\\`\\`\n\n...will get the following JSDoc block added:\n\n\\`\\`\\`js\n/**\n* @param arg\n* @param arg.foo\n* @param config0\n* @param config0.\"0\" (\\`bar\\`)\n* @param config1\n* @param config1.baz\n*/\n\\`\\`\\``,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n useDefaultObjectProperties: {\n description: `Set to \\`true\\` if you wish to expect documentation of properties on objects\nsupplied as default values. Defaults to \\`false\\`.`,\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 i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,CAAC;QACD+G,YAAY,EAAE;UACZjJ,OAAO,EAAE,KAAK;UACdmH,WAAW,EAAE,4EAA4E;UACzFjF,IAAI,EAAE;QACR,CAAC;QACDX,iBAAiB,EAAE;UACjBvB,OAAO,EAAE,KAAK;UACdmH,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;UACKjF,IAAI,EAAE;QACR,CAAC;QACDgH,YAAY,EAAE;UACZlJ,OAAO,EAAE,KAAK;UACdmH,WAAW,EAAE,4EAA4E;UACzFjF,IAAI,EAAE;QACR,CAAC;QACDV,iBAAiB,EAAE;UACjB2F,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;UACRjF,IAAI,EAAE;QACR,CAAC;QACDiH,QAAQ,EAAE;UACRhC,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;UAClDiC,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEnH,IAAI,EAAE;YACR,CAAC,EACD;cACE4G,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVO,OAAO,EAAE;kBACPpH,IAAI,EAAE;gBACR,CAAC;gBACDpB,OAAO,EAAE;kBACPoB,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDT,WAAW,EAAE;UACX0F,WAAW,EAAE,kDAAkD;UAC/DjF,IAAI,EAAE;QACR,CAAC;QACDR,sBAAsB,EAAE;UACtByF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;UACVjF,IAAI,EAAE;QACR,CAAC;QACDP,eAAe,EAAE;UACfwF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;UAC1CjF,IAAI,EAAE;QACR,CAAC;QACDqH,UAAU,EAAE;UACVpC,WAAW,EAAE;AACzB;AACA;AACA;AACA,uBAAuB;UACXiC,KAAK,EAAE;YACLlH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDN,0BAA0B,EAAE;UAC1BuF,WAAW,EAAE;AACzB,WAAW;UACCjF,IAAI,EAAE;QACR,CAAC;QACDL,2BAA2B,EAAE;UAC3BsF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA,uBAAuB;UACXjF,IAAI,EAAE;QACR,CAAC;QACDJ,eAAe,EAAE;UACfqF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;UACKiC,KAAK,EAAE;YACLlH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDH,0BAA0B,EAAE;UAC1BoF,WAAW,EAAE;AACzB,mDAAmD;UACvCjF,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR,CAAC;EAED;EACA;EACA;EACAsH,UAAU,EAAE;AACd,CAAC,CAAC;AAAAC,MAAA,CAAA7I,OAAA,GAAAA,OAAA,CAAAZ,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"requireParam.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","rootNamer","desiredRoots","currentIndex","name","idx","incremented","length","base","suffix","shift","_default","exports","iterateJsdoc","context","jsdoc","node","utils","avoidDocs","hasTag","autoIncrementBase","checkDestructured","checkDestructuredRoots","checkRestProperty","checkTypesPattern","enableFixer","enableRestElementFixer","enableRootFixer","ignoreWhenAllParamsMissing","interfaceExemptsParamsCheck","unnamedRootBase","useDefaultObjectProperties","options","parent","type","id","typeAnnotation","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","remainingFlattenedRoots","slice","foundIndex","findIndex","newAdd","some","flattenedRoot","endsWith","tags","tagLineCount","source","tokens","end","nextRootName","namer","thisOffset","functionParameterIdx","functionParameterName","inc","Array","isArray","matchedJsdoc","rootName","search","hasPropertyRest","hasRestElement","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","firstParamLine","baseOffset","fixer","missingTag","makeMultiline","reportJSDoc","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","checkConstructors","checkGetters","checkSetters","contexts","items","anyOf","comment","exemptedBy","noTracking","module"],"sources":["../../src/rules/requireParam.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\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 context,\n jsdoc,\n node,\n utils,\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 checkDestructured = true,\n checkDestructuredRoots = true,\n checkRestProperty = false,\n checkTypesPattern = '/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/',\n enableFixer = true,\n enableRestElementFixer = true,\n enableRootFixer = true,\n ignoreWhenAllParamsMissing = false,\n interfaceExemptsParamsCheck = false,\n unnamedRootBase = [\n 'root',\n ],\n useDefaultObjectProperties = false,\n } = context.options[0] || {};\n\n if (interfaceExemptsParamsCheck && node &&\n node.parent?.type === 'VariableDeclarator' &&\n 'typeAnnotation' in node.parent.id && node.parent.id.typeAnnotation) {\n return;\n }\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, interfaceExemptsParamsCheck);\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 if (ignoreWhenAllParamsMissing && !jsdocParameterNames.length) {\n return;\n }\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 {{\n * foundIndex: import('../iterateJsdoc.js').Integer,\n * tagLineCount: import('../iterateJsdoc.js').Integer,\n * }}\n */\n const findExpectedIndex = (jsdocTags, indexAtFunctionParams) => {\n // Get the parameters that come after the current index in the flattened order\n const remainingFlattenedRoots = flattenedRoots.slice((indexAtFunctionParams || 0) + 1);\n\n // Find the first existing tag that comes after the current parameter in the flattened order\n const foundIndex = jsdocTags.findIndex(({\n name,\n newAdd,\n }) => {\n if (newAdd) {\n return false;\n }\n\n // Check if the tag name matches any of the remaining flattened roots\n return remainingFlattenedRoots.some((flattenedRoot) => {\n // The flattened roots don't have the root prefix (e.g., \"bar\", \"bar.baz\")\n // but JSDoc tags do (e.g., \"root0\", \"root0.bar\", \"root0.bar.baz\")\n // So we need to check if the tag name ends with the flattened root\n\n // Check if tag name ends with \".<flattenedRoot>\"\n if (name.endsWith(`.${flattenedRoot}`)) {\n return true;\n }\n\n // Also check if tag name exactly matches the flattenedRoot\n // (for single-level params)\n if (name === flattenedRoot) {\n return true;\n }\n\n return false;\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 {\n foundIndex,\n tagLineCount,\n };\n };\n\n let [\n nextRootName,\n incremented,\n namer,\n ] = rootNamer([\n ...unnamedRootBase,\n ], autoIncrementBase);\n\n const thisOffset = functionParameterNames[0] === 'this' ? 1 : 0;\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 - thisOffset];\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\n [\n nextRootName,\n incremented,\n namer,\n ] = namer();\n\n const {\n hasPropertyRest,\n hasRestElement,\n names,\n rests,\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 inc,\n remove,\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 end,\n tag,\n },\n }) => {\n return tag || end;\n });\n if (remove) {\n createTokens(functionParameterIdx, offset + functionParameterIdx, 1);\n } else {\n const {\n foundIndex,\n tagLineCount: expectedIdx,\n } =\n findExpectedIndex(jsdoc.tags, functionParameterIdx);\n\n const firstParamLine = jsdoc.source.findIndex(({\n tokens,\n }) => {\n return tokens.tag === `@${preferredTagName}`;\n });\n const baseOffset = foundIndex > -1 || firstParamLine === -1 ?\n offset :\n firstParamLine;\n\n createTokens(expectedIdx, baseOffset + 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 with a `@param` tag.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n autoIncrementBase: {\n default: 0,\n description: `Numeric to indicate the number at which to begin auto-incrementing roots.\nDefaults to \\`0\\`.`,\n type: 'integer',\n },\n checkConstructors: {\n default: true,\n description: `A value indicating whether \\`constructor\\`s should be checked. Defaults to\n\\`true\\`.`,\n type: 'boolean',\n },\n checkDestructured: {\n default: true,\n description: 'Whether to require destructured properties. Defaults to `true`.',\n type: 'boolean',\n },\n checkDestructuredRoots: {\n default: true,\n description: `Whether to check the existence of a corresponding \\`@param\\` for root objects\nof destructured properties (e.g., that for \\`function ({a, b}) {}\\`, that there\nis something like \\`@param myRootObj\\` defined that can correspond to\nthe \\`{a, b}\\` object parameter).\n\nIf \\`checkDestructuredRoots\\` is \\`false\\`, \\`checkDestructured\\` will also be\nimplied to be \\`false\\` (i.e., the inside of the roots will not be checked\neither, e.g., it will also not complain if \\`a\\` or \\`b\\` do not have their own\ndocumentation). Defaults to \\`true\\`.`,\n type: 'boolean',\n },\n checkGetters: {\n default: false,\n description: 'A value indicating whether getters should be checked. Defaults to `false`.',\n type: 'boolean',\n },\n checkRestProperty: {\n default: false,\n description: `If set to \\`true\\`, will report (and add fixer insertions) for missing rest\nproperties. Defaults to \\`false\\`.\n\nIf set to \\`true\\`, note that you can still document the subproperties of the\nrest property using other jsdoc features, e.g., \\`@typedef\\`:\n\n\\`\\`\\`js\n/**\n * @typedef ExtraOptions\n * @property innerProp1\n * @property innerProp2\n */\n\n/**\n * @param cfg\n * @param cfg.num\n * @param {ExtraOptions} extra\n */\nfunction quux ({num, ...extra}) {\n}\n\\`\\`\\`\n\nSetting this option to \\`false\\` (the default) may be useful in cases where\nyou already have separate \\`@param\\` definitions for each of the properties\nwithin the rest property.\n\nFor example, with the option disabled, this will not give an error despite\n\\`extra\\` not having any definition:\n\n\\`\\`\\`js\n/**\n * @param cfg\n * @param cfg.num\n */\nfunction quux ({num, ...extra}) {\n}\n\\`\\`\\`\n\nNor will this:\n\n\\`\\`\\`js\n/**\n * @param cfg\n * @param cfg.num\n * @param cfg.innerProp1\n * @param cfg.innerProp2\n */\nfunction quux ({num, ...extra}) {\n}\n\\`\\`\\``,\n type: 'boolean',\n },\n checkSetters: {\n default: false,\n description: 'A value indicating whether setters should be checked. Defaults to `false`.',\n type: 'boolean',\n },\n checkTypesPattern: {\n description: `When one specifies a type, unless it is of a generic type, like \\`object\\`\nor \\`array\\`, it may be considered unnecessary to have that object's\ndestructured components required, especially where generated docs will\nlink back to the specified type. For example:\n\n\\`\\`\\`js\n/**\n * @param {SVGRect} bbox - a SVGRect\n */\nexport const bboxToObj = function ({x, y, width, height}) {\n return {x, y, width, height};\n};\n\\`\\`\\`\n\nBy default \\`checkTypesPattern\\` is set to\n\\`/^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$/v\\`,\nmeaning that destructuring will be required only if the type of the \\`@param\\`\n(the text between curly brackets) is a match for \"Object\" or \"Array\" (with or\nwithout initial caps), \"PlainObject\", or \"GenericObject\", \"GenericArray\" (or\nif no type is present). So in the above example, the lack of a match will\nmean that no complaint will be given about the undocumented destructured\nparameters.\n\nNote that the \\`/\\` delimiters are optional, but necessary to add flags.\n\nDefaults to using (only) the \\`v\\` flag, so to add your own flags, encapsulate\nyour expression as a string, but like a literal, e.g., \\`/^object$/vi\\`.\n\nYou could set this regular expression to a more expansive list, or you\ncould restrict it such that even types matching those strings would not\nneed destructuring.`,\n type: 'string',\n },\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\n\\`context\\` defaults to \\`any\\` and \\`comment\\` defaults to no specific comment context.\n\nOverrides the default contexts (\\`ArrowFunctionExpression\\`, \\`FunctionDeclaration\\`,\n\\`FunctionExpression\\`). May be useful for adding such as\n\\`TSMethodSignature\\` in TypeScript or restricting the contexts\nwhich are checked.\n\nSee the [\"AST and Selectors\"](../advanced.md#ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `true`.',\n type: 'boolean',\n },\n enableRestElementFixer: {\n description: `Whether to enable the rest element fixer.\n\nThe fixer will automatically report/insert\n[JSDoc repeatable parameters](https://jsdoc.app/tags-param.html#multiple-types-and-repeatable-parameters)\nif missing.\n\n\\`\\`\\`js\n/**\n * @param {GenericArray} cfg\n * @param {number} cfg.\"0\"\n */\nfunction baar ([a, ...extra]) {\n //\n}\n\\`\\`\\`\n\n...becomes:\n\n\\`\\`\\`js\n/**\n * @param {GenericArray} cfg\n * @param {number} cfg.\"0\"\n * @param {...any} cfg.\"1\"\n */\nfunction baar ([a, ...extra]) {\n //\n}\n\\`\\`\\`\n\nNote that the type \\`any\\` is included since we don't know of any specific\ntype to use.\n\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n enableRootFixer: {\n description: `Whether to enable the auto-adding of incrementing roots.\n\nThe default behavior of \\`true\\` is for \"root\" to be auto-inserted for missing\nroots, followed by a 0-based auto-incrementing number.\n\nSo for:\n\n\\`\\`\\`js\nfunction quux ({foo}, {bar}, {baz}) {\n}\n\\`\\`\\`\n\n...the default JSDoc that would be added if the fixer is enabled would be:\n\n\\`\\`\\`js\n/**\n* @param root0\n* @param root0.foo\n* @param root1\n* @param root1.bar\n* @param root2\n* @param root2.baz\n*/\n\\`\\`\\`\n\nHas no effect if \\`enableFixer\\` is set to \\`false\\`.`,\n type: 'boolean',\n },\n exemptedBy: {\n description: `Array of tags (e.g., \\`['type']\\`) whose presence on the document block\navoids the need for a \\`@param\\`. 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 ignoreWhenAllParamsMissing: {\n description: `Set to \\`true\\` to ignore reporting when all params are missing. Defaults to\n\\`false\\`.`,\n type: 'boolean',\n },\n interfaceExemptsParamsCheck: {\n description: `Set if you wish TypeScript interfaces to exempt checks for the existence of\n\\`@param\\`'s.\n\nWill check for a type defining the function itself (on a variable\ndeclaration) or if there is a single destructured object with a type.\nDefaults to \\`false\\`.`,\n type: 'boolean',\n },\n unnamedRootBase: {\n description: `An array of root names to use in the fixer when roots are missing. Defaults\nto \\`['root']\\`. Note that only when all items in the array besides the last\nare exhausted will auto-incrementing occur. So, with\n\\`unnamedRootBase: ['arg', 'config']\\`, the following:\n\n\\`\\`\\`js\nfunction quux ({foo}, [bar], {baz}) {\n}\n\\`\\`\\`\n\n...will get the following JSDoc block added:\n\n\\`\\`\\`js\n/**\n* @param arg\n* @param arg.foo\n* @param config0\n* @param config0.\"0\" (\\`bar\\`)\n* @param config1\n* @param config1.baz\n*/\n\\`\\`\\``,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n useDefaultObjectProperties: {\n description: `Set to \\`true\\` if you wish to expect documentation of properties on objects\nsupplied as default values. Defaults to \\`false\\`.`,\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;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C;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,IAAI,GAAGN,YAAY,CAAC,CAAC,CAAC;IAC5B,MAAMO,MAAM,GAAGJ,GAAG,EAAE;IACpBD,IAAI,GAAG,GAAGI,IAAI,GAAGC,MAAM,EAAE;EAC3B,CAAC,MAAM;IACLL,IAAI,GAAG,qBAAuBF,YAAY,CAACQ,KAAK,CAAC,CAAE;EACrD;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,GAAAC,OAAA,CAAAZ,OAAA,GACe,IAAAa,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC;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,EAAE,IAAI;UACbmH,WAAW,EAAE;AACzB,UAAU;UACEjF,IAAI,EAAE;QACR,CAAC;QACDb,iBAAiB,EAAE;UACjBrB,OAAO,EAAE,IAAI;UACbmH,WAAW,EAAE,iEAAiE;UAC9EjF,IAAI,EAAE;QACR,CAAC;QACDZ,sBAAsB,EAAE;UACtBtB,OAAO,EAAE,IAAI;UACbmH,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;UAC1BjF,IAAI,EAAE;QACR,CAAC;QACD+G,YAAY,EAAE;UACZjJ,OAAO,EAAE,KAAK;UACdmH,WAAW,EAAE,4EAA4E;UACzFjF,IAAI,EAAE;QACR,CAAC;QACDX,iBAAiB,EAAE;UACjBvB,OAAO,EAAE,KAAK;UACdmH,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;UACKjF,IAAI,EAAE;QACR,CAAC;QACDgH,YAAY,EAAE;UACZlJ,OAAO,EAAE,KAAK;UACdmH,WAAW,EAAE,4EAA4E;UACzFjF,IAAI,EAAE;QACR,CAAC;QACDV,iBAAiB,EAAE;UACjB2F,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;UACRjF,IAAI,EAAE;QACR,CAAC;QACDiH,QAAQ,EAAE;UACRhC,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;UAClDiC,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEnH,IAAI,EAAE;YACR,CAAC,EACD;cACE4G,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVO,OAAO,EAAE;kBACPpH,IAAI,EAAE;gBACR,CAAC;gBACDpB,OAAO,EAAE;kBACPoB,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDT,WAAW,EAAE;UACX0F,WAAW,EAAE,kDAAkD;UAC/DjF,IAAI,EAAE;QACR,CAAC;QACDR,sBAAsB,EAAE;UACtByF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;UACVjF,IAAI,EAAE;QACR,CAAC;QACDP,eAAe,EAAE;UACfwF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;UAC1CjF,IAAI,EAAE;QACR,CAAC;QACDqH,UAAU,EAAE;UACVpC,WAAW,EAAE;AACzB;AACA;AACA;AACA,uBAAuB;UACXiC,KAAK,EAAE;YACLlH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDN,0BAA0B,EAAE;UAC1BuF,WAAW,EAAE;AACzB,WAAW;UACCjF,IAAI,EAAE;QACR,CAAC;QACDL,2BAA2B,EAAE;UAC3BsF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA,uBAAuB;UACXjF,IAAI,EAAE;QACR,CAAC;QACDJ,eAAe,EAAE;UACfqF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;UACKiC,KAAK,EAAE;YACLlH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDH,0BAA0B,EAAE;UAC1BoF,WAAW,EAAE;AACzB,mDAAmD;UACvCjF,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR,CAAC;EAED;EACA;EACA;EACAsH,UAAU,EAAE;AACd,CAAC,CAAC;AAAAC,MAAA,CAAA7I,OAAA,GAAAA,OAAA,CAAAZ,OAAA","ignoreList":[]}
@@ -62,7 +62,7 @@ for finding function blocks not attached to a function declaration or
62
62
  expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
63
63
  \`@method\`) (including those associated with an \`@interface\`).
64
64
 
65
- See the ["AST and Selectors"](../#advanced-ast-and-selectors)
65
+ See the ["AST and Selectors"](../advanced.md#ast-and-selectors)
66
66
  section of our Advanced docs for more on the expected format.`,
67
67
  items: {
68
68
  anyOf: [{
@@ -1 +1 @@
1
- {"version":3,"file":"requireParamDescription.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","report","settings","utils","defaultDestructuredRootDescription","setDefaultDestructuredRootDescription","options","functionParameterNames","getFunctionParameterNames","rootCount","forEachPreferredTag","jsdocParameter","targetTagName","name","includes","description","trim","Array","isArray","exemptDestructuredRootsFromChecks","reportJSDoc","changeTag","postName","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","type","comment","module"],"sources":["../../src/rules/requireParamDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n report,\n settings,\n utils,\n}) => {\n const {\n defaultDestructuredRootDescription = 'The root object',\n setDefaultDestructuredRootDescription = false,\n } = context.options[0] || {};\n\n const functionParameterNames = utils.getFunctionParameterNames();\n\n let rootCount = -1;\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n rootCount += jsdocParameter.name.includes('.') ? 0 : 1;\n if (!jsdocParameter.description.trim()) {\n if (Array.isArray(functionParameterNames[rootCount])) {\n if (settings.exemptDestructuredRootsFromChecks) {\n return;\n }\n\n if (setDefaultDestructuredRootDescription) {\n utils.reportJSDoc(`Missing root description for @${targetTagName}.`, jsdocParameter, () => {\n utils.changeTag(jsdocParameter, {\n description: defaultDestructuredRootDescription,\n postName: ' ',\n });\n });\n return;\n }\n }\n\n report(\n `Missing JSDoc @${targetTagName} \"${jsdocParameter.name}\" description.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that each `@param` tag has a `description` value.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-description.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\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\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n defaultDestructuredRootDescription: {\n description: `The description string to set by default for destructured roots. Defaults to\n\"The root object\".`,\n type: 'string',\n },\n setDefaultDestructuredRootDescription: {\n description: `Whether to set a default destructured root description. For example, you may\nwish to avoid manually having to set the description for a \\`@param\\`\ncorresponding to a destructured root object as it should always be the same\ntype of object. Uses \\`defaultDestructuredRootDescription\\` for the description\nstring. Defaults to \\`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;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,MAAM;EACNC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,kCAAkC,GAAG,iBAAiB;IACtDC,qCAAqC,GAAG;EAC1C,CAAC,GAAGL,OAAO,CAACM,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAMC,sBAAsB,GAAGJ,KAAK,CAACK,yBAAyB,CAAC,CAAC;EAEhE,IAAIC,SAAS,GAAG,CAAC,CAAC;EAClBN,KAAK,CAACO,mBAAmB,CAAC,OAAO,EAAE,CAACC,cAAc,EAAEC,aAAa,KAAK;IACpEH,SAAS,IAAIE,cAAc,CAACE,IAAI,CAACC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;IACtD,IAAI,CAACH,cAAc,CAACI,WAAW,CAACC,IAAI,CAAC,CAAC,EAAE;MACtC,IAAIC,KAAK,CAACC,OAAO,CAACX,sBAAsB,CAACE,SAAS,CAAC,CAAC,EAAE;QACpD,IAAIP,QAAQ,CAACiB,iCAAiC,EAAE;UAC9C;QACF;QAEA,IAAId,qCAAqC,EAAE;UACzCF,KAAK,CAACiB,WAAW,CAAC,iCAAiCR,aAAa,GAAG,EAAED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A,CAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"requireParamDescription.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","report","settings","utils","defaultDestructuredRootDescription","setDefaultDestructuredRootDescription","options","functionParameterNames","getFunctionParameterNames","rootCount","forEachPreferredTag","jsdocParameter","targetTagName","name","includes","description","trim","Array","isArray","exemptDestructuredRootsFromChecks","reportJSDoc","changeTag","postName","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","type","comment","module"],"sources":["../../src/rules/requireParamDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n report,\n settings,\n utils,\n}) => {\n const {\n defaultDestructuredRootDescription = 'The root object',\n setDefaultDestructuredRootDescription = false,\n } = context.options[0] || {};\n\n const functionParameterNames = utils.getFunctionParameterNames();\n\n let rootCount = -1;\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n rootCount += jsdocParameter.name.includes('.') ? 0 : 1;\n if (!jsdocParameter.description.trim()) {\n if (Array.isArray(functionParameterNames[rootCount])) {\n if (settings.exemptDestructuredRootsFromChecks) {\n return;\n }\n\n if (setDefaultDestructuredRootDescription) {\n utils.reportJSDoc(`Missing root description for @${targetTagName}.`, jsdocParameter, () => {\n utils.changeTag(jsdocParameter, {\n description: defaultDestructuredRootDescription,\n postName: ' ',\n });\n });\n return;\n }\n }\n\n report(\n `Missing JSDoc @${targetTagName} \"${jsdocParameter.name}\" description.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that each `@param` tag has a `description` value.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-description.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\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\nSee the [\"AST and Selectors\"](../advanced.md#ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n defaultDestructuredRootDescription: {\n description: `The description string to set by default for destructured roots. Defaults to\n\"The root object\".`,\n type: 'string',\n },\n setDefaultDestructuredRootDescription: {\n description: `Whether to set a default destructured root description. For example, you may\nwish to avoid manually having to set the description for a \\`@param\\`\ncorresponding to a destructured root object as it should always be the same\ntype of object. Uses \\`defaultDestructuredRootDescription\\` for the description\nstring. Defaults to \\`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;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,MAAM;EACNC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,kCAAkC,GAAG,iBAAiB;IACtDC,qCAAqC,GAAG;EAC1C,CAAC,GAAGL,OAAO,CAACM,OAAO,C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AAE;YACLC,KAAK,EAAE,CACL;cACEC,IAAI,EAAE;YACR,CAAC,EACD;cACEL,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVK,OAAO,EAAE;kBACPD,IAAI,EAAE;gBACR,CAAC;gBACDlC,OAAO,EAAE;kBACPkC,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACD9B,kCAAkC,EAAE;UAClCW,WAAW,EAAE;AACzB,mBAAmB;UACPmB,IAAI,EAAE;QACR,CAAC;QACD7B,qCAAqC,EAAE;UACrCU,WAAW,EAAE;AACzB;AACA;AACA;AACA,+BAA+B;UACnBmB,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAE,MAAA,CAAAtC,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
@@ -38,7 +38,7 @@ for finding function blocks not attached to a function declaration or
38
38
  expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
39
39
  \`@method\`) (including those associated with an \`@interface\`).
40
40
 
41
- See the ["AST and Selectors"](../#advanced-ast-and-selectors)
41
+ See the ["AST and Selectors"](../advanced.md#ast-and-selectors)
42
42
  section of our Advanced docs for more on the expected format.`,
43
43
  items: {
44
44
  anyOf: [{
@@ -1 +1 @@
1
- {"version":3,"file":"requireParamName.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","report","utils","forEachPreferredTag","jsdocParameter","targetTagName","tag","name","type","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","module"],"sources":["../../src/rules/requireParamName.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n if (jsdocParameter.tag && jsdocParameter.name === '') {\n report(\n `There must be an identifier after @${targetTagName} ${jsdocParameter.type === '' ? 'type' : 'tag'}.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all `@param` tags have names.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-name.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 (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the 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\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,MAAM;EACNC;AACF,CAAC,KAAK;EACJA,KAAK,CAACC,mBAAmB,CAAC,OAAO,EAAE,CAACC,cAAc,EAAEC,aAAa,KAAK;IACpE,IAAID,cAAc,CAACE,GAAG,IAAIF,cAAc,CAACG,IAAI,KAAK,EAAE,EAAE;MACpDN,MAAM,CACJ,sCAAsCI,aAAa,IAAID,cAAc,CAACI,IAAI,KAAK,EAAE,GAAG,MAAM,GAAG,KAAK,GAAG,EACrG,IAAI,EACJJ,cACF,CAAC;IACH;EACF,CAAC,CAAC;AACJ,CAAC,EAAE;EACDK,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,6CAA6C;MAC1DC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,QAAQ,EAAE;UACRL,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;UAClDM,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEX,IAAI,EAAE;YACR,CAAC,EACD;cACEO,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVI,OAAO,EAAE;kBACPZ,IAAI,EAAE;gBACR,CAAC;gBACDa,OAAO,EAAE;kBACPb,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAc,MAAA,CAAAvB,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"requireParamName.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","report","utils","forEachPreferredTag","jsdocParameter","targetTagName","tag","name","type","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","module"],"sources":["../../src/rules/requireParamName.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n if (jsdocParameter.tag && jsdocParameter.name === '') {\n report(\n `There must be an identifier after @${targetTagName} ${jsdocParameter.type === '' ? 'type' : 'tag'}.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all `@param` tags have names.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-name.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 (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the 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\nSee the [\"AST and Selectors\"](../advanced.md#ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,MAAM;EACNC;AACF,CAAC,KAAK;EACJA,KAAK,CAACC,mBAAmB,CAAC,OAAO,EAAE,CAACC,cAAc,EAAEC,aAAa,KAAK;IACpE,IAAID,cAAc,CAACE,GAAG,IAAIF,cAAc,CAACG,IAAI,KAAK,EAAE,EAAE;MACpDN,MAAM,CACJ,sCAAsCI,aAAa,IAAID,cAAc,CAACI,IAAI,KAAK,EAAE,GAAG,MAAM,GAAG,KAAK,GAAG,EACrG,IAAI,EACJJ,cACF,CAAC;IACH;EACF,CAAC,CAAC;AACJ,CAAC,EAAE;EACDK,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,6CAA6C;MAC1DC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,QAAQ,EAAE;UACRL,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;UAClDM,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEX,IAAI,EAAE;YACR,CAAC,EACD;cACEO,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVI,OAAO,EAAE;kBACPZ,IAAI,EAAE;gBACR,CAAC;gBACDa,OAAO,EAAE;kBACPb,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAc,MAAA,CAAAvB,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
@@ -62,7 +62,7 @@ for finding function blocks not attached to a function declaration or
62
62
  expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
63
63
  \`@method\`) (including those associated with an \`@interface\`).
64
64
 
65
- See the ["AST and Selectors"](../#advanced-ast-and-selectors)
65
+ See the ["AST and Selectors"](../advanced.md#ast-and-selectors)
66
66
  section of our Advanced docs for more on the expected format.`,
67
67
  items: {
68
68
  anyOf: [{
@@ -1 +1 @@
1
- {"version":3,"file":"requireParamType.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","report","settings","utils","defaultDestructuredRootType","setDefaultDestructuredRootType","options","functionParameterNames","getFunctionParameterNames","rootCount","forEachPreferredTag","jsdocParameter","targetTagName","name","includes","type","Array","isArray","exemptDestructuredRootsFromChecks","reportJSDoc","changeTag","postType","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","comment","module"],"sources":["../../src/rules/requireParamType.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n report,\n settings,\n utils,\n}) => {\n const {\n defaultDestructuredRootType = 'object',\n setDefaultDestructuredRootType = false,\n } = context.options[0] || {};\n\n const functionParameterNames = utils.getFunctionParameterNames();\n\n let rootCount = -1;\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n rootCount += jsdocParameter.name.includes('.') ? 0 : 1;\n if (!jsdocParameter.type) {\n if (Array.isArray(functionParameterNames[rootCount])) {\n if (settings.exemptDestructuredRootsFromChecks) {\n return;\n }\n\n if (setDefaultDestructuredRootType) {\n utils.reportJSDoc(`Missing root type for @${targetTagName}.`, jsdocParameter, () => {\n utils.changeTag(jsdocParameter, {\n postType: ' ',\n type: `{${defaultDestructuredRootType}}`,\n });\n });\n return;\n }\n }\n\n report(\n `Missing JSDoc @${targetTagName} \"${jsdocParameter.name}\" type.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that each `@param` tag has a type value (in curly brackets).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-type.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\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\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n defaultDestructuredRootType: {\n description: 'The type string to set by default for destructured roots. Defaults to \"object\".',\n type: 'string',\n },\n setDefaultDestructuredRootType: {\n description: `Whether to set a default destructured root type. For example, you may wish\nto avoid manually having to set the type for a \\`@param\\`\ncorresponding to a destructured root object as it is always going to be an\nobject. Uses \\`defaultDestructuredRootType\\` for the type string. Defaults to\n\\`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;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,MAAM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QAAQ,EAAE;UACRN,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;UAClDO,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACElB,IAAI,EAAE;YACR,CAAC,EACD;cACEc,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVI,OAAO,EAAE;kBACPnB,IAAI,EAAE;gBACR,CAAC;gBACDf,OAAO,EAAE;kBACPe,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDX,2BAA2B,EAAE;UAC3BqB,WAAW,EAAE,iFAAiF;UAC9FV,IAAI,EAAE;QACR,CAAC;QACDV,8BAA8B,EAAE;UAC9BoB,WAAW,EAAE;AACzB;AACA;AACA;AACA,WAAW;UACCV,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAoB,MAAA,CAAArC,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"requireParamType.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","report","settings","utils","defaultDestructuredRootType","setDefaultDestructuredRootType","options","functionParameterNames","getFunctionParameterNames","rootCount","forEachPreferredTag","jsdocParameter","targetTagName","name","includes","type","Array","isArray","exemptDestructuredRootsFromChecks","reportJSDoc","changeTag","postType","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","comment","module"],"sources":["../../src/rules/requireParamType.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n report,\n settings,\n utils,\n}) => {\n const {\n defaultDestructuredRootType = 'object',\n setDefaultDestructuredRootType = false,\n } = context.options[0] || {};\n\n const functionParameterNames = utils.getFunctionParameterNames();\n\n let rootCount = -1;\n utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n rootCount += jsdocParameter.name.includes('.') ? 0 : 1;\n if (!jsdocParameter.type) {\n if (Array.isArray(functionParameterNames[rootCount])) {\n if (settings.exemptDestructuredRootsFromChecks) {\n return;\n }\n\n if (setDefaultDestructuredRootType) {\n utils.reportJSDoc(`Missing root type for @${targetTagName}.`, jsdocParameter, () => {\n utils.changeTag(jsdocParameter, {\n postType: ' ',\n type: `{${defaultDestructuredRootType}}`,\n });\n });\n return;\n }\n }\n\n report(\n `Missing JSDoc @${targetTagName} \"${jsdocParameter.name}\" type.`,\n null,\n jsdocParameter,\n );\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that each `@param` tag has a type value (in curly brackets).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-type.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\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\nSee the [\"AST and Selectors\"](../advanced.md#ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n defaultDestructuredRootType: {\n description: 'The type string to set by default for destructured roots. Defaults to \"object\".',\n type: 'string',\n },\n setDefaultDestructuredRootType: {\n description: `Whether to set a default destructured root type. For example, you may wish\nto avoid manually having to set the type for a \\`@param\\`\ncorresponding to a destructured root object as it is always going to be an\nobject. Uses \\`defaultDestructuredRootType\\` for the type string. Defaults to\n\\`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;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,MAAM;EACNC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,2BAA2B,GAAG,QAAQ;IACtCC,8BAA8B,GAAG;EACnC,CAAC,GAAGL,OAAO,CAACM,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAMC,sBAAsB,GAAGJ,KAAK,CAACK,yBAAyB,CAAC,CAAC;EAEhE,IAAIC,SAAS,GAAG,CAAC,CAAC;EAClBN,KAAK,CAACO,mBAAmB,CAAC,OAAO,EAAE,CAACC,cAAc,EAAEC,aAAa,KAAK;IACpEH,SAAS,IAAIE,cAAc,CAACE,IAAI,CAACC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;IACtD,IAAI,CAACH,cAAc,CAACI,IAAI,EAAE;MACxB,IAAIC,KAAK,CAACC,OAAO,CAACV,sBAAsB,CAACE,SAAS,CAAC,CAAC,EAAE;QACpD,IAAIP,QAAQ,CAACgB,iCAAiC,EAAE;UAC9C;QACF;QAEA,IAAIb,8BAA8B,EAAE;UAClCF,KAAK,CAACgB,WAAW,CAAC,0BAA0BP,aAAa,GAAG,EAAED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AAF,OAAA","ignoreList":[]}
@@ -6,7 +6,17 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
8
8
  var _jsdocUtils = require("../jsdocUtils.cjs");
9
+ var _jsdoccomment = require("@es-joy/jsdoccomment");
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ /**
12
+ * @type {Partial<Record<import('../jsdocUtils.js').ParserMode, import('jsdoc-type-pratt-parser').ParseMode[]>>}
13
+ */
14
+ const parseTypeModes = {
15
+ closure: ['closure'],
16
+ jsdoc: ['jsdoc'],
17
+ typescript: ['typescript']
18
+ };
19
+
10
20
  /**
11
21
  * @param {import('../iterateJsdoc.js').Utils} utils
12
22
  * @param {import('../iterateJsdoc.js').Settings} settings
@@ -29,11 +39,32 @@ const canSkip = (utils, settings) => {
29
39
  }
30
40
  return utils.hasATag(voidingTags) || utils.isConstructor() || utils.classHasTag('interface') || settings.mode === 'closure' && utils.classHasTag('record');
31
41
  };
42
+
43
+ /**
44
+ * @param {import('jsdoc-type-pratt-parser').RootResult} parsedType
45
+ * @returns {import('jsdoc-type-pratt-parser').RootResult}
46
+ */
47
+ const getReturnTypeLevelNode = parsedType => {
48
+ return parsedType.type === 'JsdocTypeParenthesis' ? parsedType.element : parsedType;
49
+ };
50
+
51
+ /**
52
+ * @param {import('eslint').Rule.RuleContext} context
53
+ * @param {import('../jsdocUtils.js').ParserMode} mode
54
+ * @returns {import('../jsdocUtils.js').ParserMode}
55
+ */
56
+ const getParseMode = (context, mode) => {
57
+ const {
58
+ jsdoc
59
+ } = /** @type {{jsdoc?: {mode?: import('../jsdocUtils.js').ParserMode}}} */context.settings;
60
+ return jsdoc?.mode ?? mode;
61
+ };
32
62
  var _default = exports.default = (0, _iterateJsdoc.default)(({
33
63
  context,
34
64
  node,
35
65
  report,
36
66
  settings,
67
+ sourceCode,
37
68
  utils
38
69
  }) => {
39
70
  const {
@@ -42,6 +73,10 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
42
73
  noNativeTypes = true,
43
74
  reportMissingReturnForUndefinedTypes = false
44
75
  } = context.options[0] || {};
76
+ const {
77
+ mode
78
+ } = settings;
79
+ const parseMode = getParseMode(context, mode);
45
80
  if (canSkip(utils, settings)) {
46
81
  return;
47
82
  }
@@ -71,6 +106,56 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
71
106
  return;
72
107
  }
73
108
  const returnNever = type === 'never';
109
+ const typedefs = (0, _jsdocUtils.getDocumentNamepathDefiningTags)(sourceCode);
110
+
111
+ /**
112
+ * @param {import('comment-parser').Spec} returnTag
113
+ * @returns {boolean}
114
+ */
115
+ const mayReturnUndefined = returnTag => {
116
+ if (utils.mayBeUndefinedTypeTag(returnTag)) {
117
+ return true;
118
+ }
119
+ const returnType = returnTag.type.trim();
120
+ let parsedType;
121
+ try {
122
+ parsedType = (0, _jsdoccomment.tryParse)(returnType, parseTypeModes[parseMode]);
123
+ } catch {
124
+ return false;
125
+ }
126
+ const returnTypeLevelNode = getReturnTypeLevelNode(parsedType);
127
+ let returnIsUndefined = false;
128
+ (0, _jsdoccomment.traverse)(returnTypeLevelNode, (nde, parentNode) => {
129
+ const isReturnLevelNode = !parentNode || returnTypeLevelNode.type === 'JsdocTypeUnion' && parentNode === returnTypeLevelNode;
130
+ if (!isReturnLevelNode) {
131
+ return;
132
+ }
133
+ const {
134
+ type: nodeType
135
+ } = /** @type {import('jsdoc-type-pratt-parser').RootResult} */nde;
136
+ if (nodeType === 'JsdocTypeUndefined') {
137
+ returnIsUndefined = true;
138
+ return;
139
+ }
140
+ if (nodeType !== 'JsdocTypeName') {
141
+ return;
142
+ }
143
+ const {
144
+ value
145
+ } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */nde;
146
+ if (value === 'void') {
147
+ returnIsUndefined = true;
148
+ return;
149
+ }
150
+ const referencedTypedef = typedefs.find(typedefTag => {
151
+ return typedefTag.name === value;
152
+ });
153
+ if (referencedTypedef && utils.mayBeUndefinedTypeTag(referencedTypedef)) {
154
+ returnIsUndefined = true;
155
+ }
156
+ });
157
+ return returnIsUndefined;
158
+ };
74
159
  if (returnNever && utils.hasValueOrExecutorHasNonEmptyResolveValue(false)) {
75
160
  report(`JSDoc @${tagName} declaration set with "never" but return expression is present in function.`);
76
161
  return;
@@ -81,7 +166,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
81
166
  }
82
167
 
83
168
  // In case a return value is declared in JSDoc, we also expect one in the code.
84
- if (!returnNever && (reportMissingReturnForUndefinedTypes || !utils.mayBeUndefinedTypeTag(tag)) && (tag.type === '' && !utils.hasValueOrExecutorHasNonEmptyResolveValue(exemptAsync) || tag.type !== '' && !utils.hasValueOrExecutorHasNonEmptyResolveValue(exemptAsync, true)) && Boolean(!exemptGenerators || !node || !('generator' in (/** @type {import('../iterateJsdoc.js').Node} */node)) || !(/** @type {import('@typescript-eslint/types').TSESTree.FunctionDeclaration} */node).generator)) {
169
+ if (!returnNever && (reportMissingReturnForUndefinedTypes || !mayReturnUndefined(tag)) && (tag.type === '' && !utils.hasValueOrExecutorHasNonEmptyResolveValue(exemptAsync) || tag.type !== '' && !utils.hasValueOrExecutorHasNonEmptyResolveValue(exemptAsync, true)) && Boolean(!exemptGenerators || !node || !('generator' in (/** @type {import('../iterateJsdoc.js').Node} */node)) || !(/** @type {import('@typescript-eslint/types').TSESTree.FunctionDeclaration} */node).generator)) {
85
170
  report(`JSDoc @${tagName} declaration present but return expression not available in function.`);
86
171
  }
87
172
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"requireReturnsCheck.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_jsdocUtils","e","__esModule","default","canSkip","utils","settings","voidingTags","mode","push","hasATag","isConstructor","classHasTag","_default","exports","iterateJsdoc","context","node","report","exemptAsync","exemptGenerators","noNativeTypes","reportMissingReturnForUndefinedTypes","options","isAsync","tagName","getPreferredTagName","tags","getTags","length","tag","type","trim","test","returnNever","hasValueOrExecutorHasNonEmptyResolveValue","strictNativeTypes","includes","mayBeUndefinedTypeTag","Boolean","generator","meta","docs","description","url","schema","additionalProperties","properties","module"],"sources":["../../src/rules/requireReturnsCheck.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n strictNativeTypes,\n} from '../jsdocUtils.js';\n\n/**\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @param {import('../iterateJsdoc.js').Settings} settings\n * @returns {boolean}\n */\nconst canSkip = (utils, settings) => {\n const voidingTags = [\n // An abstract function is by definition incomplete\n // so it is perfectly fine if a return is documented but\n // not present within the function.\n // A subclass may inherit the doc and implement the\n // missing return.\n 'abstract',\n 'virtual',\n\n // A constructor function returns `this` by default, so may be `@returns`\n // tag indicating this but no explicit return\n 'class',\n 'constructor',\n 'interface',\n ];\n\n if (settings.mode === 'closure') {\n // Structural Interface in GCC terms, equivalent to @interface tag as far as this rule is concerned\n voidingTags.push('record');\n }\n\n return utils.hasATag(voidingTags) ||\n utils.isConstructor() ||\n utils.classHasTag('interface') ||\n settings.mode === 'closure' && utils.classHasTag('record');\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n utils,\n}) => {\n const {\n exemptAsync = true,\n exemptGenerators = settings.mode === 'typescript',\n noNativeTypes = true,\n reportMissingReturnForUndefinedTypes = false,\n } = context.options[0] || {};\n\n if (canSkip(utils, settings)) {\n return;\n }\n\n const isAsync = utils.isAsync();\n if (exemptAsync && isAsync) {\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 === 0) {\n return;\n }\n\n if (tags.length > 1) {\n report(`Found more than one @${tagName} declaration.`);\n\n return;\n }\n\n const [\n tag,\n ] = tags;\n\n const type = tag.type.trim();\n\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions\n if (/asserts\\s/v.test(type)) {\n return;\n }\n\n const returnNever = type === 'never';\n\n if (returnNever && utils.hasValueOrExecutorHasNonEmptyResolveValue(false)) {\n report(`JSDoc @${tagName} declaration set with \"never\" but return expression is present in function.`);\n\n return;\n }\n\n if (noNativeTypes && isAsync && strictNativeTypes.includes(type)) {\n report('Function is async or otherwise returns a Promise but the return type is a native type.');\n return;\n }\n\n // In case a return value is declared in JSDoc, we also expect one in the code.\n if (\n !returnNever &&\n (\n reportMissingReturnForUndefinedTypes ||\n !utils.mayBeUndefinedTypeTag(tag)\n ) &&\n (tag.type === '' && !utils.hasValueOrExecutorHasNonEmptyResolveValue(\n exemptAsync,\n ) ||\n tag.type !== '' && !utils.hasValueOrExecutorHasNonEmptyResolveValue(\n exemptAsync,\n true,\n )) &&\n Boolean(\n !exemptGenerators || !node ||\n !('generator' in /** @type {import('../iterateJsdoc.js').Node} */ (node)) ||\n !(/** @type {import('@typescript-eslint/types').TSESTree.FunctionDeclaration} */ (node)).generator,\n )\n ) {\n report(`JSDoc @${tagName} declaration present but return expression not available in function.`);\n }\n}, {\n meta: {\n docs: {\n description: 'Requires a return statement in function body if a `@returns` tag is specified in JSDoc comment(and reports if multiple `@returns` tags are present).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-check.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n exemptAsync: {\n default: true,\n description: `By default, functions which return a \\`Promise\\` that are not\ndetected as resolving with a non-\\`undefined\\` value and \\`async\\` functions\n(even ones that do not explicitly return a value, as these are returning a\n\\`Promise\\` implicitly) will be exempted from reporting by this rule.\nIf you wish to insist that only \\`Promise\\`'s which resolve to\nnon-\\`undefined\\` values or \\`async\\` functions with explicit \\`return\\`'s will\nbe exempted from reporting (i.e., that \\`async\\` functions can be reported\nif they lack an explicit (non-\\`undefined\\`) \\`return\\` when a \\`@returns\\` is\npresent), you can set \\`exemptAsync\\` to \\`false\\` on the options object.`,\n type: 'boolean',\n },\n exemptGenerators: {\n description: `Because a generator might be labeled as having a\n\\`IterableIterator\\` \\`@returns\\` value (along with an iterator type\ncorresponding to the type of any \\`yield\\` statements), projects might wish to\nleverage \\`@returns\\` in generators even without a \\`return\\` statement. This\noption is therefore \\`true\\` by default in \\`typescript\\` mode (in \"jsdoc\" mode,\none might be more likely to take advantage of \\`@yields\\`). Set it to \\`false\\`\nif you wish for a missing \\`return\\` to be flagged regardless.`,\n type: 'boolean',\n },\n noNativeTypes: {\n description: `Whether to check that async functions do not\nindicate they return non-native types. Defaults to \\`true\\`.`,\n type: 'boolean',\n },\n reportMissingReturnForUndefinedTypes: {\n default: false,\n description: `If \\`true\\` and no return or\nresolve value is found, this setting will even insist that reporting occur\nwith \\`void\\` or \\`undefined\\` (including as an indicated \\`Promise\\` type).\nUnlike \\`require-returns\\`, with this option in the rule, one can\n*discourage* the labeling of \\`undefined\\` types. Defaults to \\`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;AACA,IAAAC,WAAA,GAAAD,OAAA;AAE0B,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1B;AACA;AACA;AACA;AACA;AACA,MAAMG,OAAO,GAAGA,CAACC,KAAK,EAAEC,QAAQ,KAAK;EACnC,MAAMC,WAAW,GAAG;EAClB;EACA;EACA;EACA;EACA;EACA,UAAU,EACV,SAAS;EAET;EACA;EACA,OAAO,EACP,aAAa,EACb,WAAW,CACZ;EAED,IAAID,QAAQ,CAACE,IAAI,KAAK,SAAS,EAAE;IAC/B;IACAD,WAAW,CAACE,IAAI,CAAC,QAAQ,CAAC;EAC5B;EAEA,OAAOJ,KAAK,CAACK,OAAO,CAACH,WAAW,CAAC,IAC/BF,KAAK,CAACM,aAAa,CAAC,CAAC,IACrBN,KAAK,CA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,+DAA+D;UACnDZ,IAAI,EAAE;QACR,CAAC;QACDV,aAAa,EAAE;UACbsB,WAAW,EAAE;AACzB,6DAA6D;UACjDZ,IAAI,EAAE;QACR,CAAC;QACDT,oCAAoC,EAAE;UACpCnB,OAAO,EAAE,KAAK;UACdwC,WAAW,EAAE;AACzB;AACA;AACA;AACA,yEAAyE;UAC7DZ,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAiB,MAAA,CAAAlC,OAAA,GAAAA,OAAA,CAAAX,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"requireReturnsCheck.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_jsdocUtils","_jsdoccomment","e","__esModule","default","parseTypeModes","closure","jsdoc","typescript","canSkip","utils","settings","voidingTags","mode","push","hasATag","isConstructor","classHasTag","getReturnTypeLevelNode","parsedType","type","element","getParseMode","context","_default","exports","iterateJsdoc","node","report","sourceCode","exemptAsync","exemptGenerators","noNativeTypes","reportMissingReturnForUndefinedTypes","options","parseMode","isAsync","tagName","getPreferredTagName","tags","getTags","length","tag","trim","test","returnNever","typedefs","getDocumentNamepathDefiningTags","mayReturnUndefined","returnTag","mayBeUndefinedTypeTag","returnType","tryParseType","returnTypeLevelNode","returnIsUndefined","traverse","nde","parentNode","isReturnLevelNode","nodeType","value","referencedTypedef","find","typedefTag","name","hasValueOrExecutorHasNonEmptyResolveValue","strictNativeTypes","includes","Boolean","generator","meta","docs","description","url","schema","additionalProperties","properties","module"],"sources":["../../src/rules/requireReturnsCheck.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n getDocumentNamepathDefiningTags,\n strictNativeTypes,\n} from '../jsdocUtils.js';\nimport {\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\n/**\n * @type {Partial<Record<import('../jsdocUtils.js').ParserMode, import('jsdoc-type-pratt-parser').ParseMode[]>>}\n */\nconst parseTypeModes = {\n closure: [\n 'closure',\n ],\n jsdoc: [\n 'jsdoc',\n ],\n typescript: [\n 'typescript',\n ],\n};\n\n/**\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @param {import('../iterateJsdoc.js').Settings} settings\n * @returns {boolean}\n */\nconst canSkip = (utils, settings) => {\n const voidingTags = [\n // An abstract function is by definition incomplete\n // so it is perfectly fine if a return is documented but\n // not present within the function.\n // A subclass may inherit the doc and implement the\n // missing return.\n 'abstract',\n 'virtual',\n\n // A constructor function returns `this` by default, so may be `@returns`\n // tag indicating this but no explicit return\n 'class',\n 'constructor',\n 'interface',\n ];\n\n if (settings.mode === 'closure') {\n // Structural Interface in GCC terms, equivalent to @interface tag as far as this rule is concerned\n voidingTags.push('record');\n }\n\n return utils.hasATag(voidingTags) ||\n utils.isConstructor() ||\n utils.classHasTag('interface') ||\n settings.mode === 'closure' && utils.classHasTag('record');\n};\n\n/**\n * @param {import('jsdoc-type-pratt-parser').RootResult} parsedType\n * @returns {import('jsdoc-type-pratt-parser').RootResult}\n */\nconst getReturnTypeLevelNode = (parsedType) => {\n return parsedType.type === 'JsdocTypeParenthesis' ?\n parsedType.element :\n parsedType;\n};\n\n/**\n * @param {import('eslint').Rule.RuleContext} context\n * @param {import('../jsdocUtils.js').ParserMode} mode\n * @returns {import('../jsdocUtils.js').ParserMode}\n */\nconst getParseMode = (context, mode) => {\n const {\n jsdoc,\n } = /** @type {{jsdoc?: {mode?: import('../jsdocUtils.js').ParserMode}}} */ (context.settings);\n\n return jsdoc?.mode ?? mode;\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n sourceCode,\n utils,\n}) => {\n const {\n exemptAsync = true,\n exemptGenerators = settings.mode === 'typescript',\n noNativeTypes = true,\n reportMissingReturnForUndefinedTypes = false,\n } = context.options[0] || {};\n const {\n mode,\n } = settings;\n const parseMode = getParseMode(context, mode);\n\n if (canSkip(utils, settings)) {\n return;\n }\n\n const isAsync = utils.isAsync();\n if (exemptAsync && isAsync) {\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 === 0) {\n return;\n }\n\n if (tags.length > 1) {\n report(`Found more than one @${tagName} declaration.`);\n\n return;\n }\n\n const [\n tag,\n ] = tags;\n\n const type = tag.type.trim();\n\n // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions\n if (/asserts\\s/v.test(type)) {\n return;\n }\n\n const returnNever = type === 'never';\n const typedefs = getDocumentNamepathDefiningTags(sourceCode);\n\n /**\n * @param {import('comment-parser').Spec} returnTag\n * @returns {boolean}\n */\n const mayReturnUndefined = (returnTag) => {\n if (utils.mayBeUndefinedTypeTag(returnTag)) {\n return true;\n }\n\n const returnType = returnTag.type.trim();\n let parsedType;\n try {\n parsedType = tryParseType(returnType, parseTypeModes[parseMode]);\n } catch {\n return false;\n }\n\n const returnTypeLevelNode = getReturnTypeLevelNode(parsedType);\n let returnIsUndefined = false;\n traverse(returnTypeLevelNode, (nde, parentNode) => {\n const isReturnLevelNode = !parentNode ||\n returnTypeLevelNode.type === 'JsdocTypeUnion' && parentNode === returnTypeLevelNode;\n if (!isReturnLevelNode) {\n return;\n }\n\n const {\n type: nodeType,\n } = /** @type {import('jsdoc-type-pratt-parser').RootResult} */ (nde);\n\n if (nodeType === 'JsdocTypeUndefined') {\n returnIsUndefined = true;\n return;\n }\n\n if (nodeType !== 'JsdocTypeName') {\n return;\n }\n\n const {\n value,\n } = /** @type {import('jsdoc-type-pratt-parser').NameResult} */ (nde);\n\n if (value === 'void') {\n returnIsUndefined = true;\n return;\n }\n\n const referencedTypedef = typedefs.find((typedefTag) => {\n return typedefTag.name === value;\n });\n\n if (referencedTypedef && utils.mayBeUndefinedTypeTag(referencedTypedef)) {\n returnIsUndefined = true;\n }\n });\n\n return returnIsUndefined;\n };\n\n if (returnNever && utils.hasValueOrExecutorHasNonEmptyResolveValue(false)) {\n report(`JSDoc @${tagName} declaration set with \"never\" but return expression is present in function.`);\n\n return;\n }\n\n if (noNativeTypes && isAsync && strictNativeTypes.includes(type)) {\n report('Function is async or otherwise returns a Promise but the return type is a native type.');\n return;\n }\n\n // In case a return value is declared in JSDoc, we also expect one in the code.\n if (\n !returnNever &&\n (\n reportMissingReturnForUndefinedTypes ||\n !mayReturnUndefined(tag)\n ) &&\n (tag.type === '' && !utils.hasValueOrExecutorHasNonEmptyResolveValue(\n exemptAsync,\n ) ||\n tag.type !== '' && !utils.hasValueOrExecutorHasNonEmptyResolveValue(\n exemptAsync,\n true,\n )) &&\n Boolean(\n !exemptGenerators || !node ||\n !('generator' in /** @type {import('../iterateJsdoc.js').Node} */ (node)) ||\n !(/** @type {import('@typescript-eslint/types').TSESTree.FunctionDeclaration} */ (node)).generator,\n )\n ) {\n report(`JSDoc @${tagName} declaration present but return expression not available in function.`);\n }\n}, {\n meta: {\n docs: {\n description: 'Requires a return statement in function body if a `@returns` tag is specified in JSDoc comment(and reports if multiple `@returns` tags are present).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-check.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n exemptAsync: {\n default: true,\n description: `By default, functions which return a \\`Promise\\` that are not\ndetected as resolving with a non-\\`undefined\\` value and \\`async\\` functions\n(even ones that do not explicitly return a value, as these are returning a\n\\`Promise\\` implicitly) will be exempted from reporting by this rule.\nIf you wish to insist that only \\`Promise\\`'s which resolve to\nnon-\\`undefined\\` values or \\`async\\` functions with explicit \\`return\\`'s will\nbe exempted from reporting (i.e., that \\`async\\` functions can be reported\nif they lack an explicit (non-\\`undefined\\`) \\`return\\` when a \\`@returns\\` is\npresent), you can set \\`exemptAsync\\` to \\`false\\` on the options object.`,\n type: 'boolean',\n },\n exemptGenerators: {\n description: `Because a generator might be labeled as having a\n\\`IterableIterator\\` \\`@returns\\` value (along with an iterator type\ncorresponding to the type of any \\`yield\\` statements), projects might wish to\nleverage \\`@returns\\` in generators even without a \\`return\\` statement. This\noption is therefore \\`true\\` by default in \\`typescript\\` mode (in \"jsdoc\" mode,\none might be more likely to take advantage of \\`@yields\\`). Set it to \\`false\\`\nif you wish for a missing \\`return\\` to be flagged regardless.`,\n type: 'boolean',\n },\n noNativeTypes: {\n description: `Whether to check that async functions do not\nindicate they return non-native types. Defaults to \\`true\\`.`,\n type: 'boolean',\n },\n reportMissingReturnForUndefinedTypes: {\n default: false,\n description: `If \\`true\\` and no return or\nresolve value is found, this setting will even insist that reporting occur\nwith \\`void\\` or \\`undefined\\` (including as an indicated \\`Promise\\` type).\nUnlike \\`require-returns\\`, with this option in the rule, one can\n*discourage* the labeling of \\`undefined\\` types. Defaults to \\`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;AACA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,aAAA,GAAAF,OAAA;AAG8B,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9B;AACA;AACA;AACA,MAAMG,cAAc,GAAG;EACrBC,OAAO,EAAE,CACP,SAAS,CACV;EACDC,KAAK,EAAE,CACL,OAAO,CACR;EACDC,UAAU,EAAE,CACV,YAAY;AAEhB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAGA,CAACC,KAAK,EAAEC,QAAQ,KAAK;EACnC,MAAMC,WAAW,GAAG;EAClB;EACA;EACA;EACA;EACA;EACA,UAAU,EACV,SAAS;EAET;EACA;EACA,OAAO,EACP,aAAa,EACb,WAAW,CACZ;EAED,IAAID,QAAQ,CAACE,IAAI,KAAK,SAAS,EAAE;IAC/B;IACAD,WAAW,CAACE,IAAI,CAAC,QAAQ,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AAK,CAACuD,yCAAyC,CAClEnC,WACF,CAAC,IACDY,GAAG,CAACtB,IAAI,KAAK,EAAE,IAAI,CAACV,KAAK,CAACuD,yCAAyC,CACjEnC,WAAW,EACX,IACF,CAAC,CAAC,IACFsC,OAAO,CACL,CAACrC,gBAAgB,IAAI,CAACJ,IAAI,IAC1B,EAAE,WAAW,KAAI,gDAAkDA,IAAI,CAAC,CAAC,IACzE,CAAC,CAAC,8EAAgFA,IAAI,EAAG0C,SAC3F,CAAC,EACD;IACAzC,MAAM,CAAC,UAAUS,OAAO,uEAAuE,CAAC;EAClG;AACF,CAAC,EAAE;EACDiC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,sJAAsJ;MACnKC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACV9C,WAAW,EAAE;UACX1B,OAAO,EAAE,IAAI;UACboE,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;UAC9DpD,IAAI,EAAE;QACR,CAAC;QACDW,gBAAgB,EAAE;UAChByC,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA,+DAA+D;UACnDpD,IAAI,EAAE;QACR,CAAC;QACDY,aAAa,EAAE;UACbwC,WAAW,EAAE;AACzB,6DAA6D;UACjDpD,IAAI,EAAE;QACR,CAAC;QACDa,oCAAoC,EAAE;UACpC7B,OAAO,EAAE,KAAK;UACdoE,WAAW,EAAE;AACzB;AACA;AACA;AACA,yEAAyE;UAC7DpD,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAyD,MAAA,CAAApD,OAAA,GAAAA,OAAA,CAAArB,OAAA","ignoreList":[]}
@@ -42,7 +42,7 @@ for finding function blocks not attached to a function declaration or
42
42
  expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
43
43
  \`@method\`) (including those associated with an \`@interface\`).
44
44
 
45
- See the ["AST and Selectors"](../#advanced-ast-and-selectors)
45
+ See the ["AST and Selectors"](../advanced.md#ast-and-selectors)
46
46
  section of our Advanced docs for more on the expected format.`,
47
47
  items: {
48
48
  anyOf: [{
@@ -1 +1 @@
1
- {"version":3,"file":"requireReturnsDescription.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","report","utils","forEachPreferredTag","jsdocTag","targetTagName","type","trim","includes","description","contextDefaults","meta","docs","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","module"],"sources":["../../src/rules/requireReturnsDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n utils.forEachPreferredTag('returns', (jsdocTag, targetTagName) => {\n const type = jsdocTag.type && jsdocTag.type.trim();\n\n if ([\n 'Promise<undefined>', 'Promise<void>', 'undefined', 'void',\n ].includes(type)) {\n return;\n }\n\n if (!jsdocTag.description.trim()) {\n report(`Missing JSDoc @${targetTagName} description.`, null, jsdocTag);\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that the `@returns` tag has a `description` value (not including `void`/`undefined` type returns).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-description.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 (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the 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\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,MAAM;EACNC;AACF,CAAC,KAAK;EACJA,KAAK,CAACC,mBAAmB,CAAC,SAAS,EAAE,CAACC,QAAQ,EAAEC,aAAa,KAAK;IAChE,MAAMC,IAAI,GAAGF,QAAQ,CAACE,IAAI,IAAIF,QAAQ,CAACE,IAAI,CAACC,IAAI,CAAC,CAAC;IAElD,IAAI,CACF,oBAAoB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,CAC3D,CAACC,QAAQ,CAACF,IAAI,CAAC,EAAE;MAChB;IACF;IAEA,IAAI,CAACF,QAAQ,CAACK,WAAW,CAACF,IAAI,CAAC,CAAC,EAAE;MAChCN,MAAM,CAAC,kBAAkBI,aAAa,eAAe,EAAE,IAAI,EAAED,QAAQ,CAAC;IACxE;EACF,CAAC,CAAC;AACJ,CAAC,EAAE;EACDM,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJH,WAAW,EAAE,6GAA6G;MAC1HI,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,QAAQ,EAAE;UACRR,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;UAClDS,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;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAgB,MAAA,CAAAvB,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"requireReturnsDescription.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","report","utils","forEachPreferredTag","jsdocTag","targetTagName","type","trim","includes","description","contextDefaults","meta","docs","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","module"],"sources":["../../src/rules/requireReturnsDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n utils.forEachPreferredTag('returns', (jsdocTag, targetTagName) => {\n const type = jsdocTag.type && jsdocTag.type.trim();\n\n if ([\n 'Promise<undefined>', 'Promise<void>', 'undefined', 'void',\n ].includes(type)) {\n return;\n }\n\n if (!jsdocTag.description.trim()) {\n report(`Missing JSDoc @${targetTagName} description.`, null, jsdocTag);\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that the `@returns` tag has a `description` value (not including `void`/`undefined` type returns).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-description.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 (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the 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\nSee the [\"AST and Selectors\"](../advanced.md#ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,MAAM;EACNC;AACF,CAAC,KAAK;EACJA,KAAK,CAACC,mBAAmB,CAAC,SAAS,EAAE,CAACC,QAAQ,EAAEC,aAAa,KAAK;IAChE,MAAMC,IAAI,GAAGF,QAAQ,CAACE,IAAI,IAAIF,QAAQ,CAACE,IAAI,CAACC,IAAI,CAAC,CAAC;IAElD,IAAI,CACF,oBAAoB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,CAC3D,CAACC,QAAQ,CAACF,IAAI,CAAC,EAAE;MAChB;IACF;IAEA,IAAI,CAACF,QAAQ,CAACK,WAAW,CAACF,IAAI,CAAC,CAAC,EAAE;MAChCN,MAAM,CAAC,kBAAkBI,aAAa,eAAe,EAAE,IAAI,EAAED,QAAQ,CAAC;IACxE;EACF,CAAC,CAAC;AACJ,CAAC,EAAE;EACDM,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJH,WAAW,EAAE,6GAA6G;MAC1HI,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,QAAQ,EAAE;UACRR,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;UAClDS,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;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAgB,MAAA,CAAAvB,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
@@ -38,7 +38,7 @@ for finding function blocks not attached to a function declaration or
38
38
  expression, i.e., \`@callback\` or \`@function\` (or its aliases \`@func\` or
39
39
  \`@method\`) (including those associated with an \`@interface\`).
40
40
 
41
- See the ["AST and Selectors"](../#advanced-ast-and-selectors)
41
+ See the ["AST and Selectors"](../advanced.md#ast-and-selectors)
42
42
  section of our Advanced docs for more on the expected format.`,
43
43
  items: {
44
44
  anyOf: [{
@@ -1 +1 @@
1
- {"version":3,"file":"requireReturnsType.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","report","utils","forEachPreferredTag","jsdocTag","targetTagName","type","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","module"],"sources":["../../src/rules/requireReturnsType.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n utils.forEachPreferredTag('returns', (jsdocTag, targetTagName) => {\n if (!jsdocTag.type) {\n report(`Missing JSDoc @${targetTagName} type.`, null, jsdocTag);\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that `@returns` tag has type value (in curly brackets).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-type.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 (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the 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\nSee the [\"AST and Selectors\"](../#advanced-ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,S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Jsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","report","utils","forEachPreferredTag","jsdocTag","targetTagName","type","contextDefaults","meta","docs","description","url","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","module"],"sources":["../../src/rules/requireReturnsType.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n utils.forEachPreferredTag('returns', (jsdocTag, targetTagName) => {\n if (!jsdocTag.type) {\n report(`Missing JSDoc @${targetTagName} type.`, null, jsdocTag);\n }\n });\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that `@returns` tag has type value (in curly brackets).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-type.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 (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the 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\nSee the [\"AST and Selectors\"](../advanced.md#ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uB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