eslint-plugin-jsdoc 61.1.10 → 61.1.12

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 (45) hide show
  1. package/dist/buildForbidRuleDefinition.cjs +1 -3
  2. package/dist/buildForbidRuleDefinition.cjs.map +1 -1
  3. package/dist/buildForbidRuleDefinition.d.ts +1 -1
  4. package/dist/buildRejectOrPreferRuleDefinition.cjs +1 -3
  5. package/dist/buildRejectOrPreferRuleDefinition.cjs.map +1 -1
  6. package/dist/buildRejectOrPreferRuleDefinition.d.ts +1 -1
  7. package/dist/cjs/buildForbidRuleDefinition.d.ts +1 -1
  8. package/dist/cjs/buildRejectOrPreferRuleDefinition.d.ts +1 -1
  9. package/dist/cjs/iterateJsdoc.d.ts +2 -4
  10. package/dist/cjs/rules/checkTypes.d.ts +1 -1
  11. package/dist/cjs/rules/convertToJsdocComments.d.ts +105 -97
  12. package/dist/cjs/rules/noRestrictedSyntax.d.ts +1 -1
  13. package/dist/cjs/rules/requireTags.d.ts +1 -1
  14. package/dist/exportParser.cjs +1 -0
  15. package/dist/exportParser.cjs.map +1 -1
  16. package/dist/iterateJsdoc.cjs +3 -7
  17. package/dist/iterateJsdoc.cjs.map +1 -1
  18. package/dist/iterateJsdoc.d.ts +2 -4
  19. package/dist/jsdocUtils.cjs +4 -2
  20. package/dist/jsdocUtils.cjs.map +1 -1
  21. package/dist/rules/checkTypes.d.ts +1 -1
  22. package/dist/rules/convertToJsdocComments.cjs +1 -0
  23. package/dist/rules/convertToJsdocComments.cjs.map +1 -1
  24. package/dist/rules/convertToJsdocComments.d.ts +105 -97
  25. package/dist/rules/noRestrictedSyntax.d.ts +1 -1
  26. package/dist/rules/noUndefinedTypes.cjs +10 -1
  27. package/dist/rules/noUndefinedTypes.cjs.map +1 -1
  28. package/dist/rules/requireFileOverview.cjs +1 -1
  29. package/dist/rules/requireFileOverview.cjs.map +1 -1
  30. package/dist/rules/requireJsdoc.cjs +1 -0
  31. package/dist/rules/requireJsdoc.cjs.map +1 -1
  32. package/dist/rules/requireParam.cjs +24 -15
  33. package/dist/rules/requireParam.cjs.map +1 -1
  34. package/dist/rules/requireTags.d.ts +1 -1
  35. package/package.json +7 -7
  36. package/src/buildForbidRuleDefinition.js +1 -3
  37. package/src/buildRejectOrPreferRuleDefinition.js +1 -3
  38. package/src/exportParser.js +1 -0
  39. package/src/iterateJsdoc.js +3 -7
  40. package/src/jsdocUtils.js +9 -3
  41. package/src/rules/convertToJsdocComments.js +1 -0
  42. package/src/rules/noUndefinedTypes.js +11 -0
  43. package/src/rules/requireFileOverview.js +1 -1
  44. package/src/rules/requireJsdoc.js +1 -0
  45. package/src/rules/requireParam.js +23 -14
@@ -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","params","type","typeAnnotation","parent","id","preferredTagName","getPreferredTagName","tagName","functionParameterNames","getFunctionParameterNames","jsdocParameterNames","getJsdocTagsDeep","shallowJsdocParameterNames","filter","tag","includes","map","checkTypesRegex","getRegexFromString","missingTags","flattenedRoots","flattenRoots","names","paramIndex","hasParamIndex","cur","dropPathSegmentQuotes","String","getParamIndex","setParamIndex","entries","findExpectedIndex","jsdocTags","indexAtFunctionParams","remainingRoots","slice","foundIndex","findIndex","newAdd","some","remainingRoot","Array","isArray","tags","tagLineCount","source","tokens","end","nextRootName","namer","thisOffset","functionParameterIdx","functionParameterName","inc","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) {\n if (node && 'params' in node && node.params.length === 1 &&\n node.params?.[0] && typeof node.params[0] === 'object' &&\n node.params[0].type === 'ObjectPattern' &&\n 'typeAnnotation' in node.params[0] && node.params[0].typeAnnotation\n ) {\n return;\n }\n\n if (node && node.parent.type === 'VariableDeclarator' &&\n 'typeAnnotation' in node.parent.id && node.parent.id.typeAnnotation) {\n return;\n }\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);\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 const remainingRoots = functionParameterNames.slice(indexAtFunctionParams || 0);\n const foundIndex = jsdocTags.findIndex(({\n name,\n newAdd,\n }) => {\n return !newAdd && remainingRoots.some((remainingRoot) => {\n if (Array.isArray(remainingRoot)) {\n return (\n /**\n * @type {import('../jsdocUtils.js').FlattendRootInfo & {\n * annotationParamName?: string|undefined;\n * }}\n */ (remainingRoot[1]).names.includes(name)\n );\n }\n\n if (typeof remainingRoot === 'object') {\n return name === remainingRoot.name;\n }\n\n return name === remainingRoot;\n });\n });\n\n const tags = foundIndex > -1 ?\n jsdocTags.slice(0, foundIndex) :\n jsdocTags.filter(({\n tag,\n }) => {\n return tag === preferredTagName;\n });\n\n let tagLineCount = 0;\n for (const {\n source,\n } of tags) {\n for (const {\n tokens: {\n end,\n },\n } of source) {\n if (!end) {\n tagLineCount++;\n }\n }\n }\n\n return {\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 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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AAE,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","params","type","typeAnnotation","parent","id","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) {\n if (node && 'params' in node && node.params.length === 1 &&\n node.params?.[0] && typeof node.params[0] === 'object' &&\n node.params[0].type === 'ObjectPattern' &&\n 'typeAnnotation' in node.params[0] && node.params[0].typeAnnotation\n ) {\n return;\n }\n\n if (node && node.parent?.type === 'VariableDeclarator' &&\n 'typeAnnotation' in node.parent.id && node.parent.id.typeAnnotation) {\n return;\n }\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);\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 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;AACF,CAAC,KAA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AAK,GAAG,IACxB,CAAC;EACH;AACF,CAAC,EAAE;EACDI,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJvB,WAAW,EAAE,2EAA2E;MACxFwB,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACV5H,iBAAiB,EAAE;UACjBpB,OAAO,EAAE,CAAC;UACVoH,WAAW,EAAE;AACzB,mBAAmB;UACPlF,IAAI,EAAE;QACR,CAAC;QACD+G,iBAAiB,EAAE;UACjBjJ,OAAO,EAAE,IAAI;UACboH,WAAW,EAAE;AACzB,UAAU;UACElF,IAAI,EAAE;QACR,CAAC;QACDb,iBAAiB,EAAE;UACjBrB,OAAO,EAAE,IAAI;UACboH,WAAW,EAAE,iEAAiE;UAC9ElF,IAAI,EAAE;QACR,CAAC;QACDZ,sBAAsB,EAAE;UACtBtB,OAAO,EAAE,IAAI;UACboH,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;UAC1BlF,IAAI,EAAE;QACR,CAAC;QACDgH,YAAY,EAAE;UACZlJ,OAAO,EAAE,KAAK;UACdoH,WAAW,EAAE,4EAA4E;UACzFlF,IAAI,EAAE;QACR,CAAC;QACDX,iBAAiB,EAAE;UACjBvB,OAAO,EAAE,KAAK;UACdoH,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;UACKlF,IAAI,EAAE;QACR,CAAC;QACDiH,YAAY,EAAE;UACZnJ,OAAO,EAAE,KAAK;UACdoH,WAAW,EAAE,4EAA4E;UACzFlF,IAAI,EAAE;QACR,CAAC;QACDV,iBAAiB,EAAE;UACjB4F,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;UACRlF,IAAI,EAAE;QACR,CAAC;QACDkH,QAAQ,EAAE;UACRhC,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;UAClDiC,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEpH,IAAI,EAAE;YACR,CAAC,EACD;cACE6G,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVO,OAAO,EAAE;kBACPrH,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;UACX2F,WAAW,EAAE,kDAAkD;UAC/DlF,IAAI,EAAE;QACR,CAAC;QACDR,sBAAsB,EAAE;UACtB0F,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;UACVlF,IAAI,EAAE;QACR,CAAC;QACDP,eAAe,EAAE;UACfyF,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;UAC1ClF,IAAI,EAAE;QACR,CAAC;QACDsH,UAAU,EAAE;UACVpC,WAAW,EAAE;AACzB;AACA;AACA;AACA,uBAAuB;UACXiC,KAAK,EAAE;YACLnH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDN,0BAA0B,EAAE;UAC1BwF,WAAW,EAAE;AACzB,WAAW;UACClF,IAAI,EAAE;QACR,CAAC;QACDL,2BAA2B,EAAE;UAC3BuF,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA,uBAAuB;UACXlF,IAAI,EAAE;QACR,CAAC;QACDJ,eAAe,EAAE;UACfsF,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;YACLnH,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDH,0BAA0B,EAAE;UAC1BqF,WAAW,EAAE;AACzB,mDAAmD;UACvClF,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR,CAAC;EAED;EACA;EACA;EACAuH,UAAU,EAAE;AACd,CAAC,CAAC;AAAAC,MAAA,CAAA9I,OAAA,GAAAA,OAAA,CAAAZ,OAAA","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- declare const _default: import("@eslint/core").RuleDefinition<import("@eslint/core").RuleDefinitionTypeOptions>;
1
+ declare const _default: import("eslint").Rule.RuleModule;
2
2
  export default _default;
3
3
  //# sourceMappingURL=requireTags.d.ts.map
package/package.json CHANGED
@@ -31,11 +31,11 @@
31
31
  "@babel/preset-env": "^7.28.5",
32
32
  "@es-joy/escodegen": "^4.2.0",
33
33
  "@es-joy/jsdoc-eslint-parser": "^0.25.0",
34
- "@eslint/core": "^0.16.0",
34
+ "@eslint/core": "^0.17.0",
35
35
  "@hkdobrev/run-if-changed": "^0.6.3",
36
36
  "@rollup/plugin-node-resolve": "^16.0.3",
37
37
  "@semantic-release/commit-analyzer": "^13.0.1",
38
- "@semantic-release/github": "^12.0.0",
38
+ "@semantic-release/github": "^12.0.1",
39
39
  "@semantic-release/npm": "^13.1.1",
40
40
  "@types/chai": "^5.2.3",
41
41
  "@types/debug": "^4.1.12",
@@ -44,7 +44,7 @@
44
44
  "@types/estree": "^1.0.8",
45
45
  "@types/json-schema": "^7.0.15",
46
46
  "@types/mocha": "^10.0.10",
47
- "@types/node": "^24.9.1",
47
+ "@types/node": "^24.10.0",
48
48
  "@types/semver": "^7.7.1",
49
49
  "@types/spdx-expression-parse": "^3.0.5",
50
50
  "@typescript-eslint/types": "^8.46.2",
@@ -55,11 +55,11 @@
55
55
  "camelcase": "^8.0.0",
56
56
  "chai": "^6.2.0",
57
57
  "decamelize": "^6.0.1",
58
- "eslint": "9.38.0",
58
+ "eslint": "9.39.0",
59
59
  "eslint-config-canonical": "^45.0.1",
60
60
  "gitdown": "^4.1.1",
61
61
  "glob": "^11.0.3",
62
- "globals": "^16.4.0",
62
+ "globals": "^16.5.0",
63
63
  "husky": "^9.1.7",
64
64
  "jsdoc-type-pratt-parser": "^6.11.0",
65
65
  "json-schema": "^0.4.0",
@@ -69,7 +69,7 @@
69
69
  "open-editor": "^5.1.0",
70
70
  "playwright": "^1.56.1",
71
71
  "replace": "^1.2.2",
72
- "rimraf": "^6.0.1",
72
+ "rimraf": "^6.1.0",
73
73
  "rollup": "^4.52.5",
74
74
  "semantic-release": "^25.0.1",
75
75
  "sinon": "^21.0.0",
@@ -192,5 +192,5 @@
192
192
  "test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
193
193
  "test-index": "pnpm run test-no-cov test/rules/index.js"
194
194
  },
195
- "version": "61.1.10"
195
+ "version": "61.1.12"
196
196
  }
@@ -21,9 +21,7 @@ import iterateJsdoc from './iterateJsdoc.js';
21
21
  * schema?: import('eslint').Rule.RuleMetaData['schema']
22
22
  * url?: string,
23
23
  * }} cfg
24
- * @returns {import('@eslint/core').RuleDefinition<
25
- * import('@eslint/core').RuleDefinitionTypeOptions
26
- * >}
24
+ * @returns {import('eslint').Rule.RuleModule}
27
25
  */
28
26
  export const buildForbidRuleDefinition = ({
29
27
  contextName,
@@ -104,9 +104,7 @@ const infoUC = {
104
104
  * typeName?: string,
105
105
  * url?: string,
106
106
  * }} cfg
107
- * @returns {import('@eslint/core').RuleDefinition<
108
- * import('@eslint/core').RuleDefinitionTypeOptions
109
- * >}
107
+ * @returns {import('eslint').Rule.RuleModule}
110
108
  */
111
109
  export const buildRejectOrPreferRuleDefinition = ({
112
110
  checkNativeTypes = null,
@@ -716,6 +716,7 @@ const ignorableNestedTypes = new Set([
716
716
  * @returns {import('eslint').Rule.Node|false}
717
717
  */
718
718
  const getExportAncestor = function (nde) {
719
+ /** @type {import('eslint').Rule.Node|null} */
719
720
  let node = nde;
720
721
  let idx = 0;
721
722
  const ignorableIfDeep = ignorableNestedTypes.has(nde?.type);
@@ -687,7 +687,7 @@ const getBasicUtils = (context, {
687
687
  /**
688
688
  * @callback Report
689
689
  * @param {string} message
690
- * @param {import('eslint').Rule.ReportFixer|null} [fix]
690
+ * @param {import('@eslint/core').RuleFixer|null} [fix]
691
691
  * @param {null|
692
692
  * {line?: Integer, column?: Integer}|
693
693
  * import('comment-parser').Spec & {line?: Integer}
@@ -2120,9 +2120,7 @@ const getIndentAndJSDoc = function (lines, jsdocNode) {
2120
2120
 
2121
2121
  /**
2122
2122
  *
2123
- * @typedef {{node: Node & {
2124
- * range: [number, number]
2125
- * }, state: StateObject}} NonCommentArgs
2123
+ * @typedef {{node: Node, state: StateObject}} NonCommentArgs
2126
2124
  */
2127
2125
 
2128
2126
  /**
@@ -2312,9 +2310,7 @@ const iterateAllJsdocs = (iterator, ruleConfig, contexts, additiveCommentContext
2312
2310
 
2313
2311
  return {
2314
2312
  /**
2315
- * @param {import('eslint').Rule.Node & {
2316
- * range: [Integer, Integer];
2317
- * }} node
2313
+ * @param {import('eslint').Rule.Node} node
2318
2314
  * @returns {void}
2319
2315
  */
2320
2316
  '*:not(Program)' (node) {
package/src/jsdocUtils.js CHANGED
@@ -1406,7 +1406,7 @@ const hasNonFunctionYield = (node, checkYieldReturnValue) => {
1406
1406
  if (
1407
1407
  /** @type {import('eslint').Rule.Node} */ (
1408
1408
  node
1409
- ).parent.type === 'VariableDeclarator'
1409
+ ).parent?.type === 'VariableDeclarator'
1410
1410
  ) {
1411
1411
  return true;
1412
1412
  }
@@ -1812,11 +1812,17 @@ const exemptSpeciaMethods = (jsdoc, node, context, schema) => {
1812
1812
  ])) ||
1813
1813
  isGetter(node) && (
1814
1814
  !checkGetters ||
1815
- checkGetters === 'no-setter' && hasAccessorPair(/** @type {import('./iterateJsdoc.js').Node} */ (node).parent)
1815
+ checkGetters === 'no-setter' && hasAccessorPair(
1816
+ /** @type {import('./iterateJsdoc.js').Node} */
1817
+ (/** @type {import('./iterateJsdoc.js').Node} */ (node).parent),
1818
+ )
1816
1819
  ) ||
1817
1820
  isSetter(node) && (
1818
1821
  !checkSetters ||
1819
- checkSetters === 'no-getter' && hasAccessorPair(/** @type {import('./iterateJsdoc.js').Node} */ (node).parent)
1822
+ checkSetters === 'no-getter' && hasAccessorPair(
1823
+ /** @type {import('./iterateJsdoc.js').Node} */
1824
+ (/** @type {import('./iterateJsdoc.js').Node} */ (node).parent),
1825
+ )
1820
1826
  );
1821
1827
  };
1822
1828
 
@@ -111,6 +111,7 @@ export default {
111
111
 
112
112
  const decorator = getDecorator(
113
113
  /** @type {import('eslint').Rule.Node} */
114
+ // @ts-expect-error Bug?
114
115
  (baseNode),
115
116
  );
116
117
  if (decorator) {
@@ -466,6 +466,16 @@ export default iterateJsdoc(({
466
466
  return utils.isNamepathOrUrlReferencingTag(tag);
467
467
  }).map(tagToParsedType('namepathOrURL'));
468
468
 
469
+ const definedNamesAndNamepaths = new Set(utils.filterTags(({
470
+ tag,
471
+ }) => {
472
+ return utils.isNameOrNamepathDefiningTag(tag);
473
+ }).map(({
474
+ name,
475
+ }) => {
476
+ return name;
477
+ }));
478
+
469
479
  const tagsWithTypes = /** @type {TypeAndTagInfo[]} */ ([
470
480
  ...typeTags,
471
481
  ...namepathReferencingTags,
@@ -520,6 +530,7 @@ export default iterateJsdoc(({
520
530
  if (type === 'JsdocTypeName') {
521
531
  const structuredTypes = structuredTags[tag.tag]?.type;
522
532
  if (!allDefinedTypes.has(val) &&
533
+ !definedNamesAndNamepaths.has(val) &&
523
534
  (!Array.isArray(structuredTypes) || !structuredTypes.includes(val))
524
535
  ) {
525
536
  const parent =
@@ -207,7 +207,7 @@ will be checked, but you must use \`file\` on the configuration object).`,
207
207
  state,
208
208
  }) {
209
209
  if (!state.hasNonComment) {
210
- state.hasNonComment = node.range[0];
210
+ state.hasNonComment = /** @type {[number, number]} */ (node.range)?.[0];
211
211
  }
212
212
  },
213
213
  });
@@ -670,6 +670,7 @@ export default {
670
670
 
671
671
  const decorator = getDecorator(
672
672
  /** @type {import('eslint').Rule.Node} */
673
+ // @ts-expect-error Bug?
673
674
  (baseNode),
674
675
  );
675
676
  if (decorator) {
@@ -74,7 +74,7 @@ export default iterateJsdoc(({
74
74
  return;
75
75
  }
76
76
 
77
- if (node && node.parent.type === 'VariableDeclarator' &&
77
+ if (node && node.parent?.type === 'VariableDeclarator' &&
78
78
  'typeAnnotation' in node.parent.id && node.parent.id.typeAnnotation) {
79
79
  return;
80
80
  }
@@ -181,27 +181,36 @@ export default iterateJsdoc(({
181
181
  * }}
182
182
  */
183
183
  const findExpectedIndex = (jsdocTags, indexAtFunctionParams) => {
184
- const remainingRoots = functionParameterNames.slice(indexAtFunctionParams || 0);
184
+ // Get the parameters that come after the current index in the flattened order
185
+ const remainingFlattenedRoots = flattenedRoots.slice((indexAtFunctionParams || 0) + 1);
186
+
187
+ // Find the first existing tag that comes after the current parameter in the flattened order
185
188
  const foundIndex = jsdocTags.findIndex(({
186
189
  name,
187
190
  newAdd,
188
191
  }) => {
189
- return !newAdd && remainingRoots.some((remainingRoot) => {
190
- if (Array.isArray(remainingRoot)) {
191
- return (
192
- /**
193
- * @type {import('../jsdocUtils.js').FlattendRootInfo & {
194
- * annotationParamName?: string|undefined;
195
- * }}
196
- */ (remainingRoot[1]).names.includes(name)
197
- );
192
+ if (newAdd) {
193
+ return false;
194
+ }
195
+
196
+ // Check if the tag name matches any of the remaining flattened roots
197
+ return remainingFlattenedRoots.some((flattenedRoot) => {
198
+ // The flattened roots don't have the root prefix (e.g., "bar", "bar.baz")
199
+ // but JSDoc tags do (e.g., "root0", "root0.bar", "root0.bar.baz")
200
+ // So we need to check if the tag name ends with the flattened root
201
+
202
+ // Check if tag name ends with ".<flattenedRoot>"
203
+ if (name.endsWith(`.${flattenedRoot}`)) {
204
+ return true;
198
205
  }
199
206
 
200
- if (typeof remainingRoot === 'object') {
201
- return name === remainingRoot.name;
207
+ // Also check if tag name exactly matches the flattenedRoot
208
+ // (for single-level params)
209
+ if (name === flattenedRoot) {
210
+ return true;
202
211
  }
203
212
 
204
- return name === remainingRoot;
213
+ return false;
205
214
  });
206
215
  });
207
216