{"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,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,CA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