eslint-plugin-jsdoc
Version:
JSDoc linting rules for ESLint.
1 lines • 23.5 kB
Source Map (JSON)
{"version":3,"file":"checkLineAlignment.cjs","names":["_alignTransform","_interopRequireDefault","require","_iterateJsdoc","_commentParser","e","__esModule","default","flow","commentFlow","transforms","startsWithListMarker","text","isFirstLineOfTag","test","shouldAllowExtraIndent","tag","idx","hasSeenListMarker","lineIdx","line","source","isFirstLine","tokens","description","checkNotAlignedPerTag","utils","customSpacings","spacerProps","contentProps","mightHaveNamepath","tagMightHaveNameOrNamepath","followedBySpace","callbck","nextIndex","slice","some","spacerProp","innerIdx","contentProp","spacePropVal","ret","postHyphenSpacing","postHyphen","exactHyphenSpacing","RegExp","hasNoHyphen","hasExactHyphenSpacing","ok","contentPropVal","spacerPropVal","spacing","length","fix","entries","padStart","hasSpace","contentPrp","hyphenSpacing","replace","setTag","reportJSDoc","checkAlignment","disableWrapIndent","indent","jsdoc","jsdocNode","preserveMainDescriptionPostDelimiter","report","tags","wrapIndent","transform","alignTransform","transformedJsdoc","comment","value","formatted","stringify","trimStart","fixer","replaceText","_default","exports","iterateJsdoc","context","applicableTags","options","includes","foundTags","getPresentTags","type","name","actualIndent","postDelimiter","hasCorrectWrapIndent","hasExtraIndent","startsWith","isInListContext","number","charAt","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","additionalProperties","properties","postName","postTag","postType","items","module"],"sources":["../../src/rules/checkLineAlignment.js"],"sourcesContent":["import alignTransform from '../alignTransform.js';\nimport iterateJsdoc from '../iterateJsdoc.js';\nimport {\n transforms,\n} from 'comment-parser';\n\nconst {\n flow: commentFlow,\n} = transforms;\n\n/**\n * Detects if a line starts with a markdown list marker\n * Supports: -, *, numbered lists (1., 2., etc.)\n * This explicitly excludes hyphens that are part of JSDoc tag syntax\n * @param {string} text - The text to check\n * @param {boolean} isFirstLineOfTag - True if this is the first line (tag line)\n * @returns {boolean} - True if the text starts with a list marker\n */\nconst startsWithListMarker = (text, isFirstLineOfTag = false) => {\n // On the first line of a tag, the hyphen is typically the JSDoc separator,\n // not a list marker\n if (isFirstLineOfTag) {\n return false;\n }\n\n // Match lines that start with optional whitespace, then a list marker\n // - or * followed by a space\n // or a number followed by . or ) and a space\n return /^\\s*(?:[\\-*]|\\d+(?:\\.|\\)))\\s+/v.test(text);\n};\n\n/**\n * Checks if we should allow extra indentation beyond wrapIndent.\n * This is true for list continuation lines (lines with more indent than wrapIndent\n * that follow a list item).\n * @param {import('comment-parser').Spec} tag - The tag being checked\n * @param {import('../iterateJsdoc.js').Integer} idx - Current line index (0-based in tag.source.slice(1))\n * @returns {boolean} - True if extra indentation should be allowed\n */\nconst shouldAllowExtraIndent = (tag, idx) => {\n // Check if any previous line in this tag had a list marker\n // idx is 0-based in the continuation lines (tag.source.slice(1))\n // So tag.source[0] is the tag line, tag.source[idx+1] is current line\n let hasSeenListMarker = false;\n\n // Check all lines from the tag line onwards\n for (let lineIdx = 0; lineIdx <= idx + 1; lineIdx++) {\n const line = tag.source[lineIdx];\n const isFirstLine = lineIdx === 0;\n if (line?.tokens?.description && startsWithListMarker(line.tokens.description, isFirstLine)) {\n hasSeenListMarker = true;\n break;\n }\n }\n\n return hasSeenListMarker;\n};\n\n/**\n * @typedef {{\n * postDelimiter: import('../iterateJsdoc.js').Integer,\n * postHyphen: import('../iterateJsdoc.js').Integer,\n * postName: import('../iterateJsdoc.js').Integer,\n * postTag: import('../iterateJsdoc.js').Integer,\n * postType: import('../iterateJsdoc.js').Integer,\n * }} CustomSpacings\n */\n\n/**\n * @param {import('../iterateJsdoc.js').Utils} utils\n * @param {import('comment-parser').Spec & {\n * line: import('../iterateJsdoc.js').Integer\n * }} tag\n * @param {CustomSpacings} customSpacings\n */\nconst checkNotAlignedPerTag = (utils, tag, customSpacings) => {\n /*\n start +\n delimiter +\n postDelimiter +\n tag +\n postTag +\n type +\n postType +\n name +\n postName +\n description +\n end +\n lineEnd\n */\n\n /**\n * @typedef {\"tag\"|\"type\"|\"name\"|\"description\"} ContentProp\n */\n\n /** @type {(\"postDelimiter\"|\"postTag\"|\"postType\"|\"postName\")[]} */\n let spacerProps;\n /** @type {ContentProp[]} */\n let contentProps;\n const mightHaveNamepath = utils.tagMightHaveNameOrNamepath(tag.tag);\n if (mightHaveNamepath) {\n spacerProps = [\n 'postDelimiter', 'postTag', 'postType', 'postName',\n ];\n contentProps = [\n 'tag', 'type', 'name', 'description',\n ];\n } else {\n spacerProps = [\n 'postDelimiter', 'postTag', 'postType',\n ];\n contentProps = [\n 'tag', 'type', 'description',\n ];\n }\n\n const {\n tokens,\n } = tag.source[0];\n\n /**\n * @param {import('../iterateJsdoc.js').Integer} idx\n * @param {(notRet: boolean, contentProp: ContentProp) => void} [callbck]\n */\n const followedBySpace = (idx, callbck) => {\n const nextIndex = idx + 1;\n\n return spacerProps.slice(nextIndex).some((spacerProp, innerIdx) => {\n const contentProp = contentProps[nextIndex + innerIdx];\n\n const spacePropVal = tokens[spacerProp];\n\n const ret = spacePropVal;\n\n if (callbck) {\n callbck(!ret, contentProp);\n }\n\n return ret && (callbck || !contentProp);\n });\n };\n\n const postHyphenSpacing = customSpacings?.postHyphen ?? 1;\n const exactHyphenSpacing = new RegExp(`^\\\\s*-\\\\s{${postHyphenSpacing},${postHyphenSpacing}}(?!\\\\s)`, 'v');\n const hasNoHyphen = !(/^\\s*-(?!$)(?=\\s)/v).test(tokens.description);\n const hasExactHyphenSpacing = exactHyphenSpacing.test(\n tokens.description,\n );\n\n // If checking alignment on multiple lines, need to check other `source`\n // items\n // Go through `post*` spacing properties and exit to indicate problem if\n // extra spacing detected\n const ok = !spacerProps.some((spacerProp, idx) => {\n const contentProp = contentProps[idx];\n const contentPropVal = tokens[contentProp];\n const spacerPropVal = tokens[spacerProp];\n const spacing = customSpacings?.[spacerProp] || 1;\n\n // There will be extra alignment if...\n\n // 1. The spaces don't match the space it should have (1 or custom spacing) OR\n return spacerPropVal.length !== spacing && spacerPropVal.length !== 0 ||\n\n // 2. There is a (single) space, no immediate content, and yet another\n // space is found subsequently (not separated by intervening content)\n spacerPropVal && !contentPropVal && followedBySpace(idx);\n }) && (hasNoHyphen || hasExactHyphenSpacing);\n if (ok) {\n return;\n }\n\n const fix = () => {\n for (const [\n idx,\n spacerProp,\n ] of spacerProps.entries()) {\n const contentProp = contentProps[idx];\n const contentPropVal = tokens[contentProp];\n\n if (contentPropVal) {\n const spacing = customSpacings?.[spacerProp] || 1;\n tokens[spacerProp] = ''.padStart(spacing, ' ');\n followedBySpace(idx, (hasSpace, contentPrp) => {\n if (hasSpace) {\n tokens[contentPrp] = '';\n }\n });\n } else {\n tokens[spacerProp] = '';\n }\n }\n\n if (!hasExactHyphenSpacing) {\n const hyphenSpacing = /^\\s*-\\s+/v;\n tokens.description = tokens.description.replace(\n hyphenSpacing, '-' + ''.padStart(postHyphenSpacing, ' '),\n );\n }\n\n utils.setTag(tag, tokens);\n };\n\n utils.reportJSDoc('Expected JSDoc block lines to not be aligned.', tag, fix, true);\n};\n\n/**\n * @param {object} cfg\n * @param {CustomSpacings} cfg.customSpacings\n * @param {string} cfg.indent\n * @param {import('comment-parser').Block} cfg.jsdoc\n * @param {import('eslint').Rule.Node & {\n * range: [number, number]\n * }} cfg.jsdocNode\n * @param {boolean} cfg.preserveMainDescriptionPostDelimiter\n * @param {import('../iterateJsdoc.js').Report} cfg.report\n * @param {string[]} cfg.tags\n * @param {import('../iterateJsdoc.js').Utils} cfg.utils\n * @param {string} cfg.wrapIndent\n * @param {boolean} cfg.disableWrapIndent\n * @returns {void}\n */\nconst checkAlignment = ({\n customSpacings,\n disableWrapIndent,\n indent,\n jsdoc,\n jsdocNode,\n preserveMainDescriptionPostDelimiter,\n report,\n tags,\n utils,\n wrapIndent,\n}) => {\n const transform = commentFlow(\n alignTransform({\n customSpacings,\n disableWrapIndent,\n indent,\n preserveMainDescriptionPostDelimiter,\n tags,\n wrapIndent,\n }),\n );\n const transformedJsdoc = transform(jsdoc);\n\n const comment = '/*' +\n /**\n * @type {import('eslint').Rule.Node & {\n * range: [number, number], value: string\n * }}\n */ (jsdocNode).value + '*/';\n\n const formatted = utils.stringify(transformedJsdoc)\n .trimStart();\n\n if (comment !== formatted) {\n report(\n 'Expected JSDoc block lines to be aligned.',\n /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {\n return fixer.replaceText(jsdocNode, formatted);\n },\n );\n }\n};\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n jsdocNode,\n report,\n utils,\n}) => {\n const {\n customSpacings,\n disableWrapIndent = false,\n preserveMainDescriptionPostDelimiter,\n tags: applicableTags = [\n 'param', 'arg', 'argument', 'property', 'prop', 'returns', 'return', 'template',\n ],\n wrapIndent = '',\n } = context.options[1] || {};\n\n if (context.options[0] === 'always') {\n // Skip if it contains only a single line.\n if (!(\n /**\n * @type {import('eslint').Rule.Node & {\n * range: [number, number], value: string\n * }}\n */\n (jsdocNode).value.includes('\\n')\n )) {\n return;\n }\n\n checkAlignment({\n customSpacings,\n disableWrapIndent,\n indent,\n jsdoc,\n jsdocNode,\n preserveMainDescriptionPostDelimiter,\n report,\n tags: applicableTags,\n utils,\n wrapIndent,\n });\n\n return;\n }\n\n const foundTags = utils.getPresentTags(applicableTags);\n if (context.options[0] !== 'any') {\n for (const tag of foundTags) {\n checkNotAlignedPerTag(\n utils,\n /**\n * @type {import('comment-parser').Spec & {\n * line: import('../iterateJsdoc.js').Integer\n * }}\n */\n (tag),\n customSpacings,\n );\n }\n }\n\n for (const tag of foundTags) {\n if (tag.source.length > 1) {\n let idx = 0;\n for (const {\n tokens,\n // Avoid the tag line\n } of tag.source.slice(1)) {\n idx++;\n\n if (\n !tokens.description ||\n // Avoid first lines after multiline type\n tokens.type ||\n tokens.name\n ) {\n continue;\n }\n\n // Don't include a single separating space/tab\n const actualIndent = tokens.postDelimiter.slice(1);\n const hasCorrectWrapIndent = actualIndent === wrapIndent;\n\n // Allow extra indentation if this line or previous lines contain list markers\n // This preserves nested list structure\n const hasExtraIndent = actualIndent.length > wrapIndent.length &&\n actualIndent.startsWith(wrapIndent);\n const isInListContext = shouldAllowExtraIndent(tag, idx - 1);\n\n if (!disableWrapIndent && !hasCorrectWrapIndent &&\n !(hasExtraIndent && isInListContext)) {\n utils.reportJSDoc('Expected wrap indent', {\n line: tag.source[0].number + idx,\n }, () => {\n tokens.postDelimiter = tokens.postDelimiter.charAt(0) + wrapIndent;\n });\n return;\n }\n }\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Reports invalid alignment of JSDoc block lines.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-line-alignment.md#repos-sticky-header',\n },\n fixable: 'whitespace',\n schema: [\n {\n description: `If the string value is\n\\`\"always\"\\` then a problem is raised when the lines are not aligned.\nIf it is \\`\"never\"\\` then a problem should be raised when there is more than\none space between each line's parts. If it is \\`\"any\"\\`, no alignment is made.\nDefaults to \\`\"never\"\\`.\n\nNote that in addition to alignment, the \"never\" and \"always\" options will both\nensure that at least one space is present after the asterisk delimiter.`,\n enum: [\n 'always', 'never', 'any',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n customSpacings: {\n additionalProperties: false,\n description: `An object with any of the following spacing keys set to an integer.\nIf a spacing is not defined, it defaults to one.`,\n properties: {\n postDelimiter: {\n description: 'Affects spacing after the asterisk (e.g., `* @param`)',\n type: 'integer',\n },\n postHyphen: {\n description: 'Affects spacing after any hyphens in the description (e.g., `* @param {someType} name - A description`)',\n type: 'integer',\n },\n postName: {\n description: 'Affects spacing after the name (e.g., `* @param {someType} name `)',\n type: 'integer',\n },\n postTag: {\n description: 'Affects spacing after the tag (e.g., `* @param `)',\n type: 'integer',\n },\n postType: {\n description: 'Affects spacing after the type (e.g., `* @param {someType} `)',\n type: 'integer',\n },\n },\n type: 'object',\n },\n disableWrapIndent: {\n description: 'Disables `wrapIndent`; existing wrap indentation is preserved without changes.',\n type: 'boolean',\n },\n preserveMainDescriptionPostDelimiter: {\n default: false,\n description: `A boolean to determine whether to preserve the post-delimiter spacing of the\nmain description. If \\`false\\` or unset, will be set to a single space.`,\n type: 'boolean',\n },\n tags: {\n description: `Use this to change the tags which are sought for alignment changes. Defaults to an array of\n\\`['param', 'arg', 'argument', 'property', 'prop', 'returns', 'return', 'template']\\`.`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n wrapIndent: {\n description: `The indent that will be applied for tag text after the first line.\nDefault to the empty string (no indent).`,\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAEwB,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExB,MAAM;EACJG,IAAI,EAAEC;AACR,CAAC,GAAGC,yBAAU;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAGA,CAACC,IAAI,EAAEC,gBAAgB,GAAG,KAAK,KAAK;EAC/D;EACA;EACA,IAAIA,gBAAgB,EAAE;IACpB,OAAO,KAAK;EACd;;EAEA;EACA;EACA;EACA,OAAO,gCAAgC,CAACC,IAAI,CAACF,IAAI,CAAC;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,sBAAsB,GAAGA,CAACC,GAAG,EAAEC,GAAG,KAAK;EAC3C;EACA;EACA;EACA,IAAIC,iBAAiB,GAAG,KAAK;;EAE7B;EACA,KAAK,IAAIC,OAAO,GAAG,CAAC,EAAEA,OAAO,IAAIF,GAAG,GAAG,CAAC,EAAEE,OAAO,EAAE,EAAE;IACnD,MAAMC,IAAI,GAAGJ,GAAG,CAACK,MAAM,CAACF,OAAO,CAAC;IAChC,MAAMG,WAAW,GAAGH,OAAO,KAAK,CAAC;IACjC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