eslint-plugin-jsdoc 61.1.12 → 61.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/iterateJsdoc.d.ts +2 -2
- package/dist/cjs/jsdocUtils.d.ts +2 -1
- package/dist/iterateJsdoc.cjs +9 -4
- package/dist/iterateJsdoc.cjs.map +1 -1
- package/dist/iterateJsdoc.d.ts +2 -2
- package/dist/jsdocUtils.cjs +11 -1
- package/dist/jsdocUtils.cjs.map +1 -1
- package/dist/jsdocUtils.d.ts +2 -1
- package/dist/rules/requireParam.cjs +3 -8
- package/dist/rules/requireParam.cjs.map +1 -1
- package/dist/rules/sortTags.cjs +13 -1
- package/dist/rules/sortTags.cjs.map +1 -1
- package/dist/rules/tagLines.cjs +10 -9
- package/dist/rules/tagLines.cjs.map +1 -1
- package/dist/rules.d.ts +10 -0
- package/dist/to-valid-identifier.cjs +3 -1
- package/package.json +1 -1
- package/src/iterateJsdoc.js +9 -3
- package/src/jsdocUtils.js +15 -1
- package/src/rules/requireParam.js +5 -14
- package/src/rules/sortTags.js +13 -1
- package/src/rules/tagLines.js +13 -9
- package/src/rules.d.ts +10 -0
|
@@ -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","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,CAA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iB,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
|
+
{"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 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,MAA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BAAiB,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":[]}
|
package/dist/rules/sortTags.cjs
CHANGED
|
@@ -11,11 +11,13 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
11
11
|
context,
|
|
12
12
|
jsdoc,
|
|
13
13
|
utils
|
|
14
|
+
// eslint-disable-next-line complexity -- Temporary
|
|
14
15
|
}) => {
|
|
15
16
|
const
|
|
16
17
|
/**
|
|
17
18
|
* @type {{
|
|
18
19
|
* linesBetween: import('../iterateJsdoc.js').Integer,
|
|
20
|
+
* tagExceptions: Record<string, number>,
|
|
19
21
|
* tagSequence: {
|
|
20
22
|
* tags: string[]
|
|
21
23
|
* }[],
|
|
@@ -29,6 +31,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
29
31
|
linesBetween = 1,
|
|
30
32
|
reportIntraTagGroupSpacing = true,
|
|
31
33
|
reportTagGroupSpacing = true,
|
|
34
|
+
tagExceptions = {},
|
|
32
35
|
tagSequence = _defaultTagOrder.default
|
|
33
36
|
} = context.options[0] || {};
|
|
34
37
|
const tagList = tagSequence.flatMap(obj => {
|
|
@@ -274,7 +277,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
274
277
|
continue;
|
|
275
278
|
}
|
|
276
279
|
const ct = countTagEmptyLines(tag);
|
|
277
|
-
if (ct) {
|
|
280
|
+
if (ct && (!tagExceptions[tag.tag] || tagExceptions[tag.tag] < ct)) {
|
|
278
281
|
const fixer = () => {
|
|
279
282
|
let foundFirstTag = false;
|
|
280
283
|
|
|
@@ -437,6 +440,15 @@ will not have spacing applied regardless. For adding line breaks there, you
|
|
|
437
440
|
may wish to use the \`endLines\` option of the \`tag-lines\` rule.`,
|
|
438
441
|
type: 'boolean'
|
|
439
442
|
},
|
|
443
|
+
tagExceptions: {
|
|
444
|
+
description: 'Allows specification by tag of a specific higher maximum number of lines. Keys are tags and values are the maximum number of lines allowed for such tags. Overrides `linesBetween`. Defaults to no special exceptions per tag.',
|
|
445
|
+
patternProperties: {
|
|
446
|
+
'.*': {
|
|
447
|
+
type: 'number'
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
type: 'object'
|
|
451
|
+
},
|
|
440
452
|
tagSequence: {
|
|
441
453
|
description: `An array of tag group objects indicating the preferred sequence for sorting tags.
|
|
442
454
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortTags.cjs","names":["_defaultTagOrder","_interopRequireDefault","require","_iterateJsdoc","e","__esModule","default","_default","exports","iterateJsdoc","context","jsdoc","utils","alphabetizeExtras","linesBetween","reportIntraTagGroupSpacing","reportTagGroupSpacing","tagSequence","defaultTagOrder","options","tagList","flatMap","obj","tags","otherPos","indexOf","endPos","length","ongoingCount","idx","tag","entries","originalIndex","source","originalLine","firstChangedTagLine","firstChangedTagIndex","sortedTags","JSON","parse","stringify","sort","tagNew","tagOld","checkOrSetFirstChanged","newPos","oldPos","preferredNewPos","preferredOldPos","undefined","lastTagsOfGroup","badLastTagsOfGroup","countTagEmptyLines","reduce","acc","tokens","description","end","name","tg","type","empty","Number","innerIdx","currentTag","lastTag","includes","some","tgs","push","ct","fixer","currIdx","newIdx","emptyLine","number","seedTokens","delimiter","start","existingEmptyLines","nextTokens","lineDiff","lines","Array","from","splice","srcIdx","src","reportJSDoc","tagIdx","foundFirstTag","nextIdx","ignore","lastTagOfGroup","firstLine","getFirstLine","fix","itemsToMoveRange","keys","unchangedPriorTagDescriptions","slice","initialOffset","removeTag","changedTags","extraTagCount","changedTag","addTag","addLine","join","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","items","module"],"sources":["../../src/rules/sortTags.js"],"sourcesContent":["import defaultTagOrder from '../defaultTagOrder.js';\nimport iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const\n /**\n * @type {{\n * linesBetween: import('../iterateJsdoc.js').Integer,\n * tagSequence: {\n * tags: string[]\n * }[],\n * alphabetizeExtras: boolean,\n * reportTagGroupSpacing: boolean,\n * reportIntraTagGroupSpacing: boolean,\n * }}\n */ {\n alphabetizeExtras = false,\n linesBetween = 1,\n reportIntraTagGroupSpacing = true,\n reportTagGroupSpacing = true,\n tagSequence = defaultTagOrder,\n } = context.options[0] || {};\n\n const tagList = tagSequence.flatMap((obj) => {\n /* typeof obj === 'string' ? obj : */\n return obj.tags;\n });\n\n const otherPos = tagList.indexOf('-other');\n const endPos = otherPos > -1 ? otherPos : tagList.length;\n\n let ongoingCount = 0;\n for (const [\n idx,\n tag,\n ] of\n /**\n * @type {(\n * import('@es-joy/jsdoccomment').JsdocTagWithInline & {\n * originalIndex: import('../iterateJsdoc.js').Integer,\n * originalLine: import('../iterateJsdoc.js').Integer,\n * }\n * )[]}\n */ (jsdoc.tags).entries()) {\n tag.originalIndex = idx;\n ongoingCount += tag.source.length;\n tag.originalLine = ongoingCount;\n }\n\n /** @type {import('../iterateJsdoc.js').Integer|undefined} */\n let firstChangedTagLine;\n /** @type {import('../iterateJsdoc.js').Integer|undefined} */\n let firstChangedTagIndex;\n\n /**\n * @type {(import('comment-parser').Spec & {\n * originalIndex: import('../iterateJsdoc.js').Integer,\n * originalLine: import('../iterateJsdoc.js').Integer,\n * })[]}\n */\n const sortedTags = JSON.parse(JSON.stringify(jsdoc.tags));\n sortedTags.sort(({\n tag: tagNew,\n }, {\n originalIndex,\n originalLine,\n tag: tagOld,\n }) => {\n // Optimize: Just keep relative positions if the same tag name\n if (tagNew === tagOld) {\n return 0;\n }\n\n const checkOrSetFirstChanged = () => {\n if (!firstChangedTagLine || originalLine < firstChangedTagLine) {\n firstChangedTagLine = originalLine;\n firstChangedTagIndex = originalIndex;\n }\n };\n\n const newPos = tagList.indexOf(tagNew);\n const oldPos = tagList.indexOf(tagOld);\n\n const preferredNewPos = newPos === -1 ? endPos : newPos;\n const preferredOldPos = oldPos === -1 ? endPos : oldPos;\n\n if (preferredNewPos < preferredOldPos) {\n checkOrSetFirstChanged();\n return -1;\n }\n\n if (preferredNewPos > preferredOldPos) {\n return 1;\n }\n\n // preferredNewPos === preferredOldPos\n if (\n !alphabetizeExtras ||\n\n // Optimize: If tagNew (or tagOld which is the same) was found in the\n // priority array, it can maintain its relative position—without need\n // of alphabetizing (secondary sorting)\n newPos >= 0\n ) {\n return 0;\n }\n\n if (tagNew < tagOld) {\n checkOrSetFirstChanged();\n return -1;\n }\n\n // tagNew > tagOld\n return 1;\n });\n\n if (firstChangedTagLine === undefined) {\n // Should be ordered by now\n\n /**\n * @type {import('comment-parser').Spec[]}\n */\n const lastTagsOfGroup = [];\n\n /**\n * @type {[\n * import('comment-parser').Spec,\n * import('../iterateJsdoc.js').Integer\n * ][]}\n */\n const badLastTagsOfGroup = [];\n\n /**\n * @param {import('comment-parser').Spec} tag\n */\n const countTagEmptyLines = (tag) => {\n return tag.source.reduce((acc, {\n tokens: {\n description,\n end,\n name,\n tag: tg,\n type,\n },\n }) => {\n const empty = !tg && !type && !name && !description;\n // Reset the count so long as there is content\n return empty ? acc + Number(empty && !end) : 0;\n }, 0);\n };\n\n let idx = 0;\n for (const {\n tags,\n } of tagSequence) {\n let innerIdx;\n /** @type {import('comment-parser').Spec} */\n let currentTag;\n /** @type {import('comment-parser').Spec|undefined} */\n let lastTag;\n do {\n currentTag = jsdoc.tags[idx];\n if (!currentTag) {\n idx++;\n break;\n }\n\n innerIdx = tags.indexOf(currentTag.tag);\n\n if (\n innerIdx === -1 &&\n // eslint-disable-next-line no-loop-func -- Safe\n (!tags.includes('-other') || tagSequence.some(({\n tags: tgs,\n }) => {\n return tgs.includes(currentTag.tag);\n }))\n ) {\n idx++;\n break;\n }\n\n lastTag = currentTag;\n\n idx++;\n } while (true);\n\n idx--;\n\n if (lastTag) {\n lastTagsOfGroup.push(lastTag);\n const ct = countTagEmptyLines(lastTag);\n if (\n ct !== linesBetween &&\n // Use another rule for adding to end (should be of interest outside this rule)\n jsdoc.tags[idx]\n ) {\n badLastTagsOfGroup.push([\n lastTag, ct,\n ]);\n }\n }\n }\n\n if (reportTagGroupSpacing && badLastTagsOfGroup.length) {\n /**\n * @param {import('comment-parser').Spec} tg\n * @returns {() => void}\n */\n const fixer = (tg) => {\n return () => {\n // Due to https://github.com/syavorsky/comment-parser/issues/110 ,\n // we have to modify `jsdoc.source` rather than just modify tags\n // directly\n for (const [\n currIdx,\n {\n tokens,\n },\n ] of jsdoc.source.entries()) {\n if (tokens.tag !== '@' + tg.tag) {\n continue;\n }\n\n // Cannot be `tokens.end`, as dropped off last tag, so safe to\n // go on\n let newIdx = currIdx;\n\n const emptyLine = () => {\n return {\n number: 0,\n source: '',\n tokens: utils.seedTokens({\n delimiter: '*',\n start: jsdoc.source[newIdx - 1].tokens.start,\n }),\n };\n };\n\n let existingEmptyLines = 0;\n while (true) {\n const nextTokens = jsdoc.source[++newIdx]?.tokens;\n\n /* c8 ignore next 3 -- Guard */\n if (!nextTokens) {\n return;\n }\n\n // Should be no `nextTokens.end` to worry about since ignored\n // if not followed by tag\n\n if (nextTokens.tag) {\n // Haven't made it to last tag instance yet, so keep looking\n if (nextTokens.tag === tokens.tag) {\n existingEmptyLines = 0;\n continue;\n }\n\n const lineDiff = linesBetween - existingEmptyLines;\n if (lineDiff > 0) {\n const lines = Array.from({\n length: lineDiff,\n }, () => {\n return emptyLine();\n });\n jsdoc.source.splice(newIdx, 0, ...lines);\n } else {\n // lineDiff < 0\n jsdoc.source.splice(\n newIdx + lineDiff,\n -lineDiff,\n );\n }\n\n break;\n }\n\n const empty = !nextTokens.type && !nextTokens.name &&\n !nextTokens.description;\n\n if (empty) {\n existingEmptyLines++;\n } else {\n // Has content again, so reset empty line count\n existingEmptyLines = 0;\n }\n }\n\n break;\n }\n\n for (const [\n srcIdx,\n src,\n ] of jsdoc.source.entries()) {\n src.number = srcIdx;\n }\n };\n };\n\n for (const [\n tg,\n ] of badLastTagsOfGroup) {\n utils.reportJSDoc(\n 'Tag groups do not have the expected whitespace',\n tg,\n fixer(tg),\n );\n }\n\n return;\n }\n\n if (!reportIntraTagGroupSpacing) {\n return;\n }\n\n for (const [\n tagIdx,\n tag,\n ] of jsdoc.tags.entries()) {\n if (!jsdoc.tags[tagIdx + 1] || lastTagsOfGroup.includes(tag)) {\n continue;\n }\n\n const ct = countTagEmptyLines(tag);\n if (ct) {\n const fixer = () => {\n let foundFirstTag = false;\n\n /** @type {string|undefined} */\n let currentTag;\n\n for (const [\n currIdx,\n {\n tokens: {\n description,\n end,\n name,\n tag: tg,\n type,\n },\n },\n ] of jsdoc.source.entries()) {\n if (tg) {\n foundFirstTag = true;\n currentTag = tg;\n }\n\n if (!foundFirstTag) {\n continue;\n }\n\n if (currentTag && !tg && !type && !name && !description && !end) {\n let nextIdx = currIdx;\n\n let ignore = true;\n // Even if a tag of the same name as the last tags in a group,\n // could still be an earlier tag in that group\n\n // eslint-disable-next-line no-loop-func -- Safe\n if (lastTagsOfGroup.some((lastTagOfGroup) => {\n return currentTag === '@' + lastTagOfGroup.tag;\n })) {\n while (true) {\n const nextTokens = jsdoc.source[++nextIdx]?.tokens;\n if (!nextTokens) {\n break;\n }\n\n if (!nextTokens.tag) {\n continue;\n }\n\n // Followed by the same tag name, so not actually last in group,\n // and of interest\n if (nextTokens.tag === currentTag) {\n ignore = false;\n }\n }\n } else {\n while (true) {\n const nextTokens = jsdoc.source[++nextIdx]?.tokens;\n if (!nextTokens || nextTokens.end) {\n break;\n }\n\n // Not the very last tag, so don't ignore\n if (nextTokens.tag) {\n ignore = false;\n break;\n }\n }\n }\n\n if (!ignore) {\n jsdoc.source.splice(currIdx, 1);\n for (const [\n srcIdx,\n src,\n ] of jsdoc.source.entries()) {\n src.number = srcIdx;\n }\n }\n }\n }\n };\n\n utils.reportJSDoc(\n 'Intra-group tags have unexpected whitespace',\n tag,\n fixer,\n );\n }\n }\n\n return;\n }\n\n const firstLine = utils.getFirstLine();\n\n const fix = () => {\n const itemsToMoveRange = [\n ...Array.from({\n length: jsdoc.tags.length -\n /** @type {import('../iterateJsdoc.js').Integer} */ (\n firstChangedTagIndex\n ),\n }).keys(),\n ];\n\n const unchangedPriorTagDescriptions = jsdoc.tags.slice(\n 0,\n firstChangedTagIndex,\n ).reduce((ct, {\n source,\n }) => {\n return ct + source.length - 1;\n }, 0);\n\n // This offset includes not only the offset from where the first tag\n // must begin, and the additional offset of where the first changed\n // tag begins, but it must also account for prior descriptions\n const initialOffset = /** @type {import('../iterateJsdoc.js').Integer} */ (\n firstLine\n ) + /** @type {import('../iterateJsdoc.js').Integer} */ (firstChangedTagIndex) +\n\n // May be the first tag, so don't try finding a prior one if so\n unchangedPriorTagDescriptions;\n\n // Use `firstChangedTagLine` for line number to begin reporting/splicing\n for (const idx of itemsToMoveRange) {\n utils.removeTag(\n idx +\n /** @type {import('../iterateJsdoc.js').Integer} */ (\n firstChangedTagIndex\n ),\n );\n }\n\n const changedTags = sortedTags.slice(firstChangedTagIndex);\n let extraTagCount = 0;\n\n for (const idx of itemsToMoveRange) {\n const changedTag = changedTags[idx];\n\n utils.addTag(\n changedTag.tag,\n extraTagCount + initialOffset + idx,\n {\n ...changedTag.source[0].tokens,\n\n // `comment-parser` puts the `end` within the `tags` section, so\n // avoid adding another to jsdoc.source\n end: '',\n },\n );\n\n for (const {\n tokens,\n } of changedTag.source.slice(1)) {\n if (!tokens.end) {\n utils.addLine(\n extraTagCount + initialOffset + idx + 1,\n {\n ...tokens,\n end: '',\n },\n );\n extraTagCount++;\n }\n }\n }\n };\n\n utils.reportJSDoc(\n `Tags are not in the prescribed order: ${\n tagList.join(', ') || '(alphabetical)'\n }`,\n jsdoc.tags[/** @type {import('../iterateJsdoc.js').Integer} */ (\n firstChangedTagIndex\n )],\n fix,\n true,\n );\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/sort-tags.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n alphabetizeExtras: {\n description: `Defaults to \\`false\\`. Alphabetizes any items not within \\`tagSequence\\` after any\nitems within \\`tagSequence\\` (or in place of the special \\`-other\\` pseudo-tag)\nare sorted.\n\nIf you want all your tags alphabetized, you can supply an empty array for\n\\`tagSequence\\` along with setting this option to \\`true\\`.`,\n type: 'boolean',\n },\n linesBetween: {\n description: `Indicates the number of lines to be added between tag groups. Defaults to 1.\nDo not set to 0 or 2+ if you are using \\`tag-lines\\` and \\`\"always\"\\` and do not\nset to 1+ if you are using \\`tag-lines\\` and \\`\"never\"\\`.`,\n type: 'integer',\n },\n reportIntraTagGroupSpacing: {\n description: `Whether to enable reporting and fixing of line breaks within tags of a given\ntag group. Defaults to \\`true\\` which will remove any line breaks at the end of\nsuch tags. Do not use with \\`true\\` if you are using \\`tag-lines\\` and \\`always\\`.`,\n type: 'boolean',\n },\n reportTagGroupSpacing: {\n description: `Whether to enable reporting and fixing of line breaks between tag groups\nas set by \\`linesBetween\\`. Defaults to \\`true\\`. Note that the very last tag\nwill not have spacing applied regardless. For adding line breaks there, you\nmay wish to use the \\`endLines\\` option of the \\`tag-lines\\` rule.`,\n type: 'boolean',\n },\n tagSequence: {\n description: `An array of tag group objects indicating the preferred sequence for sorting tags.\n\nEach item in the array should be an object with a \\`tags\\` property set to an array\nof tag names.\n\nTag names earlier in the list will be arranged first. The relative position of\ntags of the same name will not be changed.\n\nEarlier groups will also be arranged before later groups, but with the added\nfeature that additional line breaks may be added between (or before or after)\nsuch groups (depending on the setting of \\`linesBetween\\`).\n\nTag names not in the list will be grouped together at the end. The pseudo-tag\n\\`-other\\` can be used to place them anywhere else if desired. The tags will be\nplaced in their order of appearance, or alphabetized if \\`alphabetizeExtras\\`\nis enabled, see more below about that option.\n\nDefaults to the array below (noting that it is just a single tag group with\nno lines between groups by default).\n\nPlease note that this order is still experimental, so if you want to retain\na fixed order that doesn't change into the future, supply your own\n\\`tagSequence\\`.\n\n\\`\\`\\`js\n[{tags: [\n // Brief descriptions\n 'summary',\n 'typeSummary',\n\n // Module/file-level\n 'module',\n 'exports',\n 'file',\n 'fileoverview',\n 'overview',\n 'import',\n\n // Identifying (name, type)\n 'typedef',\n 'interface',\n 'record',\n 'template',\n 'name',\n 'kind',\n 'type',\n 'alias',\n 'external',\n 'host',\n 'callback',\n 'func',\n 'function',\n 'method',\n 'class',\n 'constructor',\n\n // Relationships\n 'modifies',\n 'mixes',\n 'mixin',\n 'mixinClass',\n 'mixinFunction',\n 'namespace',\n 'borrows',\n 'constructs',\n 'lends',\n 'implements',\n 'requires',\n\n // Long descriptions\n 'desc',\n 'description',\n 'classdesc',\n 'tutorial',\n 'copyright',\n 'license',\n\n // Simple annotations\n 'const',\n 'constant',\n 'final',\n 'global',\n 'readonly',\n 'abstract',\n 'virtual',\n 'var',\n 'member',\n 'memberof',\n 'memberof!',\n 'inner',\n 'instance',\n 'inheritdoc',\n 'inheritDoc',\n 'override',\n 'hideconstructor',\n\n // Core function/object info\n 'param',\n 'arg',\n 'argument',\n 'prop',\n 'property',\n 'return',\n 'returns',\n\n // Important behavior details\n 'async',\n 'generator',\n 'default',\n 'defaultvalue',\n 'enum',\n 'augments',\n 'extends',\n 'throws',\n 'exception',\n 'yield',\n 'yields',\n 'event',\n 'fires',\n 'emits',\n 'listens',\n 'this',\n\n // Access\n 'static',\n 'private',\n 'protected',\n 'public',\n 'access',\n 'package',\n\n '-other',\n\n // Supplementary descriptions\n 'see',\n 'example',\n\n // METADATA\n\n // Other Closure (undocumented) metadata\n 'closurePrimitive',\n 'customElement',\n 'expose',\n 'hidden',\n 'idGenerator',\n 'meaning',\n 'ngInject',\n 'owner',\n 'wizaction',\n\n // Other Closure (documented) metadata\n 'define',\n 'dict',\n 'export',\n 'externs',\n 'implicitCast',\n 'noalias',\n 'nocollapse',\n 'nocompile',\n 'noinline',\n 'nosideeffects',\n 'polymer',\n 'polymerBehavior',\n 'preserve',\n 'struct',\n 'suppress',\n 'unrestricted',\n\n // @homer0/prettier-plugin-jsdoc metadata\n 'category',\n\n // Non-Closure metadata\n 'ignore',\n 'author',\n 'version',\n 'variation',\n 'since',\n 'deprecated',\n 'todo',\n]}];\n\\`\\`\\``,\n items: {\n additionalProperties: false,\n properties: {\n tags: {\n description: 'See description on `tagSequence`.',\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,O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,CAAC;AACH,CAAC,EAAE;EACDa,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJvD,WAAW,EAAE,6GAA6G;MAC1HwD,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVvG,iBAAiB,EAAE;UACjB2C,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA,4DAA4D;UAChDI,IAAI,EAAE;QACR,CAAC;QACD9C,YAAY,EAAE;UACZ0C,WAAW,EAAE;AACzB;AACA,0DAA0D;UAC9CI,IAAI,EAAE;QACR,CAAC;QACD7C,0BAA0B,EAAE;UAC1ByC,WAAW,EAAE;AACzB;AACA,mFAAmF;UACvEI,IAAI,EAAE;QACR,CAAC;QACD5C,qBAAqB,EAAE;UACrBwC,WAAW,EAAE;AACzB;AACA;AACA,mEAAmE;UACvDI,IAAI,EAAE;QACR,CAAC;QACD3C,WAAW,EAAE;UACXuC,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;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;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;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;UACK6D,KAAK,EAAE;YACLF,oBAAoB,EAAE,KAAK;YAC3BC,UAAU,EAAE;cACV7F,IAAI,EAAE;gBACJiC,WAAW,EAAE,mCAAmC;gBAChD6D,KAAK,EAAE;kBACLzD,IAAI,EAAE;gBACR,CAAC;gBACDA,IAAI,EAAE;cACR;YACF,CAAC;YACDA,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA0D,MAAA,CAAA9G,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"sortTags.cjs","names":["_defaultTagOrder","_interopRequireDefault","require","_iterateJsdoc","e","__esModule","default","_default","exports","iterateJsdoc","context","jsdoc","utils","alphabetizeExtras","linesBetween","reportIntraTagGroupSpacing","reportTagGroupSpacing","tagExceptions","tagSequence","defaultTagOrder","options","tagList","flatMap","obj","tags","otherPos","indexOf","endPos","length","ongoingCount","idx","tag","entries","originalIndex","source","originalLine","firstChangedTagLine","firstChangedTagIndex","sortedTags","JSON","parse","stringify","sort","tagNew","tagOld","checkOrSetFirstChanged","newPos","oldPos","preferredNewPos","preferredOldPos","undefined","lastTagsOfGroup","badLastTagsOfGroup","countTagEmptyLines","reduce","acc","tokens","description","end","name","tg","type","empty","Number","innerIdx","currentTag","lastTag","includes","some","tgs","push","ct","fixer","currIdx","newIdx","emptyLine","number","seedTokens","delimiter","start","existingEmptyLines","nextTokens","lineDiff","lines","Array","from","splice","srcIdx","src","reportJSDoc","tagIdx","foundFirstTag","nextIdx","ignore","lastTagOfGroup","firstLine","getFirstLine","fix","itemsToMoveRange","keys","unchangedPriorTagDescriptions","slice","initialOffset","removeTag","changedTags","extraTagCount","changedTag","addTag","addLine","join","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","patternProperties","items","module"],"sources":["../../src/rules/sortTags.js"],"sourcesContent":["import defaultTagOrder from '../defaultTagOrder.js';\nimport iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n// eslint-disable-next-line complexity -- Temporary\n}) => {\n const\n /**\n * @type {{\n * linesBetween: import('../iterateJsdoc.js').Integer,\n * tagExceptions: Record<string, number>,\n * tagSequence: {\n * tags: string[]\n * }[],\n * alphabetizeExtras: boolean,\n * reportTagGroupSpacing: boolean,\n * reportIntraTagGroupSpacing: boolean,\n * }}\n */ {\n alphabetizeExtras = false,\n linesBetween = 1,\n reportIntraTagGroupSpacing = true,\n reportTagGroupSpacing = true,\n tagExceptions = {},\n tagSequence = defaultTagOrder,\n } = context.options[0] || {};\n\n const tagList = tagSequence.flatMap((obj) => {\n /* typeof obj === 'string' ? obj : */\n return obj.tags;\n });\n\n const otherPos = tagList.indexOf('-other');\n const endPos = otherPos > -1 ? otherPos : tagList.length;\n\n let ongoingCount = 0;\n for (const [\n idx,\n tag,\n ] of\n /**\n * @type {(\n * import('@es-joy/jsdoccomment').JsdocTagWithInline & {\n * originalIndex: import('../iterateJsdoc.js').Integer,\n * originalLine: import('../iterateJsdoc.js').Integer,\n * }\n * )[]}\n */ (jsdoc.tags).entries()) {\n tag.originalIndex = idx;\n ongoingCount += tag.source.length;\n tag.originalLine = ongoingCount;\n }\n\n /** @type {import('../iterateJsdoc.js').Integer|undefined} */\n let firstChangedTagLine;\n /** @type {import('../iterateJsdoc.js').Integer|undefined} */\n let firstChangedTagIndex;\n\n /**\n * @type {(import('comment-parser').Spec & {\n * originalIndex: import('../iterateJsdoc.js').Integer,\n * originalLine: import('../iterateJsdoc.js').Integer,\n * })[]}\n */\n const sortedTags = JSON.parse(JSON.stringify(jsdoc.tags));\n sortedTags.sort(({\n tag: tagNew,\n }, {\n originalIndex,\n originalLine,\n tag: tagOld,\n }) => {\n // Optimize: Just keep relative positions if the same tag name\n if (tagNew === tagOld) {\n return 0;\n }\n\n const checkOrSetFirstChanged = () => {\n if (!firstChangedTagLine || originalLine < firstChangedTagLine) {\n firstChangedTagLine = originalLine;\n firstChangedTagIndex = originalIndex;\n }\n };\n\n const newPos = tagList.indexOf(tagNew);\n const oldPos = tagList.indexOf(tagOld);\n\n const preferredNewPos = newPos === -1 ? endPos : newPos;\n const preferredOldPos = oldPos === -1 ? endPos : oldPos;\n\n if (preferredNewPos < preferredOldPos) {\n checkOrSetFirstChanged();\n return -1;\n }\n\n if (preferredNewPos > preferredOldPos) {\n return 1;\n }\n\n // preferredNewPos === preferredOldPos\n if (\n !alphabetizeExtras ||\n\n // Optimize: If tagNew (or tagOld which is the same) was found in the\n // priority array, it can maintain its relative position—without need\n // of alphabetizing (secondary sorting)\n newPos >= 0\n ) {\n return 0;\n }\n\n if (tagNew < tagOld) {\n checkOrSetFirstChanged();\n return -1;\n }\n\n // tagNew > tagOld\n return 1;\n });\n\n if (firstChangedTagLine === undefined) {\n // Should be ordered by now\n\n /**\n * @type {import('comment-parser').Spec[]}\n */\n const lastTagsOfGroup = [];\n\n /**\n * @type {[\n * import('comment-parser').Spec,\n * import('../iterateJsdoc.js').Integer\n * ][]}\n */\n const badLastTagsOfGroup = [];\n\n /**\n * @param {import('comment-parser').Spec} tag\n */\n const countTagEmptyLines = (tag) => {\n return tag.source.reduce((acc, {\n tokens: {\n description,\n end,\n name,\n tag: tg,\n type,\n },\n }) => {\n const empty = !tg && !type && !name && !description;\n // Reset the count so long as there is content\n return empty ? acc + Number(empty && !end) : 0;\n }, 0);\n };\n\n let idx = 0;\n for (const {\n tags,\n } of tagSequence) {\n let innerIdx;\n /** @type {import('comment-parser').Spec} */\n let currentTag;\n /** @type {import('comment-parser').Spec|undefined} */\n let lastTag;\n do {\n currentTag = jsdoc.tags[idx];\n if (!currentTag) {\n idx++;\n break;\n }\n\n innerIdx = tags.indexOf(currentTag.tag);\n\n if (\n innerIdx === -1 &&\n // eslint-disable-next-line no-loop-func -- Safe\n (!tags.includes('-other') || tagSequence.some(({\n tags: tgs,\n }) => {\n return tgs.includes(currentTag.tag);\n }))\n ) {\n idx++;\n break;\n }\n\n lastTag = currentTag;\n\n idx++;\n } while (true);\n\n idx--;\n\n if (lastTag) {\n lastTagsOfGroup.push(lastTag);\n const ct = countTagEmptyLines(lastTag);\n if (\n ct !== linesBetween &&\n // Use another rule for adding to end (should be of interest outside this rule)\n jsdoc.tags[idx]\n ) {\n badLastTagsOfGroup.push([\n lastTag, ct,\n ]);\n }\n }\n }\n\n if (reportTagGroupSpacing && badLastTagsOfGroup.length) {\n /**\n * @param {import('comment-parser').Spec} tg\n * @returns {() => void}\n */\n const fixer = (tg) => {\n return () => {\n // Due to https://github.com/syavorsky/comment-parser/issues/110 ,\n // we have to modify `jsdoc.source` rather than just modify tags\n // directly\n for (const [\n currIdx,\n {\n tokens,\n },\n ] of jsdoc.source.entries()) {\n if (tokens.tag !== '@' + tg.tag) {\n continue;\n }\n\n // Cannot be `tokens.end`, as dropped off last tag, so safe to\n // go on\n let newIdx = currIdx;\n\n const emptyLine = () => {\n return {\n number: 0,\n source: '',\n tokens: utils.seedTokens({\n delimiter: '*',\n start: jsdoc.source[newIdx - 1].tokens.start,\n }),\n };\n };\n\n let existingEmptyLines = 0;\n while (true) {\n const nextTokens = jsdoc.source[++newIdx]?.tokens;\n\n /* c8 ignore next 3 -- Guard */\n if (!nextTokens) {\n return;\n }\n\n // Should be no `nextTokens.end` to worry about since ignored\n // if not followed by tag\n\n if (nextTokens.tag) {\n // Haven't made it to last tag instance yet, so keep looking\n if (nextTokens.tag === tokens.tag) {\n existingEmptyLines = 0;\n continue;\n }\n\n const lineDiff = linesBetween - existingEmptyLines;\n if (lineDiff > 0) {\n const lines = Array.from({\n length: lineDiff,\n }, () => {\n return emptyLine();\n });\n jsdoc.source.splice(newIdx, 0, ...lines);\n } else {\n // lineDiff < 0\n jsdoc.source.splice(\n newIdx + lineDiff,\n -lineDiff,\n );\n }\n\n break;\n }\n\n const empty = !nextTokens.type && !nextTokens.name &&\n !nextTokens.description;\n\n if (empty) {\n existingEmptyLines++;\n } else {\n // Has content again, so reset empty line count\n existingEmptyLines = 0;\n }\n }\n\n break;\n }\n\n for (const [\n srcIdx,\n src,\n ] of jsdoc.source.entries()) {\n src.number = srcIdx;\n }\n };\n };\n\n for (const [\n tg,\n ] of badLastTagsOfGroup) {\n utils.reportJSDoc(\n 'Tag groups do not have the expected whitespace',\n tg,\n fixer(tg),\n );\n }\n\n return;\n }\n\n if (!reportIntraTagGroupSpacing) {\n return;\n }\n\n for (const [\n tagIdx,\n tag,\n ] of jsdoc.tags.entries()) {\n if (!jsdoc.tags[tagIdx + 1] || lastTagsOfGroup.includes(tag)) {\n continue;\n }\n\n const ct = countTagEmptyLines(tag);\n if (ct && (!tagExceptions[tag.tag] || tagExceptions[tag.tag] < ct)) {\n const fixer = () => {\n let foundFirstTag = false;\n\n /** @type {string|undefined} */\n let currentTag;\n\n for (const [\n currIdx,\n {\n tokens: {\n description,\n end,\n name,\n tag: tg,\n type,\n },\n },\n ] of jsdoc.source.entries()) {\n if (tg) {\n foundFirstTag = true;\n currentTag = tg;\n }\n\n if (!foundFirstTag) {\n continue;\n }\n\n if (currentTag && !tg && !type && !name && !description && !end) {\n let nextIdx = currIdx;\n\n let ignore = true;\n // Even if a tag of the same name as the last tags in a group,\n // could still be an earlier tag in that group\n\n // eslint-disable-next-line no-loop-func -- Safe\n if (lastTagsOfGroup.some((lastTagOfGroup) => {\n return currentTag === '@' + lastTagOfGroup.tag;\n })) {\n while (true) {\n const nextTokens = jsdoc.source[++nextIdx]?.tokens;\n if (!nextTokens) {\n break;\n }\n\n if (!nextTokens.tag) {\n continue;\n }\n\n // Followed by the same tag name, so not actually last in group,\n // and of interest\n if (nextTokens.tag === currentTag) {\n ignore = false;\n }\n }\n } else {\n while (true) {\n const nextTokens = jsdoc.source[++nextIdx]?.tokens;\n if (!nextTokens || nextTokens.end) {\n break;\n }\n\n // Not the very last tag, so don't ignore\n if (nextTokens.tag) {\n ignore = false;\n break;\n }\n }\n }\n\n if (!ignore) {\n jsdoc.source.splice(currIdx, 1);\n for (const [\n srcIdx,\n src,\n ] of jsdoc.source.entries()) {\n src.number = srcIdx;\n }\n }\n }\n }\n };\n\n utils.reportJSDoc(\n 'Intra-group tags have unexpected whitespace',\n tag,\n fixer,\n );\n }\n }\n\n return;\n }\n\n const firstLine = utils.getFirstLine();\n\n const fix = () => {\n const itemsToMoveRange = [\n ...Array.from({\n length: jsdoc.tags.length -\n /** @type {import('../iterateJsdoc.js').Integer} */ (\n firstChangedTagIndex\n ),\n }).keys(),\n ];\n\n const unchangedPriorTagDescriptions = jsdoc.tags.slice(\n 0,\n firstChangedTagIndex,\n ).reduce((ct, {\n source,\n }) => {\n return ct + source.length - 1;\n }, 0);\n\n // This offset includes not only the offset from where the first tag\n // must begin, and the additional offset of where the first changed\n // tag begins, but it must also account for prior descriptions\n const initialOffset = /** @type {import('../iterateJsdoc.js').Integer} */ (\n firstLine\n ) + /** @type {import('../iterateJsdoc.js').Integer} */ (firstChangedTagIndex) +\n\n // May be the first tag, so don't try finding a prior one if so\n unchangedPriorTagDescriptions;\n\n // Use `firstChangedTagLine` for line number to begin reporting/splicing\n for (const idx of itemsToMoveRange) {\n utils.removeTag(\n idx +\n /** @type {import('../iterateJsdoc.js').Integer} */ (\n firstChangedTagIndex\n ),\n );\n }\n\n const changedTags = sortedTags.slice(firstChangedTagIndex);\n let extraTagCount = 0;\n\n for (const idx of itemsToMoveRange) {\n const changedTag = changedTags[idx];\n\n utils.addTag(\n changedTag.tag,\n extraTagCount + initialOffset + idx,\n {\n ...changedTag.source[0].tokens,\n\n // `comment-parser` puts the `end` within the `tags` section, so\n // avoid adding another to jsdoc.source\n end: '',\n },\n );\n\n for (const {\n tokens,\n } of changedTag.source.slice(1)) {\n if (!tokens.end) {\n utils.addLine(\n extraTagCount + initialOffset + idx + 1,\n {\n ...tokens,\n end: '',\n },\n );\n extraTagCount++;\n }\n }\n }\n };\n\n utils.reportJSDoc(\n `Tags are not in the prescribed order: ${\n tagList.join(', ') || '(alphabetical)'\n }`,\n jsdoc.tags[/** @type {import('../iterateJsdoc.js').Integer} */ (\n firstChangedTagIndex\n )],\n fix,\n true,\n );\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/sort-tags.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n alphabetizeExtras: {\n description: `Defaults to \\`false\\`. Alphabetizes any items not within \\`tagSequence\\` after any\nitems within \\`tagSequence\\` (or in place of the special \\`-other\\` pseudo-tag)\nare sorted.\n\nIf you want all your tags alphabetized, you can supply an empty array for\n\\`tagSequence\\` along with setting this option to \\`true\\`.`,\n type: 'boolean',\n },\n linesBetween: {\n description: `Indicates the number of lines to be added between tag groups. Defaults to 1.\nDo not set to 0 or 2+ if you are using \\`tag-lines\\` and \\`\"always\"\\` and do not\nset to 1+ if you are using \\`tag-lines\\` and \\`\"never\"\\`.`,\n type: 'integer',\n },\n reportIntraTagGroupSpacing: {\n description: `Whether to enable reporting and fixing of line breaks within tags of a given\ntag group. Defaults to \\`true\\` which will remove any line breaks at the end of\nsuch tags. Do not use with \\`true\\` if you are using \\`tag-lines\\` and \\`always\\`.`,\n type: 'boolean',\n },\n reportTagGroupSpacing: {\n description: `Whether to enable reporting and fixing of line breaks between tag groups\nas set by \\`linesBetween\\`. Defaults to \\`true\\`. Note that the very last tag\nwill not have spacing applied regardless. For adding line breaks there, you\nmay wish to use the \\`endLines\\` option of the \\`tag-lines\\` rule.`,\n type: 'boolean',\n },\n tagExceptions: {\n description: 'Allows specification by tag of a specific higher maximum number of lines. Keys are tags and values are the maximum number of lines allowed for such tags. Overrides `linesBetween`. Defaults to no special exceptions per tag.',\n patternProperties: {\n '.*': {\n type: 'number',\n },\n },\n type: 'object',\n },\n tagSequence: {\n description: `An array of tag group objects indicating the preferred sequence for sorting tags.\n\nEach item in the array should be an object with a \\`tags\\` property set to an array\nof tag names.\n\nTag names earlier in the list will be arranged first. The relative position of\ntags of the same name will not be changed.\n\nEarlier groups will also be arranged before later groups, but with the added\nfeature that additional line breaks may be added between (or before or after)\nsuch groups (depending on the setting of \\`linesBetween\\`).\n\nTag names not in the list will be grouped together at the end. The pseudo-tag\n\\`-other\\` can be used to place them anywhere else if desired. The tags will be\nplaced in their order of appearance, or alphabetized if \\`alphabetizeExtras\\`\nis enabled, see more below about that option.\n\nDefaults to the array below (noting that it is just a single tag group with\nno lines between groups by default).\n\nPlease note that this order is still experimental, so if you want to retain\na fixed order that doesn't change into the future, supply your own\n\\`tagSequence\\`.\n\n\\`\\`\\`js\n[{tags: [\n // Brief descriptions\n 'summary',\n 'typeSummary',\n\n // Module/file-level\n 'module',\n 'exports',\n 'file',\n 'fileoverview',\n 'overview',\n 'import',\n\n // Identifying (name, type)\n 'typedef',\n 'interface',\n 'record',\n 'template',\n 'name',\n 'kind',\n 'type',\n 'alias',\n 'external',\n 'host',\n 'callback',\n 'func',\n 'function',\n 'method',\n 'class',\n 'constructor',\n\n // Relationships\n 'modifies',\n 'mixes',\n 'mixin',\n 'mixinClass',\n 'mixinFunction',\n 'namespace',\n 'borrows',\n 'constructs',\n 'lends',\n 'implements',\n 'requires',\n\n // Long descriptions\n 'desc',\n 'description',\n 'classdesc',\n 'tutorial',\n 'copyright',\n 'license',\n\n // Simple annotations\n 'const',\n 'constant',\n 'final',\n 'global',\n 'readonly',\n 'abstract',\n 'virtual',\n 'var',\n 'member',\n 'memberof',\n 'memberof!',\n 'inner',\n 'instance',\n 'inheritdoc',\n 'inheritDoc',\n 'override',\n 'hideconstructor',\n\n // Core function/object info\n 'param',\n 'arg',\n 'argument',\n 'prop',\n 'property',\n 'return',\n 'returns',\n\n // Important behavior details\n 'async',\n 'generator',\n 'default',\n 'defaultvalue',\n 'enum',\n 'augments',\n 'extends',\n 'throws',\n 'exception',\n 'yield',\n 'yields',\n 'event',\n 'fires',\n 'emits',\n 'listens',\n 'this',\n\n // Access\n 'static',\n 'private',\n 'protected',\n 'public',\n 'access',\n 'package',\n\n '-other',\n\n // Supplementary descriptions\n 'see',\n 'example',\n\n // METADATA\n\n // Other Closure (undocumented) metadata\n 'closurePrimitive',\n 'customElement',\n 'expose',\n 'hidden',\n 'idGenerator',\n 'meaning',\n 'ngInject',\n 'owner',\n 'wizaction',\n\n // Other Closure (documented) metadata\n 'define',\n 'dict',\n 'export',\n 'externs',\n 'implicitCast',\n 'noalias',\n 'nocollapse',\n 'nocompile',\n 'noinline',\n 'nosideeffects',\n 'polymer',\n 'polymerBehavior',\n 'preserve',\n 'struct',\n 'suppress',\n 'unrestricted',\n\n // @homer0/prettier-plugin-jsdoc metadata\n 'category',\n\n // Non-Closure metadata\n 'ignore',\n 'author',\n 'version',\n 'variation',\n 'since',\n 'deprecated',\n 'todo',\n]}];\n\\`\\`\\``,\n items: {\n additionalProperties: false,\n properties: {\n tags: {\n description: 'See description on `tagSequence`.',\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,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AAC;UACD+C,aAAa,EAAE;QACjB;MACF;IACF;EACF,CAAC;EAED7F,KAAK,CAAC6E,WAAW,CACf,yCACEpE,OAAO,CAACwF,IAAI,CAAC,IAAI,CAAC,IAAI,gBAAgB,EACtC,EACFlG,KAAK,CAACa,IAAI,EAAC;EACTa,oBAAoB,EACpB,EACF4D,GAAG,EACH,IACF,CAAC;AACH,CAAC,EAAE;EACDa,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJvD,WAAW,EAAE,6GAA6G;MAC1HwD,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVxG,iBAAiB,EAAE;UACjB4C,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA,4DAA4D;UAChDI,IAAI,EAAE;QACR,CAAC;QACD/C,YAAY,EAAE;UACZ2C,WAAW,EAAE;AACzB;AACA,0DAA0D;UAC9CI,IAAI,EAAE;QACR,CAAC;QACD9C,0BAA0B,EAAE;UAC1B0C,WAAW,EAAE;AACzB;AACA,mFAAmF;UACvEI,IAAI,EAAE;QACR,CAAC;QACD7C,qBAAqB,EAAE;UACrByC,WAAW,EAAE;AACzB;AACA;AACA,mEAAmE;UACvDI,IAAI,EAAE;QACR,CAAC;QACD5C,aAAa,EAAE;UACbwC,WAAW,EAAE,gOAAgO;UAC7O6D,iBAAiB,EAAE;YACjB,IAAI,EAAE;cACJzD,IAAI,EAAE;YACR;UACF,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACD3C,WAAW,EAAE;UACXuC,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;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;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;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;UACK8D,KAAK,EAAE;YACLH,oBAAoB,EAAE,KAAK;YAC3BC,UAAU,EAAE;cACV7F,IAAI,EAAE;gBACJiC,WAAW,EAAE,mCAAmC;gBAChD8D,KAAK,EAAE;kBACL1D,IAAI,EAAE;gBACR,CAAC;gBACDA,IAAI,EAAE;cACR;YACF,CAAC;YACDA,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA2D,MAAA,CAAAhH,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
|
package/dist/rules/tagLines.cjs
CHANGED
|
@@ -36,15 +36,16 @@ const checkMaxBlockLines = ({
|
|
|
36
36
|
utils.reportJSDoc(`Expected a maximum of ${maxBlockLines} line${maxBlockLines === 1 ? '' : 's'} within block description`, {
|
|
37
37
|
line: excessIndexLine
|
|
38
38
|
}, () => {
|
|
39
|
-
utils.setBlockDescription((info, seedTokens, descLines) => {
|
|
40
|
-
|
|
39
|
+
utils.setBlockDescription((info, seedTokens, descLines, postDelims) => {
|
|
40
|
+
const newPostDelims = [...postDelims.slice(0, excessIndexLine), ...postDelims.slice(excessIndexLine + excessBlockLines - 1 - maxBlockLines)];
|
|
41
|
+
return [...descLines.slice(0, excessIndexLine), ...descLines.slice(excessIndexLine + excessBlockLines - 1 - maxBlockLines)].map((desc, idx) => {
|
|
41
42
|
return {
|
|
42
43
|
number: 0,
|
|
43
44
|
source: '',
|
|
44
45
|
tokens: seedTokens({
|
|
45
46
|
...info,
|
|
46
47
|
description: desc,
|
|
47
|
-
postDelimiter:
|
|
48
|
+
postDelimiter: newPostDelims[idx]
|
|
48
49
|
})
|
|
49
50
|
};
|
|
50
51
|
});
|
|
@@ -225,15 +226,15 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
225
226
|
utils.reportJSDoc(`Expected only ${startLines} line${startLines === 1 ? '' : 's'} after block description`, {
|
|
226
227
|
line: lastDescriptionLine - trailingDiff
|
|
227
228
|
}, () => {
|
|
228
|
-
utils.setBlockDescription((info, seedTokens, descLines) => {
|
|
229
|
-
return descLines.slice(0, -trailingDiff).map(desc => {
|
|
229
|
+
utils.setBlockDescription((info, seedTokens, descLines, postDelims) => {
|
|
230
|
+
return descLines.slice(0, -trailingDiff).map((desc, idx) => {
|
|
230
231
|
return {
|
|
231
232
|
number: 0,
|
|
232
233
|
source: '',
|
|
233
234
|
tokens: seedTokens({
|
|
234
235
|
...info,
|
|
235
236
|
description: desc,
|
|
236
|
-
postDelimiter:
|
|
237
|
+
postDelimiter: postDelims[idx]
|
|
237
238
|
})
|
|
238
239
|
};
|
|
239
240
|
});
|
|
@@ -243,19 +244,19 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
243
244
|
utils.reportJSDoc(`Expected ${startLines} lines after block description`, {
|
|
244
245
|
line: lastDescriptionLine
|
|
245
246
|
}, () => {
|
|
246
|
-
utils.setBlockDescription((info, seedTokens, descLines) => {
|
|
247
|
+
utils.setBlockDescription((info, seedTokens, descLines, postDelims) => {
|
|
247
248
|
return [...descLines, ...Array.from({
|
|
248
249
|
length: -trailingDiff
|
|
249
250
|
}, () => {
|
|
250
251
|
return '';
|
|
251
|
-
})].map(desc => {
|
|
252
|
+
})].map((desc, idx) => {
|
|
252
253
|
return {
|
|
253
254
|
number: 0,
|
|
254
255
|
source: '',
|
|
255
256
|
tokens: seedTokens({
|
|
256
257
|
...info,
|
|
257
258
|
description: desc,
|
|
258
|
-
postDelimiter: desc.trim() ?
|
|
259
|
+
postDelimiter: desc.trim() ? postDelims[idx] : ''
|
|
259
260
|
})
|
|
260
261
|
};
|
|
261
262
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tagLines.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","checkMaxBlockLines","maxBlockLines","startLines","utils","reportJSDoc","description","getDescription","excessBlockLinesRegex","RegExp","excessBlockLinesMatch","match","excessBlockLines","length","excessIndexLine","slice","index","line","setBlockDescription","info","seedTokens","descLines","map","desc","number","source","tokens","postDelimiter","trim","_default","exports","iterateJsdoc","context","jsdoc","alwaysNever","applyToEndTag","count","endLines","tags","options","some","tg","tagIdx","lastTag","lastEmpty","reportIndex","emptyLinesCount","idx","end","name","tag","type","entries","includes","lines","empty","lineDiff","fixer","removeTag","tagSourceOffset","addLines","currentTag","tagSourceIdx","splice","push","currentTg","tagCount","defaultAlways","overrideAlways","fixCount","lastDescriptionLine","test","trailingLines","trailingDiff","Array","from","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","additionalProperties","properties","anyOf","patternProperties","module"],"sources":["../../src/rules/tagLines.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @param {{\n * maxBlockLines: null|number,\n * startLines: null|number,\n * utils: import('../iterateJsdoc.js').Utils\n * }} cfg\n */\nconst checkMaxBlockLines = ({\n maxBlockLines,\n startLines,\n utils,\n}) => {\n if (typeof maxBlockLines !== 'number') {\n return false;\n }\n\n if (typeof startLines === 'number' && maxBlockLines < startLines) {\n utils.reportJSDoc(\n 'If set to a number, `maxBlockLines` must be greater than or equal to `startLines`.',\n );\n return true;\n }\n\n const {\n description,\n } = utils.getDescription();\n const excessBlockLinesRegex = new RegExp('\\n{' + (maxBlockLines + 2) + ',}', 'v');\n const excessBlockLinesMatch = description.match(excessBlockLinesRegex);\n const excessBlockLines = excessBlockLinesMatch?.[0]?.length ?? 0;\n if (excessBlockLinesMatch) {\n const excessIndexLine = description.slice(0, excessBlockLinesMatch.index).match(/\\n/gv)?.length ?? 0;\n utils.reportJSDoc(\n `Expected a maximum of ${maxBlockLines} line${maxBlockLines === 1 ? '' : 's'} within block description`,\n {\n line: excessIndexLine,\n },\n () => {\n utils.setBlockDescription((info, seedTokens, descLines) => {\n return [\n ...descLines.slice(0, excessIndexLine),\n ...descLines.slice(excessIndexLine + excessBlockLines - 1 - maxBlockLines),\n ].map((desc) => {\n return {\n number: 0,\n source: '',\n tokens: seedTokens({\n ...info,\n description: desc,\n postDelimiter: desc.trim() ? ' ' : '',\n }),\n };\n });\n });\n },\n );\n return true;\n }\n\n return false;\n};\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const [\n alwaysNever = 'never',\n {\n applyToEndTag = true,\n count = 1,\n endLines = 0,\n maxBlockLines = null,\n startLines = 0,\n tags = {},\n } = {},\n ] = context.options;\n\n jsdoc.tags.some((tg, tagIdx) => {\n let lastTag;\n\n /**\n * @type {null|import('../iterateJsdoc.js').Integer}\n */\n let lastEmpty = null;\n\n /**\n * @type {null|import('../iterateJsdoc.js').Integer}\n */\n let reportIndex = null;\n let emptyLinesCount = 0;\n for (const [\n idx,\n {\n tokens: {\n description,\n end,\n name,\n tag,\n type,\n },\n },\n ] of tg.source.entries()) {\n // May be text after a line break within a tag description\n if (description) {\n reportIndex = null;\n }\n\n if (lastTag && [\n 'always', 'any',\n ].includes(tags[lastTag.slice(1)]?.lines)) {\n continue;\n }\n\n const empty = !tag && !name && !type && !description;\n if (\n empty && !end &&\n (alwaysNever === 'never' ||\n lastTag && tags[lastTag.slice(1)]?.lines === 'never'\n )\n ) {\n reportIndex = idx;\n\n continue;\n }\n\n if (!end) {\n if (empty) {\n emptyLinesCount++;\n } else {\n emptyLinesCount = 0;\n }\n\n lastEmpty = empty ? idx : null;\n }\n\n lastTag = tag;\n }\n\n if (\n typeof endLines === 'number' &&\n lastEmpty !== null && tagIdx === jsdoc.tags.length - 1\n ) {\n const lineDiff = endLines - emptyLinesCount;\n\n if (lineDiff < 0) {\n const fixer = () => {\n utils.removeTag(tagIdx, {\n tagSourceOffset: /** @type {import('../iterateJsdoc.js').Integer} */ (\n lastEmpty\n ) + lineDiff + 1,\n });\n };\n\n utils.reportJSDoc(\n `Expected ${endLines} trailing lines`,\n {\n line: tg.source[lastEmpty].number + lineDiff + 1,\n },\n fixer,\n );\n } else if (lineDiff > 0) {\n const fixer = () => {\n utils.addLines(\n tagIdx,\n /** @type {import('../iterateJsdoc.js').Integer} */ (lastEmpty),\n endLines - emptyLinesCount,\n );\n };\n\n utils.reportJSDoc(\n `Expected ${endLines} trailing lines`,\n {\n line: tg.source[lastEmpty].number,\n },\n fixer,\n );\n }\n\n return true;\n }\n\n if (reportIndex !== null) {\n const fixer = () => {\n utils.removeTag(tagIdx, {\n tagSourceOffset: /** @type {import('../iterateJsdoc.js').Integer} */ (\n reportIndex\n ),\n });\n };\n\n utils.reportJSDoc(\n 'Expected no lines between tags',\n {\n line: tg.source[0].number + 1,\n },\n fixer,\n );\n\n return true;\n }\n\n return false;\n });\n\n (applyToEndTag ? jsdoc.tags : jsdoc.tags.slice(0, -1)).some((tg, tagIdx) => {\n /**\n * @type {{\n * idx: import('../iterateJsdoc.js').Integer,\n * number: import('../iterateJsdoc.js').Integer\n * }[]}\n */\n const lines = [];\n\n let currentTag;\n let tagSourceIdx = 0;\n for (const [\n idx,\n {\n number,\n tokens: {\n description,\n end,\n name,\n tag,\n type,\n },\n },\n ] of tg.source.entries()) {\n if (description) {\n lines.splice(0);\n tagSourceIdx = idx;\n }\n\n if (tag) {\n currentTag = tag;\n }\n\n if (!tag && !name && !type && !description && !end) {\n lines.push({\n idx,\n number,\n });\n }\n }\n\n const currentTg = currentTag && tags[currentTag.slice(1)];\n const tagCount = currentTg?.count;\n\n const defaultAlways = alwaysNever === 'always' && currentTg?.lines !== 'never' &&\n currentTg?.lines !== 'any' && lines.length < count;\n\n let overrideAlways;\n let fixCount = count;\n if (!defaultAlways) {\n fixCount = typeof tagCount === 'number' ? tagCount : count;\n overrideAlways = currentTg?.lines === 'always' &&\n lines.length < fixCount;\n }\n\n if (defaultAlways || overrideAlways) {\n const fixer = () => {\n utils.addLines(tagIdx, lines[lines.length - 1]?.idx || tagSourceIdx + 1, fixCount - lines.length);\n };\n\n const line = lines[lines.length - 1]?.number || tg.source[tagSourceIdx].number;\n utils.reportJSDoc(\n `Expected ${fixCount} line${fixCount === 1 ? '' : 's'} between tags but found ${lines.length}`,\n {\n line,\n },\n fixer,\n );\n\n return true;\n }\n\n return false;\n });\n\n if (checkMaxBlockLines({\n maxBlockLines,\n startLines,\n utils,\n })) {\n return;\n }\n\n if (typeof startLines === 'number') {\n if (!jsdoc.tags.length) {\n return;\n }\n\n const {\n description,\n lastDescriptionLine,\n } = utils.getDescription();\n if (!(/\\S/v).test(description)) {\n return;\n }\n\n const trailingLines = description.match(/\\n+$/v)?.[0]?.length;\n const trailingDiff = (trailingLines ?? 0) - startLines;\n if (trailingDiff > 0) {\n utils.reportJSDoc(\n `Expected only ${startLines} line${startLines === 1 ? '' : 's'} after block description`,\n {\n line: lastDescriptionLine - trailingDiff,\n },\n () => {\n utils.setBlockDescription((info, seedTokens, descLines) => {\n return descLines.slice(0, -trailingDiff).map((desc) => {\n return {\n number: 0,\n source: '',\n tokens: seedTokens({\n ...info,\n description: desc,\n postDelimiter: desc.trim() ? info.postDelimiter : '',\n }),\n };\n });\n });\n },\n );\n } else if (trailingDiff < 0) {\n utils.reportJSDoc(\n `Expected ${startLines} lines after block description`,\n {\n line: lastDescriptionLine,\n },\n () => {\n utils.setBlockDescription((info, seedTokens, descLines) => {\n return [\n ...descLines,\n ...Array.from({\n length: -trailingDiff,\n }, () => {\n return '';\n }),\n ].map((desc) => {\n return {\n number: 0,\n source: '',\n tokens: seedTokens({\n ...info,\n description: desc,\n postDelimiter: desc.trim() ? info.postDelimiter : '',\n }),\n };\n });\n });\n },\n );\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Enforces lines (or no lines) before, after, or between tags.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/tag-lines.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n description: `Defaults to \"never\". \"any\" is only useful with \\`tags\\` (allowing non-enforcement of lines except\nfor particular tags) or with \\`startLines\\`, \\`endLines\\`, or \\`maxBlockLines\\`. It is also\nnecessary if using the linebreak-setting options of the \\`sort-tags\\` rule\nso that the two rules won't conflict in both attempting to set lines\nbetween tags.`,\n enum: [\n 'always', 'any', 'never',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n applyToEndTag: {\n description: `Set to \\`false\\` and use with \"always\" to indicate the normal lines to be\nadded after tags should not be added after the final tag.\n\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n count: {\n description: `Use with \"always\" to indicate the number of lines to require be present.\n\nDefaults to 1.`,\n type: 'integer',\n },\n endLines: {\n anyOf: [\n {\n type: 'integer',\n },\n {\n type: 'null',\n },\n ],\n description: `If not set to \\`null\\`, will enforce end lines to the given count on the\nfinal tag only.\n\nDefaults to \\`0\\`.`,\n },\n maxBlockLines: {\n anyOf: [\n {\n type: 'integer',\n },\n {\n type: 'null',\n },\n ],\n description: `If not set to \\`null\\`, will enforce a maximum number of lines to the given count anywhere in the block description.\n\nNote that if non-\\`null\\`, \\`maxBlockLines\\` must be greater than or equal to \\`startLines\\`.\n\nDefaults to \\`null\\`.`,\n },\n startLines: {\n anyOf: [\n {\n type: 'integer',\n },\n {\n type: 'null',\n },\n ],\n description: `If not set to \\`null\\`, will enforce end lines to the given count before the\nfirst tag only, unless there is only whitespace content, in which case,\na line count will not be enforced.\n\nDefaults to \\`0\\`.`,\n },\n tags: {\n description: `Overrides the default behavior depending on specific tags.\n\nAn object whose keys are tag names and whose values are objects with the\nfollowing keys:\n\n1. \\`lines\\` - Set to \\`always\\`, \\`never\\`, or \\`any\\` to override.\n2. \\`count\\` - Overrides main \\`count\\` (for \"always\")\n\nDefaults to empty object.`,\n patternProperties: {\n '.*': {\n additionalProperties: false,\n properties: {\n count: {\n type: 'integer',\n },\n lines: {\n enum: [\n 'always', 'never', 'any',\n ],\n type: 'string',\n },\n },\n },\n },\n type: 'object',\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;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,kBAAkB,GAAGA,CAAC;EAC1BC,aAAa;EACbC,UAAU;EACVC;AACF,CAAC,KAAK;EACJ,IAAI,OAAOF,aAAa,KAAK,QAAQ,EAAE;IACrC,OAAO,KAAK;EACd;EAEA,IAAI,OAAOC,UAAU,KAAK,QAAQ,IAAID,aAAa,GAAGC,UAAU,EAAE;IAChEC,KAAK,CAACC,WAAW,CACf,oFACF,CAAC;IACD,OAAO,IAAI;EACb;EAEA,MAAM;IACJC;EACF,CAAC,GAAGF,KAAK,CAACG,cAAc,CAAC,CAAC;EAC1B,MAAMC,qBAAqB,GAAG,IAAIC,MAAM,CAAC,KAA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AC;QACDd,QAAQ,EAAE;UACRgD,KAAK,EAAE,CACL;YACElC,IAAI,EAAE;UACR,CAAC,EACD;YACEA,IAAI,EAAE;UACR,CAAC,CACF;UACD7C,WAAW,EAAE;AACzB;AACA;AACA;QACU,CAAC;QACDJ,aAAa,EAAE;UACbmF,KAAK,EAAE,CACL;YACElC,IAAI,EAAE;UACR,CAAC,EACD;YACEA,IAAI,EAAE;UACR,CAAC,CACF;UACD7C,WAAW,EAAE;AACzB;AACA;AACA;AACA;QACU,CAAC;QACDH,UAAU,EAAE;UACVkF,KAAK,EAAE,CACL;YACElC,IAAI,EAAE;UACR,CAAC,EACD;YACEA,IAAI,EAAE;UACR,CAAC,CACF;UACD7C,WAAW,EAAE;AACzB;AACA;AACA;AACA;QACU,CAAC;QACDgC,IAAI,EAAE;UACJhC,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;UACdgF,iBAAiB,EAAE;YACjB,IAAI,EAAE;cACJH,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVhD,KAAK,EAAE;kBACLe,IAAI,EAAE;gBACR,CAAC;gBACDG,KAAK,EAAE;kBACL4B,IAAI,EAAE,CACJ,QAAQ,EAAE,OAAO,EAAE,KAAK,CACzB;kBACD/B,IAAI,EAAE;gBACR;cACF;YACF;UACF,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAoC,MAAA,CAAAzD,OAAA,GAAAA,OAAA,CAAA9B,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"tagLines.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","checkMaxBlockLines","maxBlockLines","startLines","utils","reportJSDoc","description","getDescription","excessBlockLinesRegex","RegExp","excessBlockLinesMatch","match","excessBlockLines","length","excessIndexLine","slice","index","line","setBlockDescription","info","seedTokens","descLines","postDelims","newPostDelims","map","desc","idx","number","source","tokens","postDelimiter","_default","exports","iterateJsdoc","context","jsdoc","alwaysNever","applyToEndTag","count","endLines","tags","options","some","tg","tagIdx","lastTag","lastEmpty","reportIndex","emptyLinesCount","end","name","tag","type","entries","includes","lines","empty","lineDiff","fixer","removeTag","tagSourceOffset","addLines","currentTag","tagSourceIdx","splice","push","currentTg","tagCount","defaultAlways","overrideAlways","fixCount","lastDescriptionLine","test","trailingLines","trailingDiff","Array","from","trim","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","additionalProperties","properties","anyOf","patternProperties","module"],"sources":["../../src/rules/tagLines.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\n/**\n * @param {{\n * maxBlockLines: null|number,\n * startLines: null|number,\n * utils: import('../iterateJsdoc.js').Utils\n * }} cfg\n */\nconst checkMaxBlockLines = ({\n maxBlockLines,\n startLines,\n utils,\n}) => {\n if (typeof maxBlockLines !== 'number') {\n return false;\n }\n\n if (typeof startLines === 'number' && maxBlockLines < startLines) {\n utils.reportJSDoc(\n 'If set to a number, `maxBlockLines` must be greater than or equal to `startLines`.',\n );\n return true;\n }\n\n const {\n description,\n } = utils.getDescription();\n const excessBlockLinesRegex = new RegExp('\\n{' + (maxBlockLines + 2) + ',}', 'v');\n const excessBlockLinesMatch = description.match(excessBlockLinesRegex);\n const excessBlockLines = excessBlockLinesMatch?.[0]?.length ?? 0;\n if (excessBlockLinesMatch) {\n const excessIndexLine = description.slice(0, excessBlockLinesMatch.index).match(/\\n/gv)?.length ?? 0;\n utils.reportJSDoc(\n `Expected a maximum of ${maxBlockLines} line${maxBlockLines === 1 ? '' : 's'} within block description`,\n {\n line: excessIndexLine,\n },\n () => {\n utils.setBlockDescription((info, seedTokens, descLines, postDelims) => {\n const newPostDelims = [\n ...postDelims.slice(0, excessIndexLine),\n ...postDelims.slice(excessIndexLine + excessBlockLines - 1 - maxBlockLines),\n ];\n return [\n ...descLines.slice(0, excessIndexLine),\n ...descLines.slice(excessIndexLine + excessBlockLines - 1 - maxBlockLines),\n ].map((desc, idx) => {\n return {\n number: 0,\n source: '',\n tokens: seedTokens({\n ...info,\n description: desc,\n postDelimiter: newPostDelims[idx],\n }),\n };\n });\n });\n },\n );\n return true;\n }\n\n return false;\n};\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const [\n alwaysNever = 'never',\n {\n applyToEndTag = true,\n count = 1,\n endLines = 0,\n maxBlockLines = null,\n startLines = 0,\n tags = {},\n } = {},\n ] = context.options;\n\n jsdoc.tags.some((tg, tagIdx) => {\n let lastTag;\n\n /**\n * @type {null|import('../iterateJsdoc.js').Integer}\n */\n let lastEmpty = null;\n\n /**\n * @type {null|import('../iterateJsdoc.js').Integer}\n */\n let reportIndex = null;\n let emptyLinesCount = 0;\n for (const [\n idx,\n {\n tokens: {\n description,\n end,\n name,\n tag,\n type,\n },\n },\n ] of tg.source.entries()) {\n // May be text after a line break within a tag description\n if (description) {\n reportIndex = null;\n }\n\n if (lastTag && [\n 'always', 'any',\n ].includes(tags[lastTag.slice(1)]?.lines)) {\n continue;\n }\n\n const empty = !tag && !name && !type && !description;\n if (\n empty && !end &&\n (alwaysNever === 'never' ||\n lastTag && tags[lastTag.slice(1)]?.lines === 'never'\n )\n ) {\n reportIndex = idx;\n\n continue;\n }\n\n if (!end) {\n if (empty) {\n emptyLinesCount++;\n } else {\n emptyLinesCount = 0;\n }\n\n lastEmpty = empty ? idx : null;\n }\n\n lastTag = tag;\n }\n\n if (\n typeof endLines === 'number' &&\n lastEmpty !== null && tagIdx === jsdoc.tags.length - 1\n ) {\n const lineDiff = endLines - emptyLinesCount;\n\n if (lineDiff < 0) {\n const fixer = () => {\n utils.removeTag(tagIdx, {\n tagSourceOffset: /** @type {import('../iterateJsdoc.js').Integer} */ (\n lastEmpty\n ) + lineDiff + 1,\n });\n };\n\n utils.reportJSDoc(\n `Expected ${endLines} trailing lines`,\n {\n line: tg.source[lastEmpty].number + lineDiff + 1,\n },\n fixer,\n );\n } else if (lineDiff > 0) {\n const fixer = () => {\n utils.addLines(\n tagIdx,\n /** @type {import('../iterateJsdoc.js').Integer} */ (lastEmpty),\n endLines - emptyLinesCount,\n );\n };\n\n utils.reportJSDoc(\n `Expected ${endLines} trailing lines`,\n {\n line: tg.source[lastEmpty].number,\n },\n fixer,\n );\n }\n\n return true;\n }\n\n if (reportIndex !== null) {\n const fixer = () => {\n utils.removeTag(tagIdx, {\n tagSourceOffset: /** @type {import('../iterateJsdoc.js').Integer} */ (\n reportIndex\n ),\n });\n };\n\n utils.reportJSDoc(\n 'Expected no lines between tags',\n {\n line: tg.source[0].number + 1,\n },\n fixer,\n );\n\n return true;\n }\n\n return false;\n });\n\n (applyToEndTag ? jsdoc.tags : jsdoc.tags.slice(0, -1)).some((tg, tagIdx) => {\n /**\n * @type {{\n * idx: import('../iterateJsdoc.js').Integer,\n * number: import('../iterateJsdoc.js').Integer\n * }[]}\n */\n const lines = [];\n\n let currentTag;\n let tagSourceIdx = 0;\n for (const [\n idx,\n {\n number,\n tokens: {\n description,\n end,\n name,\n tag,\n type,\n },\n },\n ] of tg.source.entries()) {\n if (description) {\n lines.splice(0);\n tagSourceIdx = idx;\n }\n\n if (tag) {\n currentTag = tag;\n }\n\n if (!tag && !name && !type && !description && !end) {\n lines.push({\n idx,\n number,\n });\n }\n }\n\n const currentTg = currentTag && tags[currentTag.slice(1)];\n const tagCount = currentTg?.count;\n\n const defaultAlways = alwaysNever === 'always' && currentTg?.lines !== 'never' &&\n currentTg?.lines !== 'any' && lines.length < count;\n\n let overrideAlways;\n let fixCount = count;\n if (!defaultAlways) {\n fixCount = typeof tagCount === 'number' ? tagCount : count;\n overrideAlways = currentTg?.lines === 'always' &&\n lines.length < fixCount;\n }\n\n if (defaultAlways || overrideAlways) {\n const fixer = () => {\n utils.addLines(tagIdx, lines[lines.length - 1]?.idx || tagSourceIdx + 1, fixCount - lines.length);\n };\n\n const line = lines[lines.length - 1]?.number || tg.source[tagSourceIdx].number;\n utils.reportJSDoc(\n `Expected ${fixCount} line${fixCount === 1 ? '' : 's'} between tags but found ${lines.length}`,\n {\n line,\n },\n fixer,\n );\n\n return true;\n }\n\n return false;\n });\n\n if (checkMaxBlockLines({\n maxBlockLines,\n startLines,\n utils,\n })) {\n return;\n }\n\n if (typeof startLines === 'number') {\n if (!jsdoc.tags.length) {\n return;\n }\n\n const {\n description,\n lastDescriptionLine,\n } = utils.getDescription();\n if (!(/\\S/v).test(description)) {\n return;\n }\n\n const trailingLines = description.match(/\\n+$/v)?.[0]?.length;\n const trailingDiff = (trailingLines ?? 0) - startLines;\n if (trailingDiff > 0) {\n utils.reportJSDoc(\n `Expected only ${startLines} line${startLines === 1 ? '' : 's'} after block description`,\n {\n line: lastDescriptionLine - trailingDiff,\n },\n () => {\n utils.setBlockDescription((info, seedTokens, descLines, postDelims) => {\n return descLines.slice(0, -trailingDiff).map((desc, idx) => {\n return {\n number: 0,\n source: '',\n tokens: seedTokens({\n ...info,\n description: desc,\n postDelimiter: postDelims[idx],\n }),\n };\n });\n });\n },\n );\n } else if (trailingDiff < 0) {\n utils.reportJSDoc(\n `Expected ${startLines} lines after block description`,\n {\n line: lastDescriptionLine,\n },\n () => {\n utils.setBlockDescription((info, seedTokens, descLines, postDelims) => {\n return [\n ...descLines,\n ...Array.from({\n length: -trailingDiff,\n }, () => {\n return '';\n }),\n ].map((desc, idx) => {\n return {\n number: 0,\n source: '',\n tokens: seedTokens({\n ...info,\n description: desc,\n postDelimiter: desc.trim() ? postDelims[idx] : '',\n }),\n };\n });\n });\n },\n );\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Enforces lines (or no lines) before, after, or between tags.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/tag-lines.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n description: `Defaults to \"never\". \"any\" is only useful with \\`tags\\` (allowing non-enforcement of lines except\nfor particular tags) or with \\`startLines\\`, \\`endLines\\`, or \\`maxBlockLines\\`. It is also\nnecessary if using the linebreak-setting options of the \\`sort-tags\\` rule\nso that the two rules won't conflict in both attempting to set lines\nbetween tags.`,\n enum: [\n 'always', 'any', 'never',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n applyToEndTag: {\n description: `Set to \\`false\\` and use with \"always\" to indicate the normal lines to be\nadded after tags should not be added after the final tag.\n\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n count: {\n description: `Use with \"always\" to indicate the number of lines to require be present.\n\nDefaults to 1.`,\n type: 'integer',\n },\n endLines: {\n anyOf: [\n {\n type: 'integer',\n },\n {\n type: 'null',\n },\n ],\n description: `If not set to \\`null\\`, will enforce end lines to the given count on the\nfinal tag only.\n\nDefaults to \\`0\\`.`,\n },\n maxBlockLines: {\n anyOf: [\n {\n type: 'integer',\n },\n {\n type: 'null',\n },\n ],\n description: `If not set to \\`null\\`, will enforce a maximum number of lines to the given count anywhere in the block description.\n\nNote that if non-\\`null\\`, \\`maxBlockLines\\` must be greater than or equal to \\`startLines\\`.\n\nDefaults to \\`null\\`.`,\n },\n startLines: {\n anyOf: [\n {\n type: 'integer',\n },\n {\n type: 'null',\n },\n ],\n description: `If not set to \\`null\\`, will enforce end lines to the given count before the\nfirst tag only, unless there is only whitespace content, in which case,\na line count will not be enforced.\n\nDefaults to \\`0\\`.`,\n },\n tags: {\n description: `Overrides the default behavior depending on specific tags.\n\nAn object whose keys are tag names and whose values are objects with the\nfollowing keys:\n\n1. \\`lines\\` - Set to \\`always\\`, \\`never\\`, or \\`any\\` to override.\n2. \\`count\\` - Overrides main \\`count\\` (for \"always\")\n\nDefaults to empty object.`,\n patternProperties: {\n '.*': {\n additionalProperties: false,\n properties: {\n count: {\n type: 'integer',\n },\n lines: {\n enum: [\n 'always', 'never', 'any',\n ],\n type: 'string',\n },\n },\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IA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