eslint-plugin-jsdoc 58.1.0 → 59.0.0
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/README.md +66 -60
- package/dist/buildForbidRuleDefinition.cjs +0 -1
- package/dist/buildForbidRuleDefinition.cjs.map +1 -1
- package/dist/buildRejectOrPreferRuleDefinition.cjs +7 -2
- package/dist/buildRejectOrPreferRuleDefinition.cjs.map +1 -1
- package/dist/cjs/rules/convertToJsdocComments.d.ts +7 -0
- package/dist/generateDocs.cjs +129 -3
- package/dist/generateDocs.cjs.map +1 -1
- package/dist/generateRule.cjs +3 -1
- package/dist/generateRule.cjs.map +1 -1
- package/dist/generateRuleTypes.cjs +5 -5
- package/dist/generateRuleTypes.cjs.map +1 -1
- package/dist/index-cjs.cjs +30 -0
- package/dist/index-cjs.cjs.map +1 -1
- package/dist/index.cjs +30 -0
- package/dist/index.cjs.map +1 -1
- package/dist/rules/checkAccess.cjs +1 -1
- package/dist/rules/checkAccess.cjs.map +1 -1
- package/dist/rules/checkAlignment.cjs +4 -1
- package/dist/rules/checkAlignment.cjs.map +1 -1
- package/dist/rules/checkExamples.cjs +1 -1
- package/dist/rules/checkExamples.cjs.map +1 -1
- package/dist/rules/checkIndentation.cjs +19 -0
- package/dist/rules/checkIndentation.cjs.map +1 -1
- package/dist/rules/checkLineAlignment.cjs +25 -1
- package/dist/rules/checkLineAlignment.cjs.map +1 -1
- package/dist/rules/checkParamNames.cjs +62 -1
- package/dist/rules/checkParamNames.cjs.map +1 -1
- package/dist/rules/checkPropertyNames.cjs +6 -0
- package/dist/rules/checkPropertyNames.cjs.map +1 -1
- package/dist/rules/checkTagNames.cjs +71 -0
- package/dist/rules/checkTagNames.cjs.map +1 -1
- package/dist/rules/checkTypes.cjs +16 -1
- package/dist/rules/checkTypes.cjs.map +1 -1
- package/dist/rules/checkValues.cjs +17 -1
- package/dist/rules/checkValues.cjs.map +1 -1
- package/dist/rules/convertToJsdocComments.cjs +48 -0
- package/dist/rules/convertToJsdocComments.cjs.map +1 -1
- package/dist/rules/convertToJsdocComments.d.ts +7 -0
- package/dist/rules/emptyTags.cjs +10 -1
- package/dist/rules/emptyTags.cjs.map +1 -1
- package/dist/rules/implementsOnClasses.cjs +15 -1
- package/dist/rules/implementsOnClasses.cjs.map +1 -1
- package/dist/rules/informativeDocs.cjs +45 -0
- package/dist/rules/informativeDocs.cjs.map +1 -1
- package/dist/rules/linesBeforeBlock.cjs +14 -0
- package/dist/rules/linesBeforeBlock.cjs.map +1 -1
- package/dist/rules/matchDescription.cjs +129 -0
- package/dist/rules/matchDescription.cjs.map +1 -1
- package/dist/rules/matchName.cjs +30 -0
- package/dist/rules/matchName.cjs.map +1 -1
- package/dist/rules/multilineBlocks.cjs +78 -6
- package/dist/rules/multilineBlocks.cjs.map +1 -1
- package/dist/rules/noBadBlocks.cjs +11 -2
- package/dist/rules/noBadBlocks.cjs.map +1 -1
- package/dist/rules/noBlankBlockDescriptions.cjs +1 -1
- package/dist/rules/noBlankBlockDescriptions.cjs.map +1 -1
- package/dist/rules/noBlankBlocks.cjs +3 -1
- package/dist/rules/noBlankBlocks.cjs.map +1 -1
- package/dist/rules/noDefaults.cjs +19 -0
- package/dist/rules/noDefaults.cjs.map +1 -1
- package/dist/rules/noMissingSyntax.cjs +22 -2
- package/dist/rules/noMissingSyntax.cjs.map +1 -1
- package/dist/rules/noMultiAsterisks.cjs +29 -0
- package/dist/rules/noMultiAsterisks.cjs.map +1 -1
- package/dist/rules/noRestrictedSyntax.cjs +17 -1
- package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
- package/dist/rules/noTypes.cjs +17 -1
- package/dist/rules/noTypes.cjs.map +1 -1
- package/dist/rules/noUndefinedTypes.cjs +11 -1
- package/dist/rules/noUndefinedTypes.cjs.map +1 -1
- package/dist/rules/requireAsteriskPrefix.cjs +28 -0
- package/dist/rules/requireAsteriskPrefix.cjs.map +1 -1
- package/dist/rules/requireDescription.cjs +30 -1
- package/dist/rules/requireDescription.cjs.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.cjs +27 -0
- package/dist/rules/requireDescriptionCompleteSentence.cjs.map +1 -1
- package/dist/rules/requireExample.cjs +26 -1
- package/dist/rules/requireExample.cjs.map +1 -1
- package/dist/rules/requireFileOverview.cjs +61 -0
- package/dist/rules/requireFileOverview.cjs.map +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.cjs +20 -2
- package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +1 -1
- package/dist/rules/requireJsdoc.cjs +82 -3
- package/dist/rules/requireJsdoc.cjs.map +1 -1
- package/dist/rules/requireParam.cjs +213 -1
- package/dist/rules/requireParam.cjs.map +1 -1
- package/dist/rules/requireParamDescription.cjs +21 -0
- package/dist/rules/requireParamDescription.cjs.map +1 -1
- package/dist/rules/requireParamName.cjs +16 -1
- package/dist/rules/requireParamName.cjs.map +1 -1
- package/dist/rules/requireParamType.cjs +21 -1
- package/dist/rules/requireParamType.cjs.map +1 -1
- package/dist/rules/requirePropertyName.cjs +1 -1
- package/dist/rules/requirePropertyName.cjs.map +1 -1
- package/dist/rules/requirePropertyType.cjs +1 -1
- package/dist/rules/requirePropertyType.cjs.map +1 -1
- package/dist/rules/requireReturns.cjs +54 -1
- package/dist/rules/requireReturns.cjs.map +1 -1
- package/dist/rules/requireReturnsCheck.cjs +22 -1
- package/dist/rules/requireReturnsCheck.cjs.map +1 -1
- package/dist/rules/requireReturnsDescription.cjs +15 -1
- package/dist/rules/requireReturnsDescription.cjs.map +1 -1
- package/dist/rules/requireReturnsType.cjs +15 -1
- package/dist/rules/requireReturnsType.cjs.map +1 -1
- package/dist/rules/requireTemplate.cjs +17 -1
- package/dist/rules/requireTemplate.cjs.map +1 -1
- package/dist/rules/requireThrows.cjs +18 -1
- package/dist/rules/requireThrows.cjs.map +1 -1
- package/dist/rules/requireYields.cjs +50 -1
- package/dist/rules/requireYields.cjs.map +1 -1
- package/dist/rules/requireYieldsCheck.cjs +25 -7
- package/dist/rules/requireYieldsCheck.cjs.map +1 -1
- package/dist/rules/sortTags.cjs +200 -1
- package/dist/rules/sortTags.cjs.map +1 -1
- package/dist/rules/tagLines.cjs +32 -2
- package/dist/rules/tagLines.cjs.map +1 -1
- package/dist/rules/textEscaping.cjs +5 -1
- package/dist/rules/textEscaping.cjs.map +1 -1
- package/dist/rules/typeFormatting.cjs +64 -16
- package/dist/rules/typeFormatting.cjs.map +1 -1
- package/dist/rules/validTypes.cjs +8 -1
- package/dist/rules/validTypes.cjs.map +1 -1
- package/dist/rules.d.ts +2130 -32
- package/package.json +1 -1
- package/src/buildForbidRuleDefinition.js +0 -1
- package/src/buildRejectOrPreferRuleDefinition.js +12 -2
- package/src/index-cjs.js +36 -0
- package/src/index.js +36 -0
- package/src/rules/checkAccess.js +1 -1
- package/src/rules/checkAlignment.js +3 -0
- package/src/rules/checkExamples.js +1 -1
- package/src/rules/checkIndentation.js +19 -0
- package/src/rules/checkLineAlignment.js +24 -0
- package/src/rules/checkParamNames.js +62 -1
- package/src/rules/checkPropertyNames.js +6 -0
- package/src/rules/checkTagNames.js +71 -0
- package/src/rules/checkTypes.js +16 -1
- package/src/rules/checkValues.js +16 -0
- package/src/rules/convertToJsdocComments.js +48 -0
- package/src/rules/emptyTags.js +10 -1
- package/src/rules/implementsOnClasses.js +15 -1
- package/src/rules/informativeDocs.js +45 -0
- package/src/rules/linesBeforeBlock.js +14 -0
- package/src/rules/matchDescription.js +129 -0
- package/src/rules/matchName.js +30 -0
- package/src/rules/multilineBlocks.js +77 -5
- package/src/rules/noBadBlocks.js +11 -2
- package/src/rules/noBlankBlockDescriptions.js +1 -1
- package/src/rules/noBlankBlocks.js +2 -0
- package/src/rules/noDefaults.js +19 -0
- package/src/rules/noMissingSyntax.js +22 -2
- package/src/rules/noMultiAsterisks.js +29 -0
- package/src/rules/noRestrictedSyntax.js +17 -1
- package/src/rules/noTypes.js +17 -1
- package/src/rules/noUndefinedTypes.js +11 -1
- package/src/rules/requireAsteriskPrefix.js +28 -0
- package/src/rules/requireDescription.js +30 -1
- package/src/rules/requireDescriptionCompleteSentence.js +27 -0
- package/src/rules/requireExample.js +26 -1
- package/src/rules/requireFileOverview.js +61 -0
- package/src/rules/requireHyphenBeforeParamDescription.js +19 -1
- package/src/rules/requireJsdoc.js +80 -1
- package/src/rules/requireParam.js +213 -1
- package/src/rules/requireParamDescription.js +21 -0
- package/src/rules/requireParamName.js +16 -1
- package/src/rules/requireParamType.js +21 -1
- package/src/rules/requirePropertyName.js +1 -1
- package/src/rules/requirePropertyType.js +1 -1
- package/src/rules/requireReturns.js +54 -1
- package/src/rules/requireReturnsCheck.js +22 -1
- package/src/rules/requireReturnsDescription.js +15 -1
- package/src/rules/requireReturnsType.js +15 -1
- package/src/rules/requireTemplate.js +17 -1
- package/src/rules/requireThrows.js +18 -1
- package/src/rules/requireYields.js +50 -1
- package/src/rules/requireYieldsCheck.js +25 -7
- package/src/rules/sortTags.js +200 -1
- package/src/rules/tagLines.js +30 -0
- package/src/rules/textEscaping.js +5 -1
- package/src/rules/typeFormatting.js +57 -19
- package/src/rules/validTypes.js +8 -1
- package/src/rules.d.ts +2130 -32
- package/typings/gitdown.d.ts +4 -0
|
@@ -258,15 +258,42 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
258
258
|
additionalProperties: false,
|
|
259
259
|
properties: {
|
|
260
260
|
abbreviations: {
|
|
261
|
+
description: `You can provide an \`abbreviations\` options array to avoid such strings of text
|
|
262
|
+
being treated as sentence endings when followed by dots. The \`.\` is not
|
|
263
|
+
necessary at the end of the array items.`,
|
|
261
264
|
items: {
|
|
262
265
|
type: 'string'
|
|
263
266
|
},
|
|
264
267
|
type: 'array'
|
|
265
268
|
},
|
|
266
269
|
newlineBeforeCapsAssumesBadSentenceEnd: {
|
|
270
|
+
description: `When \`false\` (the new default), we will not assume capital letters after
|
|
271
|
+
newlines are an incorrect way to end the sentence (they may be proper
|
|
272
|
+
nouns, for example).`,
|
|
267
273
|
type: 'boolean'
|
|
268
274
|
},
|
|
269
275
|
tags: {
|
|
276
|
+
description: `If you want additional tags to be checked for their descriptions, you may
|
|
277
|
+
add them within this option.
|
|
278
|
+
|
|
279
|
+
\`\`\`js
|
|
280
|
+
{
|
|
281
|
+
'jsdoc/require-description-complete-sentence': ['error', {
|
|
282
|
+
tags: ['see', 'copyright']
|
|
283
|
+
}]
|
|
284
|
+
}
|
|
285
|
+
\`\`\`
|
|
286
|
+
|
|
287
|
+
The tags \`@param\`/\`@arg\`/\`@argument\` and \`@property\`/\`@prop\` will be properly
|
|
288
|
+
parsed to ensure that the checked "description" text includes only the text
|
|
289
|
+
after the name.
|
|
290
|
+
|
|
291
|
+
All other tags will treat the text following the tag name, a space, and
|
|
292
|
+
an optional curly-bracketed type expression (and another space) as part of
|
|
293
|
+
its "description" (e.g., for \`@returns {someType} some description\`, the
|
|
294
|
+
description is \`some description\` while for \`@some-tag xyz\`, the description
|
|
295
|
+
is \`xyz\`).
|
|
296
|
+
`,
|
|
270
297
|
items: {
|
|
271
298
|
type: 'string'
|
|
272
299
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireDescriptionCompleteSentence.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_escapeStringRegexp","e","__esModule","default","otherDescriptiveTags","Set","extractParagraphs","text","split","extractSentences","abbreviationsRegex","txt","replaceAll","replace","sentenceEndGrouping","puncts","matchAll","map","sentEnd","sentence","idx","test","isNewLinePrecededByAPeriod","lastLineEndsSentence","lines","some","line","isCapitalized","str","toUpperCase","isTable","charAt","capitalize","slice","validateDescription","description","reportOrig","jsdocNode","sourceCode","tag","newlineBeforeCapsAssumesBadSentenceEnd","descriptionNoHeadings","paragraphs","filter","Boolean","paragraph","parIdx","sentences","fix","fixer","getText","findLast","RegExp","escapeStringRegexp","sentence_","beginning","reg","_$0","$1","replaceText","report","msg","tagObj","source","number","column","paragraphNoAbbreviations","_default","exports","iterateJsdoc","context","jsdoc","utils","abbreviations","options","length","abbreviation","join","getDescription","indices","match","index","toReversed","forEachPreferredTag","matchingJsdocTag","desc","name","getTagDescription","trim","tagsWithNames","getTagsByType","tags","tagsWithoutNames","filterTags","tagName","has","hasOptionTag","trimEnd","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","items","type","module"],"sources":["../../src/rules/requireDescriptionCompleteSentence.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport escapeStringRegexp from 'escape-string-regexp';\n\nconst otherDescriptiveTags = new Set([\n 'classdesc', 'deprecated', 'exception', 'file', 'fileoverview', 'overview',\n // 'copyright' and 'see' might be good addition, but as the former may be\n // sensitive text, and the latter may have just a link, they are not\n // included by default\n 'summary', 'throws', 'todo', 'yield', 'yields',\n]);\n\n/**\n * @param {string} text\n * @returns {string[]}\n */\nconst extractParagraphs = (text) => {\n return text.split(/(?<![;:])\\n\\n+/v);\n};\n\n/**\n * @param {string} text\n * @param {string|RegExp} abbreviationsRegex\n * @returns {string[]}\n */\nconst extractSentences = (text, abbreviationsRegex) => {\n const txt = text\n // Remove all {} tags.\n .replaceAll(/(?<!^)\\{[\\s\\S]*?\\}\\s*/gv, '')\n\n // Remove custom abbreviations\n .replace(abbreviationsRegex, '');\n\n const sentenceEndGrouping = /([.?!])(?:\\s+|$)/gv;\n\n const puncts = [\n ...txt.matchAll(sentenceEndGrouping),\n ].map((sentEnd) => {\n return sentEnd[0];\n });\n\n return txt\n .split(/[.?!](?:\\s+|$)/v)\n\n // Re-add the dot.\n .map((sentence, idx) => {\n return !puncts[idx] && /^\\s*$/v.test(sentence) ? sentence : `${sentence}${puncts[idx] || ''}`;\n });\n};\n\n/**\n * @param {string} text\n * @returns {boolean}\n */\nconst isNewLinePrecededByAPeriod = (text) => {\n /** @type {boolean} */\n let lastLineEndsSentence;\n\n const lines = text.split('\\n');\n\n return !lines.some((line) => {\n if (lastLineEndsSentence === false && /^[A-Z][a-z]/v.test(line)) {\n return true;\n }\n\n lastLineEndsSentence = /[.:?!\\|]$/v.test(line);\n\n return false;\n });\n};\n\n/**\n * @param {string} str\n * @returns {boolean}\n */\nconst isCapitalized = (str) => {\n return str[0] === str[0].toUpperCase();\n};\n\n/**\n * @param {string} str\n * @returns {boolean}\n */\nconst isTable = (str) => {\n return str.charAt(0) === '|';\n};\n\n/**\n * @param {string} str\n * @returns {string}\n */\nconst capitalize = (str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\n/**\n * @param {string} description\n * @param {import('../iterateJsdoc.js').Report} reportOrig\n * @param {import('eslint').Rule.Node} jsdocNode\n * @param {string|RegExp} abbreviationsRegex\n * @param {import('eslint').SourceCode} sourceCode\n * @param {import('comment-parser').Spec|{\n * line: import('../iterateJsdoc.js').Integer\n * }} tag\n * @param {boolean} newlineBeforeCapsAssumesBadSentenceEnd\n * @returns {boolean}\n */\nconst validateDescription = (\n description, reportOrig, jsdocNode, abbreviationsRegex,\n sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd,\n) => {\n if (!description || (/^\\n+$/v).test(description)) {\n return false;\n }\n\n const descriptionNoHeadings = description.replaceAll(/^\\s*#[^\\n]*(\\n|$)/gmv, '');\n\n const paragraphs = extractParagraphs(descriptionNoHeadings).filter(Boolean);\n\n return paragraphs.some((paragraph, parIdx) => {\n const sentences = extractSentences(paragraph, abbreviationsRegex);\n\n const fix = /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {\n let text = sourceCode.getText(jsdocNode);\n\n if (!/[.:?!]$/v.test(paragraph)) {\n const line = paragraph.split('\\n').findLast(Boolean);\n text = text.replace(new RegExp(`${escapeStringRegexp(\n /** @type {string} */\n (line),\n )}$`, 'mv'), `${line}.`);\n }\n\n for (const sentence of sentences.filter((sentence_) => {\n return !(/^\\s*$/v).test(sentence_) && !isCapitalized(sentence_) &&\n !isTable(sentence_);\n })) {\n const beginning = sentence.split('\\n')[0];\n\n if ('tag' in tag && tag.tag) {\n const reg = new RegExp(`(@${escapeStringRegexp(tag.tag)}.*)${escapeStringRegexp(beginning)}`, 'v');\n\n text = text.replace(reg, (_$0, $1) => {\n return $1 + capitalize(beginning);\n });\n } else {\n text = text.replace(new RegExp('((?:[.?!]|\\\\*|\\\\})\\\\s*)' + escapeStringRegexp(beginning), 'v'), '$1' + capitalize(beginning));\n }\n }\n\n return fixer.replaceText(jsdocNode, text);\n };\n\n /**\n * @param {string} msg\n * @param {import('eslint').Rule.ReportFixer | null | undefined} fixer\n * @param {{\n * line?: number | undefined;\n * column?: number | undefined;\n * } | (import('comment-parser').Spec & {\n * line?: number | undefined;\n * column?: number | undefined;\n * })} tagObj\n * @returns {void}\n */\n const report = (msg, fixer, tagObj) => {\n if ('line' in tagObj) {\n /**\n * @type {{\n * line: number;\n * }}\n */ (tagObj).line += parIdx * 2;\n } else {\n /** @type {import('comment-parser').Spec} */ (\n tagObj\n ).source[0].number += parIdx * 2;\n }\n\n // Avoid errors if old column doesn't exist here\n tagObj.column = 0;\n reportOrig(msg, fixer, tagObj);\n };\n\n if (sentences.some((sentence) => {\n return (/^[.?!]$/v).test(sentence);\n })) {\n report('Sentences must be more than punctuation.', null, tag);\n }\n\n if (sentences.some((sentence) => {\n return !(/^\\s*$/v).test(sentence) && !isCapitalized(sentence) && !isTable(sentence);\n })) {\n report('Sentences should start with an uppercase character.', fix, tag);\n }\n\n const paragraphNoAbbreviations = paragraph.replace(abbreviationsRegex, '');\n\n if (!/(?:[.?!\\|]|```)\\s*$/v.test(paragraphNoAbbreviations)) {\n report('Sentences must end with a period.', fix, tag);\n return true;\n }\n\n if (newlineBeforeCapsAssumesBadSentenceEnd && !isNewLinePrecededByAPeriod(paragraphNoAbbreviations)) {\n report('A line of text is started with an uppercase character, but the preceding line does not end the sentence.', null, tag);\n\n return true;\n }\n\n return false;\n });\n};\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n jsdocNode,\n report,\n sourceCode,\n utils,\n}) => {\n const /** @type {{abbreviations: string[], newlineBeforeCapsAssumesBadSentenceEnd: boolean}} */ {\n abbreviations = [],\n newlineBeforeCapsAssumesBadSentenceEnd = false,\n } = context.options[0] || {};\n\n const abbreviationsRegex = abbreviations.length ?\n new RegExp('\\\\b' + abbreviations.map((abbreviation) => {\n return escapeStringRegexp(abbreviation.replaceAll(/\\.$/gv, '') + '.');\n }).join('|') + '(?:$|\\\\s)', 'gv') :\n '';\n\n let {\n description,\n } = utils.getDescription();\n\n const indices = [\n ...description.matchAll(/```[\\s\\S]*```/gv),\n ].map((match) => {\n const {\n index,\n } = match;\n const [\n {\n length,\n },\n ] = match;\n return {\n index,\n length,\n };\n }).toReversed();\n\n for (const {\n index,\n length,\n } of indices) {\n description = description.slice(0, index) +\n description.slice(/** @type {import('../iterateJsdoc.js').Integer} */ (\n index\n ) + length);\n }\n\n if (validateDescription(description, report, jsdocNode, abbreviationsRegex, sourceCode, {\n line: jsdoc.source[0].number + 1,\n }, newlineBeforeCapsAssumesBadSentenceEnd)) {\n return;\n }\n\n utils.forEachPreferredTag('description', (matchingJsdocTag) => {\n const desc = `${matchingJsdocTag.name} ${utils.getTagDescription(matchingJsdocTag)}`.trim();\n validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, matchingJsdocTag, newlineBeforeCapsAssumesBadSentenceEnd);\n }, true);\n\n const {\n tagsWithNames,\n } = utils.getTagsByType(jsdoc.tags);\n const tagsWithoutNames = utils.filterTags(({\n tag: tagName,\n }) => {\n return otherDescriptiveTags.has(tagName) ||\n utils.hasOptionTag(tagName) && !tagsWithNames.some(({\n tag,\n }) => {\n // If user accidentally adds tags with names (or like `returns`\n // get parsed as having names), do not add to this list\n return tag === tagName;\n });\n });\n\n tagsWithNames.some((tag) => {\n const desc = /** @type {string} */ (\n utils.getTagDescription(tag)\n ).replace(/^- /v, '').trimEnd();\n\n return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd);\n });\n\n tagsWithoutNames.some((tag) => {\n const desc = `${tag.name} ${utils.getTagDescription(tag)}`.trim();\n\n return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd);\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires that block description, explicit `@description`, and `@param`/`@returns` tag descriptions are written in complete sentences.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-description-complete-sentence.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n abbreviations: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n newlineBeforeCapsAssumesBadSentenceEnd: {\n type: 'boolean',\n },\n tags: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAsD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtD,MAAMG,oBAAoB,GAAG,IAAIC,GAAG,CAAC,CACnC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU;AAC1E;AACA;AACA;AACA,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAC/C,CAAC;;AAEF;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAIC,IAAI,IAAK;EAClC,OAAOA,IAAI,CAACC,KAAK,CAAC,iBAAiB,CAAC;AACtC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAACF,IAAI,EAAEG,kBAAkB,KAAK;EACrD,MAAMC,GAAG,GAAGJ;EACV;EAAA,CACCK,UAAU,CAAC,yBAAyB,EAAE,EAAE;;EAEzC;EAAA,CACCC,OAAO,CAACH,kBAAk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EAAE3B,kBAAkB,EAAE4B,UAAU,EAAEC,GAAG,EAAEC,sCAAsC,CAAC;EAClI,CAAC,CAAC;EAEFoD,gBAAgB,CAACnE,IAAI,CAAEc,GAAG,IAAK;IAC7B,MAAM8C,IAAI,GAAG,GAAG9C,GAAG,CAAC+C,IAAI,IAAId,KAAK,CAACe,iBAAiB,CAAChD,GAAG,CAAC,EAAE,CAACiD,IAAI,CAAC,CAAC;IAEjE,OAAOtD,mBAAmB,CAACmD,IAAI,EAAEzB,MAAM,EAAEvB,SAAS,EAAE3B,kBAAkB,EAAE4B,UAAU,EAAEC,GAAG,EAAEC,sCAAsC,CAAC;EAClI,CAAC,CAAC;AACJ,CAAC,EAAE;EACD0D,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJjE,WAAW,EAAE,uIAAuI;MACpJkE,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVhC,aAAa,EAAE;UACbiC,KAAK,EAAE;YACLC,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDnE,sCAAsC,EAAE;UACtCmE,IAAI,EAAE;QACR,CAAC;QACDhB,IAAI,EAAE;UACJe,KAAK,EAAE;YACLC,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAC,MAAA,CAAAxC,OAAA,GAAAA,OAAA,CAAAjE,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"requireDescriptionCompleteSentence.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_escapeStringRegexp","e","__esModule","default","otherDescriptiveTags","Set","extractParagraphs","text","split","extractSentences","abbreviationsRegex","txt","replaceAll","replace","sentenceEndGrouping","puncts","matchAll","map","sentEnd","sentence","idx","test","isNewLinePrecededByAPeriod","lastLineEndsSentence","lines","some","line","isCapitalized","str","toUpperCase","isTable","charAt","capitalize","slice","validateDescription","description","reportOrig","jsdocNode","sourceCode","tag","newlineBeforeCapsAssumesBadSentenceEnd","descriptionNoHeadings","paragraphs","filter","Boolean","paragraph","parIdx","sentences","fix","fixer","getText","findLast","RegExp","escapeStringRegexp","sentence_","beginning","reg","_$0","$1","replaceText","report","msg","tagObj","source","number","column","paragraphNoAbbreviations","_default","exports","iterateJsdoc","context","jsdoc","utils","abbreviations","options","length","abbreviation","join","getDescription","indices","match","index","toReversed","forEachPreferredTag","matchingJsdocTag","desc","name","getTagDescription","trim","tagsWithNames","getTagsByType","tags","tagsWithoutNames","filterTags","tagName","has","hasOptionTag","trimEnd","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","items","type","module"],"sources":["../../src/rules/requireDescriptionCompleteSentence.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport escapeStringRegexp from 'escape-string-regexp';\n\nconst otherDescriptiveTags = new Set([\n 'classdesc', 'deprecated', 'exception', 'file', 'fileoverview', 'overview',\n // 'copyright' and 'see' might be good addition, but as the former may be\n // sensitive text, and the latter may have just a link, they are not\n // included by default\n 'summary', 'throws', 'todo', 'yield', 'yields',\n]);\n\n/**\n * @param {string} text\n * @returns {string[]}\n */\nconst extractParagraphs = (text) => {\n return text.split(/(?<![;:])\\n\\n+/v);\n};\n\n/**\n * @param {string} text\n * @param {string|RegExp} abbreviationsRegex\n * @returns {string[]}\n */\nconst extractSentences = (text, abbreviationsRegex) => {\n const txt = text\n // Remove all {} tags.\n .replaceAll(/(?<!^)\\{[\\s\\S]*?\\}\\s*/gv, '')\n\n // Remove custom abbreviations\n .replace(abbreviationsRegex, '');\n\n const sentenceEndGrouping = /([.?!])(?:\\s+|$)/gv;\n\n const puncts = [\n ...txt.matchAll(sentenceEndGrouping),\n ].map((sentEnd) => {\n return sentEnd[0];\n });\n\n return txt\n .split(/[.?!](?:\\s+|$)/v)\n\n // Re-add the dot.\n .map((sentence, idx) => {\n return !puncts[idx] && /^\\s*$/v.test(sentence) ? sentence : `${sentence}${puncts[idx] || ''}`;\n });\n};\n\n/**\n * @param {string} text\n * @returns {boolean}\n */\nconst isNewLinePrecededByAPeriod = (text) => {\n /** @type {boolean} */\n let lastLineEndsSentence;\n\n const lines = text.split('\\n');\n\n return !lines.some((line) => {\n if (lastLineEndsSentence === false && /^[A-Z][a-z]/v.test(line)) {\n return true;\n }\n\n lastLineEndsSentence = /[.:?!\\|]$/v.test(line);\n\n return false;\n });\n};\n\n/**\n * @param {string} str\n * @returns {boolean}\n */\nconst isCapitalized = (str) => {\n return str[0] === str[0].toUpperCase();\n};\n\n/**\n * @param {string} str\n * @returns {boolean}\n */\nconst isTable = (str) => {\n return str.charAt(0) === '|';\n};\n\n/**\n * @param {string} str\n * @returns {string}\n */\nconst capitalize = (str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\n/**\n * @param {string} description\n * @param {import('../iterateJsdoc.js').Report} reportOrig\n * @param {import('eslint').Rule.Node} jsdocNode\n * @param {string|RegExp} abbreviationsRegex\n * @param {import('eslint').SourceCode} sourceCode\n * @param {import('comment-parser').Spec|{\n * line: import('../iterateJsdoc.js').Integer\n * }} tag\n * @param {boolean} newlineBeforeCapsAssumesBadSentenceEnd\n * @returns {boolean}\n */\nconst validateDescription = (\n description, reportOrig, jsdocNode, abbreviationsRegex,\n sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd,\n) => {\n if (!description || (/^\\n+$/v).test(description)) {\n return false;\n }\n\n const descriptionNoHeadings = description.replaceAll(/^\\s*#[^\\n]*(\\n|$)/gmv, '');\n\n const paragraphs = extractParagraphs(descriptionNoHeadings).filter(Boolean);\n\n return paragraphs.some((paragraph, parIdx) => {\n const sentences = extractSentences(paragraph, abbreviationsRegex);\n\n const fix = /** @type {import('eslint').Rule.ReportFixer} */ (fixer) => {\n let text = sourceCode.getText(jsdocNode);\n\n if (!/[.:?!]$/v.test(paragraph)) {\n const line = paragraph.split('\\n').findLast(Boolean);\n text = text.replace(new RegExp(`${escapeStringRegexp(\n /** @type {string} */\n (line),\n )}$`, 'mv'), `${line}.`);\n }\n\n for (const sentence of sentences.filter((sentence_) => {\n return !(/^\\s*$/v).test(sentence_) && !isCapitalized(sentence_) &&\n !isTable(sentence_);\n })) {\n const beginning = sentence.split('\\n')[0];\n\n if ('tag' in tag && tag.tag) {\n const reg = new RegExp(`(@${escapeStringRegexp(tag.tag)}.*)${escapeStringRegexp(beginning)}`, 'v');\n\n text = text.replace(reg, (_$0, $1) => {\n return $1 + capitalize(beginning);\n });\n } else {\n text = text.replace(new RegExp('((?:[.?!]|\\\\*|\\\\})\\\\s*)' + escapeStringRegexp(beginning), 'v'), '$1' + capitalize(beginning));\n }\n }\n\n return fixer.replaceText(jsdocNode, text);\n };\n\n /**\n * @param {string} msg\n * @param {import('eslint').Rule.ReportFixer | null | undefined} fixer\n * @param {{\n * line?: number | undefined;\n * column?: number | undefined;\n * } | (import('comment-parser').Spec & {\n * line?: number | undefined;\n * column?: number | undefined;\n * })} tagObj\n * @returns {void}\n */\n const report = (msg, fixer, tagObj) => {\n if ('line' in tagObj) {\n /**\n * @type {{\n * line: number;\n * }}\n */ (tagObj).line += parIdx * 2;\n } else {\n /** @type {import('comment-parser').Spec} */ (\n tagObj\n ).source[0].number += parIdx * 2;\n }\n\n // Avoid errors if old column doesn't exist here\n tagObj.column = 0;\n reportOrig(msg, fixer, tagObj);\n };\n\n if (sentences.some((sentence) => {\n return (/^[.?!]$/v).test(sentence);\n })) {\n report('Sentences must be more than punctuation.', null, tag);\n }\n\n if (sentences.some((sentence) => {\n return !(/^\\s*$/v).test(sentence) && !isCapitalized(sentence) && !isTable(sentence);\n })) {\n report('Sentences should start with an uppercase character.', fix, tag);\n }\n\n const paragraphNoAbbreviations = paragraph.replace(abbreviationsRegex, '');\n\n if (!/(?:[.?!\\|]|```)\\s*$/v.test(paragraphNoAbbreviations)) {\n report('Sentences must end with a period.', fix, tag);\n return true;\n }\n\n if (newlineBeforeCapsAssumesBadSentenceEnd && !isNewLinePrecededByAPeriod(paragraphNoAbbreviations)) {\n report('A line of text is started with an uppercase character, but the preceding line does not end the sentence.', null, tag);\n\n return true;\n }\n\n return false;\n });\n};\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n jsdocNode,\n report,\n sourceCode,\n utils,\n}) => {\n const /** @type {{abbreviations: string[], newlineBeforeCapsAssumesBadSentenceEnd: boolean}} */ {\n abbreviations = [],\n newlineBeforeCapsAssumesBadSentenceEnd = false,\n } = context.options[0] || {};\n\n const abbreviationsRegex = abbreviations.length ?\n new RegExp('\\\\b' + abbreviations.map((abbreviation) => {\n return escapeStringRegexp(abbreviation.replaceAll(/\\.$/gv, '') + '.');\n }).join('|') + '(?:$|\\\\s)', 'gv') :\n '';\n\n let {\n description,\n } = utils.getDescription();\n\n const indices = [\n ...description.matchAll(/```[\\s\\S]*```/gv),\n ].map((match) => {\n const {\n index,\n } = match;\n const [\n {\n length,\n },\n ] = match;\n return {\n index,\n length,\n };\n }).toReversed();\n\n for (const {\n index,\n length,\n } of indices) {\n description = description.slice(0, index) +\n description.slice(/** @type {import('../iterateJsdoc.js').Integer} */ (\n index\n ) + length);\n }\n\n if (validateDescription(description, report, jsdocNode, abbreviationsRegex, sourceCode, {\n line: jsdoc.source[0].number + 1,\n }, newlineBeforeCapsAssumesBadSentenceEnd)) {\n return;\n }\n\n utils.forEachPreferredTag('description', (matchingJsdocTag) => {\n const desc = `${matchingJsdocTag.name} ${utils.getTagDescription(matchingJsdocTag)}`.trim();\n validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, matchingJsdocTag, newlineBeforeCapsAssumesBadSentenceEnd);\n }, true);\n\n const {\n tagsWithNames,\n } = utils.getTagsByType(jsdoc.tags);\n const tagsWithoutNames = utils.filterTags(({\n tag: tagName,\n }) => {\n return otherDescriptiveTags.has(tagName) ||\n utils.hasOptionTag(tagName) && !tagsWithNames.some(({\n tag,\n }) => {\n // If user accidentally adds tags with names (or like `returns`\n // get parsed as having names), do not add to this list\n return tag === tagName;\n });\n });\n\n tagsWithNames.some((tag) => {\n const desc = /** @type {string} */ (\n utils.getTagDescription(tag)\n ).replace(/^- /v, '').trimEnd();\n\n return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd);\n });\n\n tagsWithoutNames.some((tag) => {\n const desc = `${tag.name} ${utils.getTagDescription(tag)}`.trim();\n\n return validateDescription(desc, report, jsdocNode, abbreviationsRegex, sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd);\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires that block description, explicit `@description`, and `@param`/`@returns` tag descriptions are written in complete sentences.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-description-complete-sentence.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n abbreviations: {\n description: `You can provide an \\`abbreviations\\` options array to avoid such strings of text\nbeing treated as sentence endings when followed by dots. The \\`.\\` is not\nnecessary at the end of the array items.`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n newlineBeforeCapsAssumesBadSentenceEnd: {\n description: `When \\`false\\` (the new default), we will not assume capital letters after\nnewlines are an incorrect way to end the sentence (they may be proper\nnouns, for example).`,\n type: 'boolean',\n },\n tags: {\n description: `If you want additional tags to be checked for their descriptions, you may\nadd them within this option.\n\n\\`\\`\\`js\n{\n 'jsdoc/require-description-complete-sentence': ['error', {\n tags: ['see', 'copyright']\n }]\n}\n\\`\\`\\`\n\nThe tags \\`@param\\`/\\`@arg\\`/\\`@argument\\` and \\`@property\\`/\\`@prop\\` will be properly\nparsed to ensure that the checked \"description\" text includes only the text\nafter the name.\n\nAll other tags will treat the text following the tag name, a space, and\nan optional curly-bracketed type expression (and another space) as part of\nits \"description\" (e.g., for \\`@returns {someType} some description\\`, the\ndescription is \\`some description\\` while for \\`@some-tag xyz\\`, the description\nis \\`xyz\\`).\n`,\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAsD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtD,MAAMG,oBAAoB,GAAG,IAAIC,GAAG,CAAC,CACnC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU;AAC1E;AACA;AACA;AACA,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAC/C,CAAC;;AAEF;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAIC,IAAI,IAAK;EAClC,OAAOA,IAAI,CAACC,KAAK,CAAC,iBAAiB,CAAC;AACtC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAACF,IAAI,EAAEG,kBAAkB,KAAK;EACrD,MAAMC,GAAG,GAAGJ;EACV;EAAA,CACCK,UAAU,CAAC,yBAAyB,EAAE,EAAE;;EAEzC;EAAA,CACCC,OAAO,CAACH,kBAAkB,EAAE,EAAE,CAAC;EAElC,MAAMI,mBAAmB,GAAG,oBAAoB;EAEhD,MAAMC,MAAM,GAAG,CACb,GAAGJ,GAAG,CAACK,QAAQ,CAACF,mBAAmB,CAAC,CACrC,CAACG,GAAG,CAAEC,OAAO,IAAK;IACjB,OAAOA,OAAO,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC;EAEF,OAAOP,GAAG,CACPH,KAAK,CAAC,iBAAiB;;EAExB;EAAA,CACCS,GAAG,CAAC,CAACE,QA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AAM,EAAEvB,SAAS,EAAE3B,kBAAkB,EAAE4B,UAAU,EAAEC,GAAG,EAAEC,sCAAsC,CAAC;EAClI,CAAC,CAAC;AACJ,CAAC,EAAE;EACD0D,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJjE,WAAW,EAAE,uIAAuI;MACpJkE,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVhC,aAAa,EAAE;UACbtC,WAAW,EAAE;AACzB;AACA,yCAAyC;UAC7BuE,KAAK,EAAE;YACLC,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDnE,sCAAsC,EAAE;UACtCL,WAAW,EAAE;AACzB;AACA,qBAAqB;UACTwE,IAAI,EAAE;QACR,CAAC;QACDhB,IAAI,EAAE;UACJxD,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;UACWuE,KAAK,EAAE;YACLC,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAC,MAAA,CAAAxC,OAAA,GAAAA,OAAA,CAAAjE,OAAA","ignoreList":[]}
|
|
@@ -46,7 +46,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
46
46
|
contextDefaults: true,
|
|
47
47
|
meta: {
|
|
48
48
|
docs: {
|
|
49
|
-
description: 'Requires that all functions have examples.',
|
|
49
|
+
description: 'Requires that all functions (and potentially other contexts) have examples.',
|
|
50
50
|
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-example.md#repos-sticky-header'
|
|
51
51
|
},
|
|
52
52
|
fixable: 'code',
|
|
@@ -55,17 +55,33 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
55
55
|
properties: {
|
|
56
56
|
checkConstructors: {
|
|
57
57
|
default: true,
|
|
58
|
+
description: `A value indicating whether \`constructor\`s should be checked.
|
|
59
|
+
Defaults to \`true\`.`,
|
|
58
60
|
type: 'boolean'
|
|
59
61
|
},
|
|
60
62
|
checkGetters: {
|
|
61
63
|
default: false,
|
|
64
|
+
description: 'A value indicating whether getters should be checked. Defaults to `false`.',
|
|
62
65
|
type: 'boolean'
|
|
63
66
|
},
|
|
64
67
|
checkSetters: {
|
|
65
68
|
default: false,
|
|
69
|
+
description: 'A value indicating whether setters should be checked. Defaults to `false`.',
|
|
66
70
|
type: 'boolean'
|
|
67
71
|
},
|
|
68
72
|
contexts: {
|
|
73
|
+
description: `Set this to an array of strings representing the AST context (or an object with
|
|
74
|
+
optional \`context\` and \`comment\` properties) where you wish the rule to be applied.
|
|
75
|
+
(e.g., \`ClassDeclaration\` for ES6 classes).
|
|
76
|
+
|
|
77
|
+
\`context\` defaults to \`any\` and \`comment\` defaults to no specific comment context.
|
|
78
|
+
|
|
79
|
+
Overrides the default contexts (\`ArrowFunctionExpression\`, \`FunctionDeclaration\`,
|
|
80
|
+
\`FunctionExpression\`). Set to \`"any"\` if you want the rule to apply to any
|
|
81
|
+
JSDoc block throughout your files.
|
|
82
|
+
|
|
83
|
+
See the ["AST and Selectors"](../#advanced-ast-and-selectors)
|
|
84
|
+
section of our Advanced docs for more on the expected format.`,
|
|
69
85
|
items: {
|
|
70
86
|
anyOf: [{
|
|
71
87
|
type: 'string'
|
|
@@ -86,9 +102,16 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
86
102
|
},
|
|
87
103
|
enableFixer: {
|
|
88
104
|
default: true,
|
|
105
|
+
description: `A boolean on whether to enable the fixer (which adds an empty \`@example\` block).
|
|
106
|
+
Defaults to \`true\`.`,
|
|
89
107
|
type: 'boolean'
|
|
90
108
|
},
|
|
91
109
|
exemptedBy: {
|
|
110
|
+
description: `Array of tags (e.g., \`['type']\`) whose presence on the document
|
|
111
|
+
block avoids the need for an \`@example\`. Defaults to an array with
|
|
112
|
+
\`inheritdoc\`. If you set this array, it will overwrite the default,
|
|
113
|
+
so be sure to add back \`inheritdoc\` if you wish its presence to cause
|
|
114
|
+
exemption of the rule.`,
|
|
92
115
|
items: {
|
|
93
116
|
type: 'string'
|
|
94
117
|
},
|
|
@@ -96,6 +119,8 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
96
119
|
},
|
|
97
120
|
exemptNoArguments: {
|
|
98
121
|
default: false,
|
|
122
|
+
description: `Boolean to indicate that no-argument functions should not be reported for
|
|
123
|
+
missing \`@example\` declarations.`,
|
|
99
124
|
type: 'boolean'
|
|
100
125
|
}
|
|
101
126
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireExample.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","jsdoc","report","utils","avoidDocs","enableFixer","exemptNoArguments","options","targetTagName","functionExamples","tags","filter","tag","length","isIteratingFunctionOrVariable","hasParams","reportJSDoc","addTag","example","exampleContent","name","getTagDescription","trim","split","Boolean","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","properties","checkConstructors","type","checkGetters","checkSetters","contexts","items","anyOf","comment","exemptedBy","module"],"sources":["../../src/rules/requireExample.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n report,\n utils,\n}) => {\n if (utils.avoidDocs()) {\n return;\n }\n\n const {\n enableFixer = true,\n exemptNoArguments = false,\n } = context.options[0] || {};\n\n const targetTagName = 'example';\n\n const functionExamples = jsdoc.tags.filter(({\n tag,\n }) => {\n return tag === targetTagName;\n });\n\n if (!functionExamples.length) {\n if (exemptNoArguments && utils.isIteratingFunctionOrVariable() &&\n !utils.hasParams()\n ) {\n return;\n }\n\n utils.reportJSDoc(`Missing JSDoc @${targetTagName} declaration.`, null, () => {\n if (enableFixer) {\n utils.addTag(targetTagName);\n }\n });\n\n return;\n }\n\n for (const example of functionExamples) {\n const exampleContent = `${example.name} ${utils.getTagDescription(example)}`\n .trim()\n .split('\\n')\n .filter(Boolean);\n\n if (!exampleContent.length) {\n report(`Missing JSDoc @${targetTagName} description.`, null, example);\n }\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all functions have examples.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-example.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n default: false,\n type: 'boolean',\n },\n checkSetters: {\n default: false,\n type: 'boolean',\n },\n contexts: {\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 default: true,\n type: 'boolean',\n },\n exemptedBy: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n exemptNoArguments: {\n default: false,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,IAAIA,KAAK,CAACC,SAAS,CAAC,CAAC,EAAE;IACrB;EACF;EAEA,MAAM;IACJC,WAAW,GAAG,IAAI;IAClBC,iBAAiB,GAAG;EACtB,CAAC,GAAGN,OAAO,CAACO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAMC,aAAa,GAAG,SAAS;EAE/B,MAAMC,gBAAgB,GAAGR,KAAK,CAACS,IAAI,CAACC,MAAM,CAAC,CAAC;IAC1CC;EACF,CAAC,KAAK;IACJ,OAAOA,GAAG,KAAKJ,aAAa;EAC9B,CAAC,CAAC;EAEF,IAAI,CAACC,gBAAgB,CAACI,MAAM,EAAE;IAC5B,IAAIP,iBAAiB,IAAIH,KAAK,CAACW,6BAA6B,CAAC,CAAC,IAC5D,CAACX,KAAK,CAACY,SAAS,CAAC,CAAC,EAClB;MACA;IACF;IAEAZ,KAAK,CAACa,WAAW,CAAC,kBAAkBR,aAAa,eAAe,EAAE,IAAI,EAAE,MAAM;MAC5E,IAAIH,WAAW,EAAE;QACfF,KAAK,CAACc,MAAM,CAACT,aAAa,CAAC;MAC7B;IACF,CAAC,CAAC;IAEF;EACF;EAEA,KAAK,MAAMU,OAAO,IAAIT,gBAAgB,EAAE;IACtC,MAAMU,cAAc,GAAG,GAAGD,OAAO,CAACE,IAAI,IAAIjB,KAAK,CAACkB,iBAAiB,CAACH,OAAO,CAAC,EAAE,CACzEI,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,IAAI,CAAC,CACXZ,MAAM,CAACa,OAAO,CAAC;IAElB,IAAI,CAACL,cAAc,CAACN,MAAM,EAAE;MAC1BX,MAAM,CAAC,kBAAkBM,aAAa,eAAe,EAAE,IAAI,EAAEU,OAAO,CAAC;IACvE;EACF;AACF,CAAC,EAAE;EACDO,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"requireExample.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","jsdoc","report","utils","avoidDocs","enableFixer","exemptNoArguments","options","targetTagName","functionExamples","tags","filter","tag","length","isIteratingFunctionOrVariable","hasParams","reportJSDoc","addTag","example","exampleContent","name","getTagDescription","trim","split","Boolean","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","properties","checkConstructors","type","checkGetters","checkSetters","contexts","items","anyOf","comment","exemptedBy","module"],"sources":["../../src/rules/requireExample.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n report,\n utils,\n}) => {\n if (utils.avoidDocs()) {\n return;\n }\n\n const {\n enableFixer = true,\n exemptNoArguments = false,\n } = context.options[0] || {};\n\n const targetTagName = 'example';\n\n const functionExamples = jsdoc.tags.filter(({\n tag,\n }) => {\n return tag === targetTagName;\n });\n\n if (!functionExamples.length) {\n if (exemptNoArguments && utils.isIteratingFunctionOrVariable() &&\n !utils.hasParams()\n ) {\n return;\n }\n\n utils.reportJSDoc(`Missing JSDoc @${targetTagName} declaration.`, null, () => {\n if (enableFixer) {\n utils.addTag(targetTagName);\n }\n });\n\n return;\n }\n\n for (const example of functionExamples) {\n const exampleContent = `${example.name} ${utils.getTagDescription(example)}`\n .trim()\n .split('\\n')\n .filter(Boolean);\n\n if (!exampleContent.length) {\n report(`Missing JSDoc @${targetTagName} description.`, null, example);\n }\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'Requires that all functions (and potentially other contexts) have examples.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-example.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: true,\n description: `A value indicating whether \\`constructor\\`s should be checked.\nDefaults 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 checkSetters: {\n default: false,\n description: 'A value indicating whether setters should be checked. Defaults to `false`.',\n type: 'boolean',\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(e.g., \\`ClassDeclaration\\` for ES6 classes).\n\n\\`context\\` defaults to \\`any\\` and \\`comment\\` defaults to no specific comment context.\n\nOverrides the default contexts (\\`ArrowFunctionExpression\\`, \\`FunctionDeclaration\\`,\n\\`FunctionExpression\\`). Set to \\`\"any\"\\` if you want the rule to apply to any\nJSDoc block throughout your files.\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 default: true,\n description: `A boolean on whether to enable the fixer (which adds an empty \\`@example\\` block).\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n exemptedBy: {\n description: `Array of tags (e.g., \\`['type']\\`) whose presence on the document\nblock avoids the need for an \\`@example\\`. 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 exemptNoArguments: {\n default: false,\n description: `Boolean to indicate that no-argument functions should not be reported for\nmissing \\`@example\\` declarations.`,\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,IAA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,MAAA,CAAA7C,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
|
|
@@ -98,6 +98,67 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
98
98
|
additionalProperties: false,
|
|
99
99
|
properties: {
|
|
100
100
|
tags: {
|
|
101
|
+
description: `The keys of this object are tag names, and the values are configuration
|
|
102
|
+
objects indicating what will be checked for these whole-file tags.
|
|
103
|
+
|
|
104
|
+
Each configuration object has 3 potential boolean keys (which default
|
|
105
|
+
to \`false\` when this option is supplied).
|
|
106
|
+
|
|
107
|
+
1. \`mustExist\` - enforces that all files have a \`@file\`, \`@fileoverview\`, or \`@overview\` tag.
|
|
108
|
+
2. \`preventDuplicates\` - enforces that duplicate file overview tags within a given file will be reported
|
|
109
|
+
3. \`initialCommentsOnly\` - reports file overview tags which are not, as per
|
|
110
|
+
[the docs](https://jsdoc.app/tags-file.html), "at the beginning of
|
|
111
|
+
the file"–where beginning of the file is interpreted in this rule
|
|
112
|
+
as being when the overview tag is not preceded by anything other than
|
|
113
|
+
a comment.
|
|
114
|
+
|
|
115
|
+
When no \`tags\` is present, the default is:
|
|
116
|
+
|
|
117
|
+
\`\`\`json
|
|
118
|
+
{
|
|
119
|
+
"file": {
|
|
120
|
+
"initialCommentsOnly": true,
|
|
121
|
+
"mustExist": true,
|
|
122
|
+
"preventDuplicates": true,
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
\`\`\`
|
|
126
|
+
|
|
127
|
+
You can add additional tag names and/or override \`file\` if you supply this
|
|
128
|
+
option, e.g., in place of or in addition to \`file\`, giving other potential
|
|
129
|
+
file global tags like \`@license\`, \`@copyright\`, \`@author\`, \`@module\` or
|
|
130
|
+
\`@exports\`, optionally restricting them to a single use or preventing them
|
|
131
|
+
from being preceded by anything besides comments.
|
|
132
|
+
|
|
133
|
+
For example:
|
|
134
|
+
|
|
135
|
+
\`\`\`js
|
|
136
|
+
{
|
|
137
|
+
"license": {
|
|
138
|
+
"mustExist": true,
|
|
139
|
+
"preventDuplicates": true,
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
This would require one and only one \`@license\` in the file, though because
|
|
145
|
+
\`initialCommentsOnly\` is absent and defaults to \`false\`, the \`@license\`
|
|
146
|
+
can be anywhere.
|
|
147
|
+
|
|
148
|
+
In the case of \`@license\`, you can use this rule along with the
|
|
149
|
+
\`check-values\` rule (with its \`allowedLicenses\` or \`licensePattern\` options),
|
|
150
|
+
to enforce a license whitelist be present on every JS file.
|
|
151
|
+
|
|
152
|
+
Note that if you choose to use \`preventDuplicates\` with \`license\`, you still
|
|
153
|
+
have a way to allow multiple licenses for the whole page by using the SPDX
|
|
154
|
+
"AND" expression, e.g., \`@license (MIT AND GPL-3.0)\`.
|
|
155
|
+
|
|
156
|
+
Note that the tag names are the main JSDoc tag name, so you should use \`file\`
|
|
157
|
+
in this configuration object regardless of whether you have configured
|
|
158
|
+
\`fileoverview\` instead of \`file\` on \`tagNamePreference\` (i.e., \`fileoverview\`
|
|
159
|
+
will be checked, but you must use \`file\` on the configuration object).
|
|
160
|
+
|
|
161
|
+
`,
|
|
101
162
|
patternProperties: {
|
|
102
163
|
'.*': {
|
|
103
164
|
additionalProperties: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireFileOverview.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","defaultTags","file","initialCommentsOnly","mustExist","preventDuplicates","setDefaults","state","globalTags","hasDuplicates","hasTag","hasNonCommentBeforeTag","_default","exports","iterateJsdoc","context","jsdocNode","utils","tags","options","tagName","Object","keys","targetTagName","getPreferredTagName","Boolean","hasDuplicate","hasNonComment","range","exit","entries","obj","getPreferredTagNameObject","reportSettings","replacement","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","patternProperties","type","nonComment","node","module"],"sources":["../../src/rules/requireFileOverview.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nconst defaultTags = {\n file: {\n initialCommentsOnly: true,\n mustExist: true,\n preventDuplicates: true,\n },\n};\n\n/**\n * @param {import('../iterateJsdoc.js').StateObject} state\n * @returns {void}\n */\nconst setDefaults = (state) => {\n // First iteration\n if (!state.globalTags) {\n state.globalTags = {};\n state.hasDuplicates = {};\n state.hasTag = {};\n state.hasNonCommentBeforeTag = {};\n }\n};\n\nexport default iterateJsdoc(({\n context,\n jsdocNode,\n state,\n utils,\n}) => {\n const {\n tags = defaultTags,\n } = context.options[0] || {};\n\n setDefaults(state);\n\n for (const tagName of Object.keys(tags)) {\n const targetTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName,\n }));\n\n const hasTag = Boolean(targetTagName && utils.hasTag(targetTagName));\n\n state.hasTag[tagName] = hasTag || state.hasTag[tagName];\n\n const hasDuplicate = state.hasDuplicates[tagName];\n\n if (hasDuplicate === false) {\n // Was marked before, so if a tag now, is a dupe\n state.hasDuplicates[tagName] = hasTag;\n } else if (!hasDuplicate && hasTag) {\n // No dupes set before, but has first tag, so change state\n // from `undefined` to `false` so can detect next time\n state.hasDuplicates[tagName] = false;\n state.hasNonCommentBeforeTag[tagName] = state.hasNonComment &&\n state.hasNonComment < jsdocNode.range[0];\n }\n }\n}, {\n exit ({\n context,\n state,\n utils,\n }) {\n setDefaults(state);\n const {\n tags = defaultTags,\n } = context.options[0] || {};\n\n for (const [\n tagName,\n {\n initialCommentsOnly = false,\n mustExist = false,\n preventDuplicates = false,\n },\n ] of Object.entries(tags)) {\n const obj = utils.getPreferredTagNameObject({\n tagName,\n });\n if (obj && typeof obj === 'object' && 'blocked' in obj) {\n utils.reportSettings(\n `\\`settings.jsdoc.tagNamePreference\\` cannot block @${obj.tagName} ` +\n 'for the `require-file-overview` rule',\n );\n } else {\n const targetTagName = (\n obj && typeof obj === 'object' && obj.replacement\n ) || obj;\n if (mustExist && !state.hasTag[tagName]) {\n utils.reportSettings(`Missing @${targetTagName}`);\n }\n\n if (preventDuplicates && state.hasDuplicates[tagName]) {\n utils.reportSettings(\n `Duplicate @${targetTagName}`,\n );\n }\n\n if (initialCommentsOnly &&\n state.hasNonCommentBeforeTag[tagName]\n ) {\n utils.reportSettings(\n `@${targetTagName} should be at the beginning of the file`,\n );\n }\n }\n }\n },\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Checks that all files have one `@file`, `@fileoverview`, or `@overview` tag at the beginning of the file.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-file-overview.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n tags: {\n patternProperties: {\n '.*': {\n additionalProperties: false,\n properties: {\n initialCommentsOnly: {\n type: 'boolean',\n },\n mustExist: {\n type: 'boolean',\n },\n preventDuplicates: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n nonComment ({\n node,\n state,\n }) {\n if (!state.hasNonComment) {\n state.hasNonComment = node.range[0];\n }\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,MAAMG,WAAW,GAAG;EAClBC,IAAI,EAAE;IACJC,mBAAmB,EAAE,IAAI;IACzBC,SAAS,EAAE,IAAI;IACfC,iBAAiB,EAAE;EACrB;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAIC,KAAK,IAAK;EAC7B;EACA,IAAI,CAACA,KAAK,CAACC,UAAU,EAAE;IACrBD,KAAK,CAACC,UAAU,GAAG,CAAC,CAAC;IACrBD,KAAK,CAACE,aAAa,GAAG,CAAC,CAAC;IACxBF,KAAK,CAACG,MAAM,GAAG,CAAC,CAAC;IACjBH,KAAK,CAACI,sBAAsB,GAAG,CAAC,CAAC;EAC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C3BC,UAAU,EAAE;QACVxB,IAAI,EAAE;UACJyB,iBAAiB,EAAE;YACjB,IAAI,EAAE;cACJF,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVvC,mBAAmB,EAAE;kBACnByC,IAAI,EAAE;gBACR,CAAC;gBACDxC,SAAS,EAAE;kBACTwC,IAAI,EAAE;gBACR,CAAC;gBACDvC,iBAAiB,EAAE;kBACjBuC,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR;UACF,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR,CAAC;EACDC,UAAUA,CAAE;IACVC,IAAI;IACJvC;EACF,CAAC,EAAE;IACD,IAAI,CAACA,KAAK,CAACoB,aAAa,EAAE;MACxBpB,KAAK,CAACoB,aAAa,GAAGmB,IAAI,CAAClB,KAAK,CAAC,CAAC,CAAC;IACrC;EACF;AACF,CAAC,CAAC;AAAAmB,MAAA,CAAAlC,OAAA,GAAAA,OAAA,CAAAb,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"requireFileOverview.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","defaultTags","file","initialCommentsOnly","mustExist","preventDuplicates","setDefaults","state","globalTags","hasDuplicates","hasTag","hasNonCommentBeforeTag","_default","exports","iterateJsdoc","context","jsdocNode","utils","tags","options","tagName","Object","keys","targetTagName","getPreferredTagName","Boolean","hasDuplicate","hasNonComment","range","exit","entries","obj","getPreferredTagNameObject","reportSettings","replacement","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","patternProperties","type","nonComment","node","module"],"sources":["../../src/rules/requireFileOverview.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nconst defaultTags = {\n file: {\n initialCommentsOnly: true,\n mustExist: true,\n preventDuplicates: true,\n },\n};\n\n/**\n * @param {import('../iterateJsdoc.js').StateObject} state\n * @returns {void}\n */\nconst setDefaults = (state) => {\n // First iteration\n if (!state.globalTags) {\n state.globalTags = {};\n state.hasDuplicates = {};\n state.hasTag = {};\n state.hasNonCommentBeforeTag = {};\n }\n};\n\nexport default iterateJsdoc(({\n context,\n jsdocNode,\n state,\n utils,\n}) => {\n const {\n tags = defaultTags,\n } = context.options[0] || {};\n\n setDefaults(state);\n\n for (const tagName of Object.keys(tags)) {\n const targetTagName = /** @type {string} */ (utils.getPreferredTagName({\n tagName,\n }));\n\n const hasTag = Boolean(targetTagName && utils.hasTag(targetTagName));\n\n state.hasTag[tagName] = hasTag || state.hasTag[tagName];\n\n const hasDuplicate = state.hasDuplicates[tagName];\n\n if (hasDuplicate === false) {\n // Was marked before, so if a tag now, is a dupe\n state.hasDuplicates[tagName] = hasTag;\n } else if (!hasDuplicate && hasTag) {\n // No dupes set before, but has first tag, so change state\n // from `undefined` to `false` so can detect next time\n state.hasDuplicates[tagName] = false;\n state.hasNonCommentBeforeTag[tagName] = state.hasNonComment &&\n state.hasNonComment < jsdocNode.range[0];\n }\n }\n}, {\n exit ({\n context,\n state,\n utils,\n }) {\n setDefaults(state);\n const {\n tags = defaultTags,\n } = context.options[0] || {};\n\n for (const [\n tagName,\n {\n initialCommentsOnly = false,\n mustExist = false,\n preventDuplicates = false,\n },\n ] of Object.entries(tags)) {\n const obj = utils.getPreferredTagNameObject({\n tagName,\n });\n if (obj && typeof obj === 'object' && 'blocked' in obj) {\n utils.reportSettings(\n `\\`settings.jsdoc.tagNamePreference\\` cannot block @${obj.tagName} ` +\n 'for the `require-file-overview` rule',\n );\n } else {\n const targetTagName = (\n obj && typeof obj === 'object' && obj.replacement\n ) || obj;\n if (mustExist && !state.hasTag[tagName]) {\n utils.reportSettings(`Missing @${targetTagName}`);\n }\n\n if (preventDuplicates && state.hasDuplicates[tagName]) {\n utils.reportSettings(\n `Duplicate @${targetTagName}`,\n );\n }\n\n if (initialCommentsOnly &&\n state.hasNonCommentBeforeTag[tagName]\n ) {\n utils.reportSettings(\n `@${targetTagName} should be at the beginning of the file`,\n );\n }\n }\n }\n },\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Checks that all files have one `@file`, `@fileoverview`, or `@overview` tag at the beginning of the file.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-file-overview.md#repos-sticky-header',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n tags: {\n description: `The keys of this object are tag names, and the values are configuration\nobjects indicating what will be checked for these whole-file tags.\n\nEach configuration object has 3 potential boolean keys (which default\nto \\`false\\` when this option is supplied).\n\n1. \\`mustExist\\` - enforces that all files have a \\`@file\\`, \\`@fileoverview\\`, or \\`@overview\\` tag.\n2. \\`preventDuplicates\\` - enforces that duplicate file overview tags within a given file will be reported\n3. \\`initialCommentsOnly\\` - reports file overview tags which are not, as per\n [the docs](https://jsdoc.app/tags-file.html), \"at the beginning of\n the file\"–where beginning of the file is interpreted in this rule\n as being when the overview tag is not preceded by anything other than\n a comment.\n\nWhen no \\`tags\\` is present, the default is:\n\n\\`\\`\\`json\n{\n \"file\": {\n \"initialCommentsOnly\": true,\n \"mustExist\": true,\n \"preventDuplicates\": true,\n }\n}\n\\`\\`\\`\n\nYou can add additional tag names and/or override \\`file\\` if you supply this\noption, e.g., in place of or in addition to \\`file\\`, giving other potential\nfile global tags like \\`@license\\`, \\`@copyright\\`, \\`@author\\`, \\`@module\\` or\n\\`@exports\\`, optionally restricting them to a single use or preventing them\nfrom being preceded by anything besides comments.\n\nFor example:\n\n\\`\\`\\`js\n{\n \"license\": {\n \"mustExist\": true,\n \"preventDuplicates\": true,\n }\n}\n\\`\\`\\`\n\nThis would require one and only one \\`@license\\` in the file, though because\n\\`initialCommentsOnly\\` is absent and defaults to \\`false\\`, the \\`@license\\`\ncan be anywhere.\n\nIn the case of \\`@license\\`, you can use this rule along with the\n\\`check-values\\` rule (with its \\`allowedLicenses\\` or \\`licensePattern\\` options),\nto enforce a license whitelist be present on every JS file.\n\nNote that if you choose to use \\`preventDuplicates\\` with \\`license\\`, you still\nhave a way to allow multiple licenses for the whole page by using the SPDX\n\"AND\" expression, e.g., \\`@license (MIT AND GPL-3.0)\\`.\n\nNote that the tag names are the main JSDoc tag name, so you should use \\`file\\`\nin this configuration object regardless of whether you have configured\n\\`fileoverview\\` instead of \\`file\\` on \\`tagNamePreference\\` (i.e., \\`fileoverview\\`\nwill be checked, but you must use \\`file\\` on the configuration object).\n\n`,\n patternProperties: {\n '.*': {\n additionalProperties: false,\n properties: {\n initialCommentsOnly: {\n type: 'boolean',\n },\n mustExist: {\n type: 'boolean',\n },\n preventDuplicates: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n nonComment ({\n node,\n state,\n }) {\n if (!state.hasNonComment) {\n state.hasNonComment = node.range[0];\n }\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,MAAMG,WAAW,GAAG;EAClBC,IAAI,EAAE;IACJC,mBAAmB,EAAE,IAAI;IACzBC,SAAS,EAAE,IAAI;IACfC,iBAAiB,EAAE;EACrB;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAIC,KAAK,IAAK;EAC7B;EACA,IAAI,CAACA,KAAK,CAACC,UAAU,EAAE;IACrBD,KAAK,CAACC,UAAU,GAAG,CAAC,CAAC;IACrBD,KAAK,CAACE,aAAa,GAAG,CAAC,CAAC;IACxBF,KAAK,CAACG,MAAM,GAAG,CAAC,CAAC;IACjBH,KAAK,CAACI,sBAAsB,GAAG,CAAC,CAAC;EACnC;AACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAb,OAAA,GAEa,IAAAc,qBAAY,EAAC,CAAC;E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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;UACWK,iBAAiB,EAAE;YACjB,IAAI,EAAE;cACJF,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVvC,mBAAmB,EAAE;kBACnByC,IAAI,EAAE;gBACR,CAAC;gBACDxC,SAAS,EAAE;kBACTwC,IAAI,EAAE;gBACR,CAAC;gBACDvC,iBAAiB,EAAE;kBACjBuC,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR;UACF,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR,CAAC;EACDC,UAAUA,CAAE;IACVC,IAAI;IACJvC;EACF,CAAC,EAAE;IACD,IAAI,CAACA,KAAK,CAACoB,aAAa,EAAE;MACxBpB,KAAK,CAACoB,aAAa,GAAGmB,IAAI,CAAClB,KAAK,CAAC,CAAC,CAAC;IACrC;EACF;AACF,CAAC,CAAC;AAAAmB,MAAA,CAAAlC,OAAA,GAAAA,OAAA,CAAAb,OAAA","ignoreList":[]}
|
|
@@ -115,15 +115,25 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
115
115
|
iterateAllJsdocs: true,
|
|
116
116
|
meta: {
|
|
117
117
|
docs: {
|
|
118
|
-
description: 'Requires a hyphen before the `@param` description.',
|
|
118
|
+
description: 'Requires a hyphen before the `@param` description (and optionally before `@property` descriptions).',
|
|
119
119
|
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-hyphen-before-param-description.md#repos-sticky-header'
|
|
120
120
|
},
|
|
121
121
|
fixable: 'code',
|
|
122
122
|
schema: [{
|
|
123
|
+
description: `If the string is \`"always"\` then a problem is raised when there is no hyphen
|
|
124
|
+
before the description. If it is \`"never"\` then a problem is raised when there
|
|
125
|
+
is a hyphen before the description. The default value is \`"always"\`.
|
|
126
|
+
|
|
127
|
+
Even if hyphens are set to "always" appear after the tag name, they will
|
|
128
|
+
actually be forbidden in the event that they are followed immediately by
|
|
129
|
+
the end of a line (this will otherwise cause Visual Studio Code to display
|
|
130
|
+
incorrectly).`,
|
|
123
131
|
enum: ['always', 'never'],
|
|
124
132
|
type: 'string'
|
|
125
133
|
}, {
|
|
126
134
|
additionalProperties: false,
|
|
135
|
+
description: `The options object may have the following property to indicate behavior for
|
|
136
|
+
other tags besides the \`@param\` tag (or the \`@arg\` tag if so set).`,
|
|
127
137
|
properties: {
|
|
128
138
|
tags: {
|
|
129
139
|
anyOf: [{
|
|
@@ -137,7 +147,15 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
137
147
|
}, {
|
|
138
148
|
enum: ['any'],
|
|
139
149
|
type: 'string'
|
|
140
|
-
}]
|
|
150
|
+
}],
|
|
151
|
+
description: `Object whose keys indicate different tags to check for the
|
|
152
|
+
presence or absence of hyphens; the key value should be "always" or "never",
|
|
153
|
+
indicating how hyphens are to be applied, e.g., \`{property: 'never'}\`
|
|
154
|
+
to ensure \`@property\` never uses hyphens. A key can also be set as \`*\`, e.g.,
|
|
155
|
+
\`'*': 'always'\` to apply hyphen checking to any tag (besides the preferred
|
|
156
|
+
\`@param\` tag which follows the main string option setting and besides any
|
|
157
|
+
other \`tags\` entries).
|
|
158
|
+
`
|
|
141
159
|
}
|
|
142
160
|
},
|
|
143
161
|
type: 'object'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireHyphenBeforeParamDescription.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","jsdoc","utils","mainCircumstance","tags","options","tgs","checkHyphens","jsdocTag","targetTagName","circumstance","always","desc","getTagDescription","trim","startsWithHyphen","test","hyphenNewline","lines","tokens","source","description","fixIt","replace","name","reportJSDoc","line","number","postName","forEachPreferredTag","tagEntries","Object","entries","tagName","preferredParamTag","getPreferredTagName","tag","some","tagNme","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","type","additionalProperties","properties","anyOf","patternProperties","module"],"sources":["../../src/rules/requireHyphenBeforeParamDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const [\n mainCircumstance,\n {\n tags = null,\n } = {},\n ] = context.options;\n\n const tgs = /**\n * @type {null|\"any\"|{[key: string]: \"always\"|\"never\"}}\n */ (tags);\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} jsdocTag\n * @param {string} targetTagName\n * @param {\"always\"|\"never\"} [circumstance]\n * @returns {void}\n */\n const checkHyphens = (jsdocTag, targetTagName, circumstance = mainCircumstance) => {\n const always = !circumstance || circumstance === 'always';\n const desc = /** @type {string} */ (utils.getTagDescription(jsdocTag));\n if (!desc.trim()) {\n return;\n }\n\n const startsWithHyphen = (/^\\s*-/v).test(desc);\n const hyphenNewline = (/^\\s*-\\n/v).test(desc);\n\n let lines = 0;\n for (const {\n tokens,\n } of jsdocTag.source) {\n if (tokens.description) {\n break;\n }\n\n lines++;\n }\n\n if (always && !hyphenNewline) {\n if (!startsWithHyphen) {\n let fixIt = true;\n for (const {\n tokens,\n } of jsdocTag.source) {\n if (tokens.description) {\n tokens.description = tokens.description.replace(\n /^(\\s*)/v, '$1- ',\n );\n break;\n }\n\n // Linebreak after name since has no description\n if (tokens.name) {\n fixIt = false;\n break;\n }\n }\n\n if (fixIt) {\n utils.reportJSDoc(\n `There must be a hyphen before @${targetTagName} description.`,\n {\n line: jsdocTag.source[0].number + lines,\n },\n () => {},\n );\n }\n }\n } else if (startsWithHyphen) {\n utils.reportJSDoc(\n always ?\n `There must be no hyphen followed by newline after the @${targetTagName} name.` :\n `There must be no hyphen before @${targetTagName} description.`,\n {\n line: jsdocTag.source[0].number + lines,\n },\n () => {\n for (const {\n tokens,\n } of jsdocTag.source) {\n if (tokens.description) {\n tokens.description = tokens.description.replace(\n /^\\s*-\\s*/v, '',\n );\n if (hyphenNewline) {\n tokens.postName = '';\n }\n\n break;\n }\n }\n },\n true,\n );\n }\n };\n\n utils.forEachPreferredTag('param', checkHyphens);\n if (tgs) {\n const tagEntries = Object.entries(tgs);\n for (const [\n tagName,\n circumstance,\n ] of tagEntries) {\n if (tagName === '*') {\n const preferredParamTag = utils.getPreferredTagName({\n tagName: 'param',\n });\n for (const {\n tag,\n } of jsdoc.tags) {\n if (tag === preferredParamTag || tagEntries.some(([\n tagNme,\n ]) => {\n return tagNme !== '*' && tagNme === tag;\n })) {\n continue;\n }\n\n utils.forEachPreferredTag(tag, (jsdocTag, targetTagName) => {\n checkHyphens(\n jsdocTag,\n targetTagName,\n /** @type {\"always\"|\"never\"} */ (circumstance),\n );\n });\n }\n\n continue;\n }\n\n utils.forEachPreferredTag(tagName, (jsdocTag, targetTagName) => {\n checkHyphens(\n jsdocTag,\n targetTagName,\n /** @type {\"always\"|\"never\"} */ (circumstance),\n );\n });\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires a hyphen before the `@param` description.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-hyphen-before-param-description.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n enum: [\n 'always', 'never',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n tags: {\n anyOf: [\n {\n patternProperties: {\n '.*': {\n enum: [\n 'always', 'never',\n ],\n type: 'string',\n },\n },\n type: 'object',\n },\n {\n enum: [\n 'any',\n ],\n type: 'string',\n },\n ],\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,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E;UACR,CAAC,EACD;YACED,IAAI,EAAE,CACJ,KAAK,CACN;YACDC,IAAI,EAAE;UACR,CAAC;QAEL;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAK,MAAA,CAAArD,OAAA,GAAAA,OAAA,CAAAF,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"requireHyphenBeforeParamDescription.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","e","__esModule","default","_default","exports","iterateJsdoc","context","jsdoc","utils","mainCircumstance","tags","options","tgs","checkHyphens","jsdocTag","targetTagName","circumstance","always","desc","getTagDescription","trim","startsWithHyphen","test","hyphenNewline","lines","tokens","source","description","fixIt","replace","name","reportJSDoc","line","number","postName","forEachPreferredTag","tagEntries","Object","entries","tagName","preferredParamTag","getPreferredTagName","tag","some","tagNme","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","type","additionalProperties","properties","anyOf","patternProperties","module"],"sources":["../../src/rules/requireHyphenBeforeParamDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const [\n mainCircumstance,\n {\n tags = null,\n } = {},\n ] = context.options;\n\n const tgs = /**\n * @type {null|\"any\"|{[key: string]: \"always\"|\"never\"}}\n */ (tags);\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} jsdocTag\n * @param {string} targetTagName\n * @param {\"always\"|\"never\"} [circumstance]\n * @returns {void}\n */\n const checkHyphens = (jsdocTag, targetTagName, circumstance = mainCircumstance) => {\n const always = !circumstance || circumstance === 'always';\n const desc = /** @type {string} */ (utils.getTagDescription(jsdocTag));\n if (!desc.trim()) {\n return;\n }\n\n const startsWithHyphen = (/^\\s*-/v).test(desc);\n const hyphenNewline = (/^\\s*-\\n/v).test(desc);\n\n let lines = 0;\n for (const {\n tokens,\n } of jsdocTag.source) {\n if (tokens.description) {\n break;\n }\n\n lines++;\n }\n\n if (always && !hyphenNewline) {\n if (!startsWithHyphen) {\n let fixIt = true;\n for (const {\n tokens,\n } of jsdocTag.source) {\n if (tokens.description) {\n tokens.description = tokens.description.replace(\n /^(\\s*)/v, '$1- ',\n );\n break;\n }\n\n // Linebreak after name since has no description\n if (tokens.name) {\n fixIt = false;\n break;\n }\n }\n\n if (fixIt) {\n utils.reportJSDoc(\n `There must be a hyphen before @${targetTagName} description.`,\n {\n line: jsdocTag.source[0].number + lines,\n },\n () => {},\n );\n }\n }\n } else if (startsWithHyphen) {\n utils.reportJSDoc(\n always ?\n `There must be no hyphen followed by newline after the @${targetTagName} name.` :\n `There must be no hyphen before @${targetTagName} description.`,\n {\n line: jsdocTag.source[0].number + lines,\n },\n () => {\n for (const {\n tokens,\n } of jsdocTag.source) {\n if (tokens.description) {\n tokens.description = tokens.description.replace(\n /^\\s*-\\s*/v, '',\n );\n if (hyphenNewline) {\n tokens.postName = '';\n }\n\n break;\n }\n }\n },\n true,\n );\n }\n };\n\n utils.forEachPreferredTag('param', checkHyphens);\n if (tgs) {\n const tagEntries = Object.entries(tgs);\n for (const [\n tagName,\n circumstance,\n ] of tagEntries) {\n if (tagName === '*') {\n const preferredParamTag = utils.getPreferredTagName({\n tagName: 'param',\n });\n for (const {\n tag,\n } of jsdoc.tags) {\n if (tag === preferredParamTag || tagEntries.some(([\n tagNme,\n ]) => {\n return tagNme !== '*' && tagNme === tag;\n })) {\n continue;\n }\n\n utils.forEachPreferredTag(tag, (jsdocTag, targetTagName) => {\n checkHyphens(\n jsdocTag,\n targetTagName,\n /** @type {\"always\"|\"never\"} */ (circumstance),\n );\n });\n }\n\n continue;\n }\n\n utils.forEachPreferredTag(tagName, (jsdocTag, targetTagName) => {\n checkHyphens(\n jsdocTag,\n targetTagName,\n /** @type {\"always\"|\"never\"} */ (circumstance),\n );\n });\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires a hyphen before the `@param` description (and optionally before `@property` descriptions).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-hyphen-before-param-description.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n description: `If the string is \\`\"always\"\\` then a problem is raised when there is no hyphen\nbefore the description. If it is \\`\"never\"\\` then a problem is raised when there\nis a hyphen before the description. The default value is \\`\"always\"\\`.\n\nEven if hyphens are set to \"always\" appear after the tag name, they will\nactually be forbidden in the event that they are followed immediately by\nthe end of a line (this will otherwise cause Visual Studio Code to display\nincorrectly).`,\n enum: [\n 'always', 'never',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n description: `The options object may have the following property to indicate behavior for\nother tags besides the \\`@param\\` tag (or the \\`@arg\\` tag if so set).`,\n properties: {\n tags: {\n anyOf: [\n {\n patternProperties: {\n '.*': {\n enum: [\n 'always', 'never',\n ],\n type: 'string',\n },\n },\n type: 'object',\n },\n {\n enum: [\n 'any',\n ],\n type: 'string',\n },\n ],\n description: `Object whose keys indicate different tags to check for the\n presence or absence of hyphens; the key value should be \"always\" or \"never\",\n indicating how hyphens are to be applied, e.g., \\`{property: 'never'}\\`\n to ensure \\`@property\\` never uses hyphens. A key can also be set as \\`*\\`, e.g.,\n \\`'*': 'always'\\` to apply hyphen checking to any tag (besides the preferred\n \\`@param\\` tag which follows the main string option setting and besides any\n other \\`tags\\` entries).\n`,\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAE/B,IAAAG,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAM,CACJC,gBAAgB,EAChB;I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