eslint-plugin-jsdoc 43.1.1 → 44.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 +58 -24393
- package/dist/WarnSettings.js.map +1 -1
- package/dist/alignTransform.js.map +1 -1
- package/dist/bin/generateRule.js.map +1 -1
- package/dist/exportParser.js.map +1 -1
- package/dist/generateRule.js.map +1 -1
- package/dist/iterateJsdoc.js +2 -2
- package/dist/iterateJsdoc.js.map +1 -1
- package/dist/jsdocUtils.js.map +1 -1
- package/dist/rules/checkAccess.js.map +1 -1
- package/dist/rules/checkExamples.js.map +1 -1
- package/dist/rules/checkLineAlignment.js.map +1 -1
- package/dist/rules/checkParamNames.js.map +1 -1
- package/dist/rules/checkPropertyNames.js.map +1 -1
- package/dist/rules/checkTagNames.js.map +1 -1
- package/dist/rules/checkTypes.js.map +1 -1
- package/dist/rules/checkValues.js.map +1 -1
- package/dist/rules/emptyTags.js.map +1 -1
- package/dist/rules/implementsOnClasses.js.map +1 -1
- package/dist/rules/informativeDocs.js.map +1 -1
- package/dist/rules/matchDescription.js.map +1 -1
- package/dist/rules/matchName.js.map +1 -1
- package/dist/rules/multilineBlocks.js.map +1 -1
- package/dist/rules/noBadBlocks.js.map +1 -1
- package/dist/rules/noBlankBlockDescriptions.js.map +1 -1
- package/dist/rules/noBlankBlocks.js.map +1 -1
- package/dist/rules/noDefaults.js.map +1 -1
- package/dist/rules/noMultiAsterisks.js.map +1 -1
- package/dist/rules/noTypes.js.map +1 -1
- package/dist/rules/noUndefinedTypes.js.map +1 -1
- package/dist/rules/requireDescription.js.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.js.map +1 -1
- package/dist/rules/requireExample.js.map +1 -1
- package/dist/rules/requireFileOverview.js.map +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.js.map +1 -1
- package/dist/rules/requireJsdoc.js.map +1 -1
- package/dist/rules/requireParam.js.map +1 -1
- package/dist/rules/requireParamDescription.js.map +1 -1
- package/dist/rules/requireParamName.js.map +1 -1
- package/dist/rules/requireParamType.js.map +1 -1
- package/dist/rules/requirePropertyDescription.js.map +1 -1
- package/dist/rules/requirePropertyName.js.map +1 -1
- package/dist/rules/requirePropertyType.js.map +1 -1
- package/dist/rules/requireReturns.js.map +1 -1
- package/dist/rules/requireReturnsCheck.js.map +1 -1
- package/dist/rules/requireReturnsDescription.js.map +1 -1
- package/dist/rules/requireThrows.js.map +1 -1
- package/dist/rules/requireYields.js.map +1 -1
- package/dist/rules/requireYieldsCheck.js.map +1 -1
- package/dist/rules/sortTags.js.map +1 -1
- package/dist/rules/tagLines.js.map +1 -1
- package/dist/rules/textEscaping.js.map +1 -1
- package/dist/rules/validTypes.js.map +1 -1
- package/dist/utils/hasReturnValue.js.map +1 -1
- package/docs/advanced.md +102 -0
- package/docs/rules/check-access.md +193 -0
- package/docs/rules/check-alignment.md +169 -0
- package/docs/rules/check-examples.md +784 -0
- package/docs/rules/check-indentation.md +296 -0
- package/docs/rules/check-line-alignment.md +995 -0
- package/docs/rules/check-param-names.md +1035 -0
- package/docs/rules/check-property-names.md +244 -0
- package/docs/rules/check-syntax.md +80 -0
- package/docs/rules/check-tag-names.md +1117 -0
- package/docs/rules/check-types.md +1198 -0
- package/docs/rules/check-values.md +409 -0
- package/docs/rules/empty-tags.md +220 -0
- package/docs/rules/implements-on-classes.md +219 -0
- package/docs/rules/informative-docs.md +400 -0
- package/docs/rules/match-description.md +979 -0
- package/docs/rules/match-name.md +243 -0
- package/docs/rules/multiline-blocks.md +398 -0
- package/docs/rules/no-bad-blocks.md +174 -0
- package/docs/rules/no-blank-block-descriptions.md +91 -0
- package/docs/rules/no-blank-blocks.md +98 -0
- package/docs/rules/no-defaults.md +207 -0
- package/docs/rules/no-missing-syntax.md +269 -0
- package/docs/rules/no-multi-asterisks.md +278 -0
- package/docs/rules/no-restricted-syntax.md +377 -0
- package/docs/rules/no-types.md +168 -0
- package/docs/rules/no-undefined-types.md +731 -0
- package/docs/rules/require-asterisk-prefix.md +297 -0
- package/docs/rules/require-description-complete-sentence.md +584 -0
- package/docs/rules/require-description.md +820 -0
- package/docs/rules/require-example.md +390 -0
- package/docs/rules/require-file-overview.md +317 -0
- package/docs/rules/require-hyphen-before-param-description.md +258 -0
- package/docs/rules/require-jsdoc.md +1837 -0
- package/docs/rules/require-param-description.md +1816 -0
- package/docs/rules/require-param-name.md +238 -0
- package/docs/rules/require-param-type.md +163 -0
- package/docs/rules/require-param.md +227 -0
- package/docs/rules/require-property-description.md +128 -0
- package/docs/rules/require-property-name.md +88 -0
- package/docs/rules/require-property-type.md +79 -0
- package/docs/rules/require-property.md +79 -0
- package/docs/rules/require-returns-check.md +1164 -0
- package/docs/rules/require-returns-description.md +1053 -0
- package/docs/rules/require-returns-type.md +181 -0
- package/docs/rules/require-returns.md +144 -0
- package/docs/rules/require-throws.md +326 -0
- package/docs/rules/require-yields-check.md +823 -0
- package/docs/rules/require-yields.md +544 -0
- package/docs/rules/sort-tags.md +635 -0
- package/docs/rules/tag-lines.md +551 -0
- package/docs/rules/text-escaping.md +177 -0
- package/docs/rules/valid-types.md +834 -0
- package/docs/settings.md +355 -0
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchName.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","report","info","lastIndex","utils","match","options","allowName","disallowName","replacement","tags","allowNameRegex","getRegexFromString","disallowNameRegex","applicableTags","includes","getPresentTags","reported","tag","allowed","test","name","disallowed","hasRegex","fixer","src","source","tokens","replace","message","reportJSDoc","undefined","matchContext","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","type","comment","required","exports","module"],"sources":["../../src/rules/matchName.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\n// eslint-disable-next-line complexity\nexport default iterateJsdoc(({\n context,\n jsdoc,\n report,\n info: {\n lastIndex,\n },\n utils,\n}) => {\n const {\n match,\n } = context.options[0] || {};\n if (!match) {\n report('Rule `no-restricted-syntax` is missing a `match` option.');\n\n return;\n }\n\n const {\n allowName,\n disallowName,\n replacement,\n tags = [\n '*',\n ],\n } = match[lastIndex];\n\n const allowNameRegex = allowName && utils.getRegexFromString(allowName);\n const disallowNameRegex = disallowName && utils.getRegexFromString(disallowName);\n\n let applicableTags = jsdoc.tags;\n if (!tags.includes('*')) {\n applicableTags = utils.getPresentTags(tags);\n }\n\n let reported = false;\n for (const tag of applicableTags) {\n const allowed = !allowNameRegex || allowNameRegex.test(tag.name);\n const disallowed = disallowNameRegex && disallowNameRegex.test(tag.name);\n const hasRegex = allowNameRegex || disallowNameRegex;\n if (hasRegex && allowed && !disallowed) {\n continue;\n }\n\n if (!hasRegex && reported) {\n continue;\n }\n\n const fixer = () => {\n for (const src of tag.source) {\n if (src.tokens.name) {\n src.tokens.name = src.tokens.name.replace(\n disallowNameRegex, replacement,\n );\n break;\n }\n }\n };\n\n let {\n message,\n } = match[lastIndex];\n if (!message) {\n if (hasRegex) {\n message = disallowed ?\n `Only allowing names not matching \\`${disallowNameRegex}\\` but found \"${tag.name}\".` :\n `Only allowing names matching \\`${allowNameRegex}\\` but found \"${tag.name}\".`;\n } else {\n message = `Prohibited context for \"${tag.name}\".`;\n }\n }\n\n utils.reportJSDoc(\n message,\n hasRegex ? tag : null,\n\n // We could match up\n disallowNameRegex && replacement !== undefined ?\n fixer :\n null,\n false,\n {\n // Could also supply `context`, `comment`, `tags`\n allowName,\n disallowName,\n name: tag.name,\n },\n );\n if (!hasRegex) {\n reported = true;\n }\n }\n}, {\n matchContext: true,\n meta: {\n docs: {\n description: 'Reports the name portion of a JSDoc tag if matching or not matching a given regular expression.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-match-name',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n match: {\n additionalProperties: false,\n items: {\n properties: {\n allowName: {\n type: 'string',\n },\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n disallowName: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n tags: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n type: 'array',\n },\n },\n required: [\n 'match',\n ],\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C;AAAA,IAAAG,QAAA,GACe,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,MAAM;EACNC,IAAI,EAAE;IACJC;EACF,CAAC;EACDC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC;EACF,CAAC,GAAGN,OAAO,CAACO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAC5B,IAAI,CAACD,KAAK,EAAE;IACVJ,MAAM,CAAC,0DAA0D,CAAC;IAElE;EACF;EAEA,MAAM;IACJM,SAAS;IACTC,YAAY;IACZC,WAAW;IACXC,IAAI,GAAG,CACL,GAAG;EAEP,CAAC,GAAGL,KAAK,CAACF,SAAS,CAAC;EAEpB,MAAMQ,cAAc,GAAGJ,SAAS,IAAIH,KAAK,CAACQ,kBAAkB,CAACL,SAAS,CAAC;EACvE,MAAMM,iBAAiB,GAAGL,YAAY,IAAIJ,KAAK,CAACQ,kBAAkB,CAACJ,YAAY,CAAC;EAEhF,IAAIM,cAAc,GAAGd,KAAK,CAACU,IAAI;EAC/B,IAAI,CAACA,IAAI,CAACK,QAAQ,CAAC,GAAG,CAAC,EAAE;IACvBD,cAAc,GAAGV,KAAK,CAACY,cAAc,CAACN,IAAI,CAAC;EAC7C;EAEA,IAAIO,QAAQ,GAAG,KAAK;EACpB,KAAK,MAAMC,GAAG,IAAIJ,cAAc,EAAE;IAChC,MAAMK,OAAO,GAAG,CAACR,cAAc,IAAIA,cAAc,CAACS,IAAI,CAACF,GAAG,CAACG,IAAI,CAAC;IAChE,MAAMC,UAAU,GAAGT,iBAAiB,IAAIA,iBAAiB,CAACO,IAAI,CAACF,GAAG,CAACG,IAAI,CAAC;IACxE,MAAME,QAAQ,GAAGZ,cAAc,IAAIE,iBAAiB;IACpD,IAAIU,QAAQ,IAAIJ,OAAO,IAAI,CAACG,UAAU,EAAE;MACtC;IACF;IAEA,IAAI,CAACC,QAAQ,IAAIN,QAAQ,EAAE;MACzB;IACF;IAEA,MAAMO,KAAK,GAAGA,CAAA,KAAM;MAClB,KAAK,MAAMC,GAAG,IAAIP,GAAG,CAACQ,MAAM,EAAE;QAC5B,IAAID,GAAG,CAACE,MAAM,CAACN,IAAI,EAAE;UACnBI,GAAG,CAACE,MAAM,CAACN,IAAI,GAAGI,GAAG,CAACE,MAAM,CAACN,IAAI,CAACO,OAAO,CACvCf,iBAAiB,EAAEJ,
|
|
1
|
+
{"version":3,"file":"matchName.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","report","info","lastIndex","utils","match","options","allowName","disallowName","replacement","tags","allowNameRegex","getRegexFromString","disallowNameRegex","applicableTags","includes","getPresentTags","reported","tag","allowed","test","name","disallowed","hasRegex","fixer","src","source","tokens","replace","message","reportJSDoc","undefined","matchContext","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","type","comment","required","exports","module"],"sources":["../../src/rules/matchName.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\n// eslint-disable-next-line complexity\nexport default iterateJsdoc(({\n context,\n jsdoc,\n report,\n info: {\n lastIndex,\n },\n utils,\n}) => {\n const {\n match,\n } = context.options[0] || {};\n if (!match) {\n report('Rule `no-restricted-syntax` is missing a `match` option.');\n\n return;\n }\n\n const {\n allowName,\n disallowName,\n replacement,\n tags = [\n '*',\n ],\n } = match[lastIndex];\n\n const allowNameRegex = allowName && utils.getRegexFromString(allowName);\n const disallowNameRegex = disallowName && utils.getRegexFromString(disallowName);\n\n let applicableTags = jsdoc.tags;\n if (!tags.includes('*')) {\n applicableTags = utils.getPresentTags(tags);\n }\n\n let reported = false;\n for (const tag of applicableTags) {\n const allowed = !allowNameRegex || allowNameRegex.test(tag.name);\n const disallowed = disallowNameRegex && disallowNameRegex.test(tag.name);\n const hasRegex = allowNameRegex || disallowNameRegex;\n if (hasRegex && allowed && !disallowed) {\n continue;\n }\n\n if (!hasRegex && reported) {\n continue;\n }\n\n const fixer = () => {\n for (const src of tag.source) {\n if (src.tokens.name) {\n src.tokens.name = src.tokens.name.replace(\n disallowNameRegex, replacement,\n );\n break;\n }\n }\n };\n\n let {\n message,\n } = match[lastIndex];\n if (!message) {\n if (hasRegex) {\n message = disallowed ?\n `Only allowing names not matching \\`${disallowNameRegex}\\` but found \"${tag.name}\".` :\n `Only allowing names matching \\`${allowNameRegex}\\` but found \"${tag.name}\".`;\n } else {\n message = `Prohibited context for \"${tag.name}\".`;\n }\n }\n\n utils.reportJSDoc(\n message,\n hasRegex ? tag : null,\n\n // We could match up\n disallowNameRegex && replacement !== undefined ?\n fixer :\n null,\n false,\n {\n // Could also supply `context`, `comment`, `tags`\n allowName,\n disallowName,\n name: tag.name,\n },\n );\n if (!hasRegex) {\n reported = true;\n }\n }\n}, {\n matchContext: true,\n meta: {\n docs: {\n description: 'Reports the name portion of a JSDoc tag if matching or not matching a given regular expression.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-match-name',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n match: {\n additionalProperties: false,\n items: {\n properties: {\n allowName: {\n type: 'string',\n },\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n disallowName: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n tags: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n type: 'array',\n },\n },\n required: [\n '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MACJC,WAAW,EAAE,iGAAiG;MAC9GC,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVnC,KAAK,EAAE;UACLkC,oBAAoB,EAAE,KAAK;UAC3BE,KAAK,EAAE;YACLD,UAAU,EAAE;cACVjC,SAAS,EAAE;gBACTmC,IAAI,EAAE;cACR,CAAC;cACDC,OAAO,EAAE;gBACPD,IAAI,EAAE;cACR,CAAC;cACD3C,OAAO,EAAE;gBACP2C,IAAI,EAAE;cACR,CAAC;cACDlC,YAAY,EAAE;gBACZkC,IAAI,EAAE;cACR,CAAC;cACDb,OAAO,EAAE;gBACPa,IAAI,EAAE;cACR,CAAC;cACDhC,IAAI,EAAE;gBACJ+B,KAAK,EAAE;kBACLC,IAAI,EAAE;gBACR,CAAC;gBACDA,IAAI,EAAE;cACR;YACF,CAAC;YACDA,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDE,QAAQ,EAAE,CACR,OAAO,CACR;MACDF,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAG,OAAA,CAAAjD,OAAA,GAAAC,QAAA;AAAAiD,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjD,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multilineBlocks.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","utils","allowMultipleTags","noFinalLineText","noZeroLineText","noSingleLineBlocks","singleLineTags","noMultilineBlocks","minimumLengthForMultiline","Number","POSITIVE_INFINITY","multilineTags","options","source","tokens","description","tag","sourceLength","length","isInvalidSingleLine","tagName","includes","slice","fixer","makeMultiline","reportJSDoc","lineChecks","line","emptyTokens","delimiter","start","addLine","finalLine","finalLineTokens","trim","trimEnd","prop","end","tags","hasATag","filterTags","tg","number","reduce","desc","type","typ","name","nme","lineEnd","postType","postName","postTag","nameOrDescription","seedTokens","postDelimiter","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","anyOf","enum","items","exports","module"],"sources":["../../src/rules/multilineBlocks.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const {\n allowMultipleTags = true,\n noFinalLineText = true,\n noZeroLineText = true,\n noSingleLineBlocks = false,\n singleLineTags = [\n 'lends', 'type',\n ],\n noMultilineBlocks = false,\n minimumLengthForMultiline = Number.POSITIVE_INFINITY,\n multilineTags = [\n '*',\n ],\n } = context.options[0] || {};\n\n const {\n source: [\n {\n tokens,\n },\n ],\n } = jsdoc;\n const {\n description,\n tag,\n } = tokens;\n const sourceLength = jsdoc.source.length;\n\n const isInvalidSingleLine = (tagName) => {\n return noSingleLineBlocks &&\n (!tagName ||\n !singleLineTags.includes(tagName) && !singleLineTags.includes('*'));\n };\n\n if (sourceLength === 1) {\n if (!isInvalidSingleLine(tag.slice(1))) {\n return;\n }\n\n const fixer = () => {\n utils.makeMultiline();\n };\n\n utils.reportJSDoc(\n 'Single line blocks are not permitted by your configuration.',\n null,\n fixer,\n true,\n );\n\n return;\n }\n\n const lineChecks = () => {\n if (\n noZeroLineText &&\n (tag || description)\n ) {\n const fixer = () => {\n const line = {\n ...tokens,\n };\n utils.emptyTokens(tokens);\n const {\n tokens: {\n delimiter,\n start,\n },\n } = jsdoc.source[1];\n utils.addLine(1, {\n ...line,\n delimiter,\n start,\n });\n };\n\n utils.reportJSDoc(\n 'Should have no text on the \"0th\" line (after the `/**`).',\n null,\n fixer,\n );\n\n return;\n }\n\n const finalLine = jsdoc.source[jsdoc.source.length - 1];\n const finalLineTokens = finalLine.tokens;\n if (\n noFinalLineText &&\n finalLineTokens.description.trim()\n ) {\n const fixer = () => {\n const line = {\n ...finalLineTokens,\n };\n line.description = line.description.trimEnd();\n\n const {\n delimiter,\n } = line;\n\n for (const prop of [\n 'delimiter',\n 'postDelimiter',\n 'tag',\n 'type',\n 'lineEnd',\n 'postType',\n 'postTag',\n 'name',\n 'postName',\n 'description',\n ]) {\n finalLineTokens[prop] = '';\n }\n\n utils.addLine(jsdoc.source.length - 1, {\n ...line,\n delimiter,\n end: '',\n });\n };\n\n utils.reportJSDoc(\n 'Should have no text on the final line (before the `*/`).',\n null,\n fixer,\n );\n }\n };\n\n if (noMultilineBlocks) {\n if (\n jsdoc.tags.length &&\n (multilineTags.includes('*') || utils.hasATag(multilineTags))\n ) {\n lineChecks();\n\n return;\n }\n\n if (jsdoc.description.length >= minimumLengthForMultiline) {\n lineChecks();\n\n return;\n }\n\n if (\n noSingleLineBlocks &&\n (!jsdoc.tags.length ||\n !utils.filterTags(({\n tag: tg,\n }) => {\n return !isInvalidSingleLine(tg);\n }).length)\n ) {\n utils.reportJSDoc(\n 'Multiline jsdoc blocks are prohibited by ' +\n 'your configuration but fixing would result in a single ' +\n 'line block which you have prohibited with `noSingleLineBlocks`.',\n );\n\n return;\n }\n\n if (jsdoc.tags.length > 1) {\n if (!allowMultipleTags) {\n utils.reportJSDoc(\n 'Multiline jsdoc blocks are prohibited by ' +\n 'your configuration but the block has multiple tags.',\n );\n\n return;\n }\n } else if (jsdoc.tags.length === 1 && jsdoc.description.trim()) {\n if (!allowMultipleTags) {\n utils.reportJSDoc(\n 'Multiline jsdoc blocks are prohibited by ' +\n 'your configuration but the block has a description with a tag.',\n );\n\n return;\n }\n } else {\n const fixer = () => {\n jsdoc.source = [\n {\n number: 1,\n source: '',\n tokens: jsdoc.source.reduce((obj, {\n tokens: {\n description: desc,\n tag: tg,\n type: typ,\n name: nme,\n lineEnd,\n postType,\n postName,\n postTag,\n },\n }) => {\n if (typ) {\n obj.type = typ;\n }\n\n if (tg && typ && nme) {\n obj.postType = postType;\n }\n\n if (nme) {\n obj.name += nme;\n }\n\n if (nme && desc) {\n obj.postName = postName;\n }\n\n obj.description += desc;\n\n const nameOrDescription = obj.description || obj.name;\n if (\n nameOrDescription && nameOrDescription.slice(-1) !== ' '\n ) {\n obj.description += ' ';\n }\n\n obj.lineEnd = lineEnd;\n\n // Already filtered for multiple tags\n obj.tag += tg;\n if (tg) {\n obj.postTag = postTag || ' ';\n }\n\n return obj;\n }, utils.seedTokens({\n delimiter: '/**',\n end: '*/',\n postDelimiter: ' ',\n })),\n },\n ];\n };\n\n utils.reportJSDoc(\n 'Multiline jsdoc blocks are prohibited by ' +\n 'your configuration.',\n null,\n fixer,\n );\n\n return;\n }\n }\n\n lineChecks();\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Controls how and whether jsdoc blocks can be expressed as single or multiple line blocks.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-multiline-blocks',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowMultipleTags: {\n type: 'boolean',\n },\n minimumLengthForMultiline: {\n type: 'integer',\n },\n multilineTags: {\n anyOf: [\n {\n enum: [\n '*',\n ],\n type: 'string',\n }, {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n ],\n },\n noFinalLineText: {\n type: 'boolean',\n },\n noMultilineBlocks: {\n type: 'boolean',\n },\n noSingleLineBlocks: {\n type: 'boolean',\n },\n noZeroLineText: {\n type: 'boolean',\n },\n singleLineTags: {\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;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,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B,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJ3C,WAAW,EAAE,2FAA2F;MACxG4C,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACV7D,iBAAiB,EAAE;UACjB2C,IAAI,EAAE;QACR,CAAC;QACDrC,yBAAyB,EAAE;UACzBqC,IAAI,EAAE;QACR,CAAC;QACDlC,aAAa,EAAE;UACbqD,KAAK,EAAE,CACL;YACEC,IAAI,EAAE,CACJ,GAAG,CACJ;YACDpB,IAAI,EAAE;UACR,CAAC,EAAE;YACDqB,KAAK,EAAE;cACLrB,IAAI,EAAE;YACR,CAAC;YACDA,IAAI,EAAE;UACR,CAAC;QAEL,CAAC;QACD1C,eAAe,EAAE;UACf0C,IAAI,EAAE;QACR,CAAC;QACDtC,iBAAiB,EAAE;UACjBsC,IAAI,EAAE;QACR,CAAC;QACDxC,kBAAkB,EAAE;UAClBwC,IAAI,EAAE;QACR,CAAC;QACDzC,cAAc,EAAE;UACdyC,IAAI,EAAE;QACR,CAAC;QACDvC,cAAc,EAAE;UACd4D,KAAK,EAAE;YACLrB,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAsB,OAAA,CAAAvE,OAAA,GAAAC,QAAA;AAAAuE,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAvE,OAAA"}
|
|
1
|
+
{"version":3,"file":"multilineBlocks.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","utils","allowMultipleTags","noFinalLineText","noZeroLineText","noSingleLineBlocks","singleLineTags","noMultilineBlocks","minimumLengthForMultiline","Number","POSITIVE_INFINITY","multilineTags","options","source","tokens","description","tag","sourceLength","length","isInvalidSingleLine","tagName","includes","slice","fixer","makeMultiline","reportJSDoc","lineChecks","line","emptyTokens","delimiter","start","addLine","finalLine","finalLineTokens","trim","trimEnd","prop","end","tags","hasATag","filterTags","tg","number","reduce","desc","type","typ","name","nme","lineEnd","postType","postName","postTag","nameOrDescription","seedTokens","postDelimiter","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","anyOf","enum","items","exports","module"],"sources":["../../src/rules/multilineBlocks.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const {\n allowMultipleTags = true,\n noFinalLineText = true,\n noZeroLineText = true,\n noSingleLineBlocks = false,\n singleLineTags = [\n 'lends', 'type',\n ],\n noMultilineBlocks = false,\n minimumLengthForMultiline = Number.POSITIVE_INFINITY,\n multilineTags = [\n '*',\n ],\n } = context.options[0] || {};\n\n const {\n source: [\n {\n tokens,\n },\n ],\n } = jsdoc;\n const {\n description,\n tag,\n } = tokens;\n const sourceLength = jsdoc.source.length;\n\n const isInvalidSingleLine = (tagName) => {\n return noSingleLineBlocks &&\n (!tagName ||\n !singleLineTags.includes(tagName) && !singleLineTags.includes('*'));\n };\n\n if (sourceLength === 1) {\n if (!isInvalidSingleLine(tag.slice(1))) {\n return;\n }\n\n const fixer = () => {\n utils.makeMultiline();\n };\n\n utils.reportJSDoc(\n 'Single line blocks are not permitted by your configuration.',\n null,\n fixer,\n true,\n );\n\n return;\n }\n\n const lineChecks = () => {\n if (\n noZeroLineText &&\n (tag || description)\n ) {\n const fixer = () => {\n const line = {\n ...tokens,\n };\n utils.emptyTokens(tokens);\n const {\n tokens: {\n delimiter,\n start,\n },\n } = jsdoc.source[1];\n utils.addLine(1, {\n ...line,\n delimiter,\n start,\n });\n };\n\n utils.reportJSDoc(\n 'Should have no text on the \"0th\" line (after the `/**`).',\n null,\n fixer,\n );\n\n return;\n }\n\n const finalLine = jsdoc.source[jsdoc.source.length - 1];\n const finalLineTokens = finalLine.tokens;\n if (\n noFinalLineText &&\n finalLineTokens.description.trim()\n ) {\n const fixer = () => {\n const line = {\n ...finalLineTokens,\n };\n line.description = line.description.trimEnd();\n\n const {\n delimiter,\n } = line;\n\n for (const prop of [\n 'delimiter',\n 'postDelimiter',\n 'tag',\n 'type',\n 'lineEnd',\n 'postType',\n 'postTag',\n 'name',\n 'postName',\n 'description',\n ]) {\n finalLineTokens[prop] = '';\n }\n\n utils.addLine(jsdoc.source.length - 1, {\n ...line,\n delimiter,\n end: '',\n });\n };\n\n utils.reportJSDoc(\n 'Should have no text on the final line (before the `*/`).',\n null,\n fixer,\n );\n }\n };\n\n if (noMultilineBlocks) {\n if (\n jsdoc.tags.length &&\n (multilineTags.includes('*') || utils.hasATag(multilineTags))\n ) {\n lineChecks();\n\n return;\n }\n\n if (jsdoc.description.length >= minimumLengthForMultiline) {\n lineChecks();\n\n return;\n }\n\n if (\n noSingleLineBlocks &&\n (!jsdoc.tags.length ||\n !utils.filterTags(({\n tag: tg,\n }) => {\n return !isInvalidSingleLine(tg);\n }).length)\n ) {\n utils.reportJSDoc(\n 'Multiline jsdoc blocks are prohibited by ' +\n 'your configuration but fixing would result in a single ' +\n 'line block which you have prohibited with `noSingleLineBlocks`.',\n );\n\n return;\n }\n\n if (jsdoc.tags.length > 1) {\n if (!allowMultipleTags) {\n utils.reportJSDoc(\n 'Multiline jsdoc blocks are prohibited by ' +\n 'your configuration but the block has multiple tags.',\n );\n\n return;\n }\n } else if (jsdoc.tags.length === 1 && jsdoc.description.trim()) {\n if (!allowMultipleTags) {\n utils.reportJSDoc(\n 'Multiline jsdoc blocks are prohibited by ' +\n 'your configuration but the block has a description with a tag.',\n );\n\n return;\n }\n } else {\n const fixer = () => {\n jsdoc.source = [\n {\n number: 1,\n source: '',\n tokens: jsdoc.source.reduce((obj, {\n tokens: {\n description: desc,\n tag: tg,\n type: typ,\n name: nme,\n lineEnd,\n postType,\n postName,\n postTag,\n },\n }) => {\n if (typ) {\n obj.type = typ;\n }\n\n if (tg && typ && nme) {\n obj.postType = postType;\n }\n\n if (nme) {\n obj.name += nme;\n }\n\n if (nme && desc) {\n obj.postName = postName;\n }\n\n obj.description += desc;\n\n const nameOrDescription = obj.description || obj.name;\n if (\n nameOrDescription && nameOrDescription.slice(-1) !== ' '\n ) {\n obj.description += ' ';\n }\n\n obj.lineEnd = lineEnd;\n\n // Already filtered for multiple tags\n obj.tag += tg;\n if (tg) {\n obj.postTag = postTag || ' ';\n }\n\n return obj;\n }, utils.seedTokens({\n delimiter: '/**',\n end: '*/',\n postDelimiter: ' ',\n })),\n },\n ];\n };\n\n utils.reportJSDoc(\n 'Multiline jsdoc blocks are prohibited by ' +\n 'your configuration.',\n null,\n fixer,\n );\n\n return;\n }\n }\n\n lineChecks();\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Controls how and whether jsdoc blocks can be expressed as single or multiple line blocks.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-multiline-blocks',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowMultipleTags: {\n type: 'boolean',\n },\n minimumLengthForMultiline: {\n type: 'integer',\n },\n multilineTags: {\n anyOf: [\n {\n enum: [\n '*',\n ],\n type: 'string',\n }, {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n ],\n },\n noFinalLineText: {\n type: 'boolean',\n },\n noMultilineBlocks: {\n type: 'boolean',\n },\n noSingleLineBlocks: {\n type: 'boolean',\n },\n noZeroLineText: {\n type: 'boolean',\n },\n singleLineTags: {\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;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,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AEDtD,KAAK,CAACwB,WAAW,CACf,2CAA2C,GACzC,qBAAqB,EACvB,IAAI,EACJF,KACF,CAAC;MAED;IACF;EACF;EAEAG,UAAU,CAAC,CAAC;AACd,CAAC,EAAE;EACD8B,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJ3C,WAAW,EAAE,2FAA2F;MACxG4C,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACV7D,iBAAiB,EAAE;UACjB2C,IAAI,EAAE;QACR,CAAC;QACDrC,yBAAyB,EAAE;UACzBqC,IAAI,EAAE;QACR,CAAC;QACDlC,aAAa,EAAE;UACbqD,KAAK,EAAE,CACL;YACEC,IAAI,EAAE,CACJ,GAAG,CACJ;YACDpB,IAAI,EAAE;UACR,CAAC,EAAE;YACDqB,KAAK,EAAE;cACLrB,IAAI,EAAE;YACR,CAAC;YACDA,IAAI,EAAE;UACR,CAAC;QAEL,CAAC;QACD1C,eAAe,EAAE;UACf0C,IAAI,EAAE;QACR,CAAC;QACDtC,iBAAiB,EAAE;UACjBsC,IAAI,EAAE;QACR,CAAC;QACDxC,kBAAkB,EAAE;UAClBwC,IAAI,EAAE;QACR,CAAC;QACDzC,cAAc,EAAE;UACdyC,IAAI,EAAE;QACR,CAAC;QACDvC,cAAc,EAAE;UACd4D,KAAK,EAAE;YACLrB,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAsB,OAAA,CAAAvE,OAAA,GAAAC,QAAA;AAAAuE,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAvE,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noBadBlocks.js","names":["_commentParser","require","_iterateJsdoc","_interopRequireDefault","obj","__esModule","default","commentRegexp","extraAsteriskCommentRegexp","_default","iterateJsdoc","context","sourceCode","allComments","makeReport","ignore","preventAllMultiAsteriskBlocks","options","extraAsterisks","nonJsdocNodes","filter","comment","commentText","getText","sliceIndex","test","_extraAsteriskComment","multiline","exec","length","tags","commentParser","slice","some","tag","includes","node","report","fix","fixer","text","replaceText","replace","checkFile","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","type","exports","module"],"sources":["../../src/rules/noBadBlocks.js"],"sourcesContent":["import {\n parse as commentParser,\n} from 'comment-parser';\nimport iterateJsdoc from '../iterateJsdoc';\n\n// Neither a single nor 3+ asterisks are valid jsdoc per\n// https://jsdoc.app/about-getting-started.html#adding-documentation-comments-to-your-code\nconst commentRegexp = /^\\/\\*(?!\\*)/u;\nconst extraAsteriskCommentRegexp = /^\\/\\*{3,}/u;\n\nexport default iterateJsdoc(({\n context,\n sourceCode,\n allComments,\n makeReport,\n}) => {\n const [\n {\n ignore = [\n 'ts-check',\n 'ts-expect-error',\n 'ts-ignore',\n 'ts-nocheck',\n ],\n preventAllMultiAsteriskBlocks = false,\n } = {},\n ] = context.options;\n\n let extraAsterisks = false;\n const nonJsdocNodes = allComments.filter((comment) => {\n const commentText = sourceCode.getText(comment);\n let sliceIndex = 2;\n if (!commentRegexp.test(commentText)) {\n const multiline = extraAsteriskCommentRegexp.exec(commentText)?.[0];\n if (!multiline) {\n return false;\n }\n\n sliceIndex = multiline.length;\n extraAsterisks = true;\n if (preventAllMultiAsteriskBlocks) {\n return true;\n }\n }\n\n const [\n {\n tags = {},\n } = {},\n ] = commentParser(\n `${commentText.slice(0, 2)}*${commentText.slice(sliceIndex)}`,\n );\n\n return tags.length && !tags.some(({\n tag,\n }) => {\n return ignore.includes(tag);\n });\n });\n\n if (!nonJsdocNodes.length) {\n return;\n }\n\n for (const node of nonJsdocNodes) {\n const report = makeReport(context, node);\n\n // eslint-disable-next-line no-loop-func\n const fix = (fixer) => {\n const text = sourceCode.getText(node);\n\n return fixer.replaceText(\n node,\n extraAsterisks ?\n text.replace(extraAsteriskCommentRegexp, '/**') :\n text.replace('/*', '/**'),\n );\n };\n\n report('Expected JSDoc-like comment to begin with two asterisks.', fix);\n }\n}, {\n checkFile: true,\n meta: {\n docs: {\n description: 'This rule checks for multi-line-style comments which fail to meet the criteria of a jsdoc block.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-bad-blocks',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n ignore: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n preventAllMultiAsteriskBlocks: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAGA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA2C,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C;AACA;AACA,MAAMG,aAAa,GAAG,cAAc;AACpC,MAAMC,0BAA0B,GAAG,YAAY;AAAC,IAAAC,QAAA,GAEjC,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,UAAU;EACVC,WAAW;EACXC;AACF,CAAC,KAAK;EACJ,MAAM,CACJ;IACEC,MAAM,GAAG,CACP,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,CACb;IACDC,6BAA6B,GAAG;EAClC,CAAC,GAAG,CAAC,CAAC,CACP,GAAGL,OAAO,CAACM,OAAO;EAEnB,IAAIC,cAAc,GAAG,KAAK;EAC1B,MAAMC,aAAa,GAAGN,WAAW,CAACO,MAAM,CAAEC,OAAO,IAAK;IACpD,MAAMC,WAAW,GAAGV,UAAU,CAACW,OAAO,CAACF,OAAO,CAAC;IAC/C,IAAIG,UAAU,GAAG,CAAC;IAClB,IAAI,CAACjB,aAAa,CAACkB,IAAI,CAACH,WAAW,CAAC,EAAE;MAAA,IAAAI,qBAAA;MACpC,MAAMC,SAAS,IAAAD,qBAAA,GAAGlB,0BAA0B,CAACoB,IAAI,CAACN,WAAW,CAAC,cAAAI,qBAAA,uBAA5CA,qBAAA,CAA+C,CAAC,CAAC;MACnE,IAAI,CAACC,SAAS,EAAE;QACd,OAAO,KAAK;MACd;MAEAH,UAAU,GAAGG,SAAS,CAACE,MAAM;MAC7BX,cAAc,GAAG,IAAI;MACrB,IAAIF,6BAA6B,EAAE;QACjC,OAAO,IAAI;MACb;IACF;IAEA,MAAM,CACJ;MACEc,IAAI,GAAG,CAAC;IACV,CAAC,GAAG,CAAC,CAAC,CACP,GAAG,IAAAC,oBAAa,EACd,GAAET,WAAW,CAACU,KAAK,CAAC,CAAC,EAAE,CAAC,CAAE,IAAGV,WAAW,CAACU,KAAK,CAACR,UAAU,CAAE,
|
|
1
|
+
{"version":3,"file":"noBadBlocks.js","names":["_commentParser","require","_iterateJsdoc","_interopRequireDefault","obj","__esModule","default","commentRegexp","extraAsteriskCommentRegexp","_default","iterateJsdoc","context","sourceCode","allComments","makeReport","ignore","preventAllMultiAsteriskBlocks","options","extraAsterisks","nonJsdocNodes","filter","comment","commentText","getText","sliceIndex","test","_extraAsteriskComment","multiline","exec","length","tags","commentParser","slice","some","tag","includes","node","report","fix","fixer","text","replaceText","replace","checkFile","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","type","exports","module"],"sources":["../../src/rules/noBadBlocks.js"],"sourcesContent":["import {\n parse as commentParser,\n} from 'comment-parser';\nimport iterateJsdoc from '../iterateJsdoc';\n\n// Neither a single nor 3+ asterisks are valid jsdoc per\n// https://jsdoc.app/about-getting-started.html#adding-documentation-comments-to-your-code\nconst commentRegexp = /^\\/\\*(?!\\*)/u;\nconst extraAsteriskCommentRegexp = /^\\/\\*{3,}/u;\n\nexport default iterateJsdoc(({\n context,\n sourceCode,\n allComments,\n makeReport,\n}) => {\n const [\n {\n ignore = [\n 'ts-check',\n 'ts-expect-error',\n 'ts-ignore',\n 'ts-nocheck',\n ],\n preventAllMultiAsteriskBlocks = false,\n } = {},\n ] = context.options;\n\n let extraAsterisks = false;\n const nonJsdocNodes = allComments.filter((comment) => {\n const commentText = sourceCode.getText(comment);\n let sliceIndex = 2;\n if (!commentRegexp.test(commentText)) {\n const multiline = extraAsteriskCommentRegexp.exec(commentText)?.[0];\n if (!multiline) {\n return false;\n }\n\n sliceIndex = multiline.length;\n extraAsterisks = true;\n if (preventAllMultiAsteriskBlocks) {\n return true;\n }\n }\n\n const [\n {\n tags = {},\n } = {},\n ] = commentParser(\n `${commentText.slice(0, 2)}*${commentText.slice(sliceIndex)}`,\n );\n\n return tags.length && !tags.some(({\n tag,\n }) => {\n return ignore.includes(tag);\n });\n });\n\n if (!nonJsdocNodes.length) {\n return;\n }\n\n for (const node of nonJsdocNodes) {\n const report = makeReport(context, node);\n\n // eslint-disable-next-line no-loop-func\n const fix = (fixer) => {\n const text = sourceCode.getText(node);\n\n return fixer.replaceText(\n node,\n extraAsterisks ?\n text.replace(extraAsteriskCommentRegexp, '/**') :\n text.replace('/*', '/**'),\n );\n };\n\n report('Expected JSDoc-like comment to begin with two asterisks.', fix);\n }\n}, {\n checkFile: true,\n meta: {\n docs: {\n description: 'This rule checks for multi-line-style comments which fail to meet the criteria of a jsdoc block.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-bad-blocks',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n ignore: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n preventAllMultiAsteriskBlocks: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAGA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA2C,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CA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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noBlankBlockDescriptions.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","anyWhitespaceLines","atLeastTwoLinesWhitespace","_default","iterateJsdoc","jsdoc","utils","description","descriptions","lastDescriptionLine","getDescription","regex","tags","length","test","reportJSDoc","line","setBlockDescription","info","seedTokens","tokens","iterateAllJsdocs","meta","docs","url","fixable","schema","type","exports","module"],"sources":["../../src/rules/noBlankBlockDescriptions.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst anyWhitespaceLines = /^\\s*$/u;\nconst atLeastTwoLinesWhitespace = /^[ \\t]*\\n[ \\t]*\\n\\s*$/u;\n\nexport default iterateJsdoc(({\n jsdoc,\n utils,\n}) => {\n const {\n description,\n descriptions,\n lastDescriptionLine,\n } = utils.getDescription();\n\n const regex = jsdoc.tags.length ?\n anyWhitespaceLines :\n atLeastTwoLinesWhitespace;\n\n if (descriptions.length && regex.test(description)) {\n if (jsdoc.tags.length) {\n utils.reportJSDoc(\n 'There should be no blank lines in block descriptions followed by tags.',\n {\n line: lastDescriptionLine,\n },\n () => {\n utils.setBlockDescription(() => {\n // Remove all lines\n return [];\n });\n },\n );\n } else {\n utils.reportJSDoc(\n 'There should be no extra blank lines in block descriptions not followed by tags.',\n {\n line: lastDescriptionLine,\n },\n () => {\n utils.setBlockDescription((info, seedTokens) => {\n return [\n // Keep the starting line\n {\n tokens: seedTokens({\n ...info,\n description: '',\n }),\n },\n ];\n });\n },\n );\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Detects and removes extra lines of a blank block description',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-blank-block-descriptions',\n },\n fixable: 'whitespace',\n schema: [],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,kBAAkB,GAAG,QAAQ;AACnC,MAAMC,yBAAyB,GAAG,wBAAwB;AAAC,IAAAC,QAAA,GAE5C,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,WAAW;IACXC,YAAY;IACZC;EACF,CAAC,GAAGH,KAAK,CAACI,cAAc,
|
|
1
|
+
{"version":3,"file":"noBlankBlockDescriptions.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","anyWhitespaceLines","atLeastTwoLinesWhitespace","_default","iterateJsdoc","jsdoc","utils","description","descriptions","lastDescriptionLine","getDescription","regex","tags","length","test","reportJSDoc","line","setBlockDescription","info","seedTokens","tokens","iterateAllJsdocs","meta","docs","url","fixable","schema","type","exports","module"],"sources":["../../src/rules/noBlankBlockDescriptions.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst anyWhitespaceLines = /^\\s*$/u;\nconst atLeastTwoLinesWhitespace = /^[ \\t]*\\n[ \\t]*\\n\\s*$/u;\n\nexport default iterateJsdoc(({\n jsdoc,\n utils,\n}) => {\n const {\n description,\n descriptions,\n lastDescriptionLine,\n } = utils.getDescription();\n\n const regex = jsdoc.tags.length ?\n anyWhitespaceLines :\n atLeastTwoLinesWhitespace;\n\n if (descriptions.length && regex.test(description)) {\n if (jsdoc.tags.length) {\n utils.reportJSDoc(\n 'There should be no blank lines in block descriptions followed by tags.',\n {\n line: lastDescriptionLine,\n },\n () => {\n utils.setBlockDescription(() => {\n // Remove all lines\n return [];\n });\n },\n );\n } else {\n utils.reportJSDoc(\n 'There should be no extra blank lines in block descriptions not followed by tags.',\n {\n line: lastDescriptionLine,\n },\n () => {\n utils.setBlockDescription((info, seedTokens) => {\n return [\n // Keep the starting line\n {\n tokens: seedTokens({\n ...info,\n description: '',\n }),\n },\n ];\n });\n },\n );\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Detects and removes extra lines of a blank block description',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-blank-block-descriptions',\n },\n fixable: 'whitespace',\n schema: [],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,kBAAkB,GAAG,QAAQ;AACnC,MAAMC,yBAAyB,GAAG,wBAAwB;AAAC,IAAAC,QAAA,GAE5C,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,WAAW;IACXC,YAAY;IACZC;EACF,CAAC,GAAGH,KAAK,CAACI,cAAc,CAAC,CAAC;EAE1B,MAAMC,KAAK,GAAGN,KAAK,CAACO,IAAI,CAACC,MAAM,GAC7BZ,kBAAkB,GAClBC,yBAAyB;EAE3B,IAAIM,YAAY,CAACK,MAAM,IAAIF,KAAK,CAACG,IAAI,CAACP,WAAW,CAAC,EAAE;IAClD,IAAIF,KAAK,CAACO,IAAI,CAACC,MAAM,EAAE;MACrBP,KAAK,CAACS,WAAW,CACf,wEAAwE,EACxE;QACEC,IAAI,EAAEP;MACR,CAAC,EACD,MAAM;QACJH,KAAK,CAACW,mBAAmB,CAAC,MAAM;UAC9B;UACA,OAAO,EAAE;QACX,CAAC,CAAC;MACJ,CACF,CAAC;IACH,CAAC,MAAM;MACLX,KAAK,CAACS,WAAW,CACf,kFAAkF,EAClF;QACEC,IAAI,EAAEP;MACR,CAAC,EACD,MAAM;QACJH,KAAK,CAACW,mBAAmB,CAAC,CAACC,IAAI,EAAEC,UAAU,KAAK;UAC9C,OAAO;UACL;UACA;YACEC,MAAM,EAAED,UAAU,CAAC;cACjB,GAAGD,IAAI;cACPX,WAAW,EAAE;YACf,CAAC;UACH,CAAC,CACF;QACH,CAAC,CAAC;MACJ,CACF,CAAC;IACH;EACF;AACF,CAAC,EAAE;EACDc,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJhB,WAAW,EAAE,8DAA8D;MAC3EiB,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,YAAY;IACrBC,MAAM,EAAE,EAAE;IACVC,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAC,OAAA,CAAA5B,OAAA,GAAAG,QAAA;AAAA0B,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA5B,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noBlankBlocks.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","utils","tags","length","description","lastDescriptionLine","getDescription","trim","enableFixer","options","reportJSDoc","line","source","splice","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","type","exports","module"],"sources":["../../src/rules/noBlankBlocks.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n if (jsdoc.tags.length) {\n return;\n }\n\n const {\n description,\n lastDescriptionLine,\n } = utils.getDescription();\n if (description.trim()) {\n return;\n }\n\n const {\n enableFixer,\n } = context.options[0] || {};\n\n utils.reportJSDoc(\n 'No empty blocks',\n {\n line: lastDescriptionLine,\n },\n enableFixer ? () => {\n jsdoc.source.splice(0, jsdoc.source.length);\n } : null,\n );\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Removes empty blocks with nothing but possibly line breaks',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-blank-blocks',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n enableFixer: {\n type: 'boolean',\n },\n },\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,IAAID,KAAK,CAACE,IAAI,CAACC,MAAM,EAAE;IACrB;EACF;EAEA,MAAM;IACJC,WAAW;IACXC;EACF,CAAC,GAAGJ,KAAK,CAACK,cAAc,
|
|
1
|
+
{"version":3,"file":"noBlankBlocks.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","utils","tags","length","description","lastDescriptionLine","getDescription","trim","enableFixer","options","reportJSDoc","line","source","splice","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","type","exports","module"],"sources":["../../src/rules/noBlankBlocks.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n if (jsdoc.tags.length) {\n return;\n }\n\n const {\n description,\n lastDescriptionLine,\n } = utils.getDescription();\n if (description.trim()) {\n return;\n }\n\n const {\n enableFixer,\n } = context.options[0] || {};\n\n utils.reportJSDoc(\n 'No empty blocks',\n {\n line: lastDescriptionLine,\n },\n enableFixer ? () => {\n jsdoc.source.splice(0, jsdoc.source.length);\n } : null,\n );\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Removes empty blocks with nothing but possibly line breaks',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-blank-blocks',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n enableFixer: {\n type: 'boolean',\n },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AA,CAAA3B,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noDefaults.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","utils","noOptionalParamNames","options","paramTags","getPresentTags","tag","optional","reportJSDoc","changeTag","name","replace","defaultTags","description","trim","postTag","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","type","comment","exports","module"],"sources":["../../src/rules/noDefaults.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n utils,\n}) => {\n const {\n noOptionalParamNames,\n } = context.options[0] || {};\n const paramTags = utils.getPresentTags([\n 'param', 'arg', 'argument',\n ]);\n for (const tag of paramTags) {\n if (noOptionalParamNames && tag.optional) {\n utils.reportJSDoc(`Optional param names are not permitted on @${tag.tag}.`, tag, () => {\n utils.changeTag(tag, {\n name: tag.name.replace(/([^=]*)(=.+)?/u, '$1'),\n });\n });\n } else if (tag.default) {\n utils.reportJSDoc(`Defaults are not permitted on @${tag.tag}.`, tag, () => {\n utils.changeTag(tag, {\n name: tag.name.replace(/([^=]*)(=.+)?/u, '[$1]'),\n });\n });\n }\n }\n\n const defaultTags = utils.getPresentTags([\n 'default', 'defaultvalue',\n ]);\n for (const tag of defaultTags) {\n if (tag.description.trim()) {\n utils.reportJSDoc(`Default values are not permitted on @${tag.tag}.`, tag, () => {\n utils.changeTag(tag, {\n description: '',\n postTag: '',\n });\n });\n }\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'This rule reports defaults being used on the relevant portion of `@param` or `@default`.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-defaults',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\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 noOptionalParamNames: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC;EACF,CAAC,GAAGF,OAAO,CAACG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAC5B,MAAMC,SAAS,GAAGH,KAAK,CAACI,cAAc,CAAC,CACrC,OAAO,EAAE,KAAK,EAAE,UAAU,CAC3B,CAAC;EACF,KAAK,MAAMC,GAAG,IAAIF,SAAS,EAAE;IAC3B,IAAIF,oBAAoB,IAAII,GAAG,CAACC,QAAQ,EAAE;MACxCN,KAAK,CAACO,WAAW,CAAE,8CAA6CF,GAAG,CAACA,GAAI,GAAE,EAAEA,GAAG,EAAE,MAAM;QACrFL,KAAK,CAACQ,SAAS,CAACH,GAAG,EAAE;UACnBI,IAAI,EAAEJ,GAAG,CAACI,IAAI,CAACC,OAAO,CAAC,gBAAgB,EAAE,IAAI;QAC/C,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,MAAM,IAAIL,GAAG,CAACT,OAAO,EAAE;MACtBI,KAAK,CAACO,WAAW,CAAE,kCAAiCF,GAAG,CAACA,GAAI,GAAE,EAAEA,GAAG,EAAE,MAAM;QACzEL,KAAK,CAACQ,SAAS,CAACH,GAAG,EAAE;UACnBI,IAAI,EAAEJ,GAAG,CAACI,IAAI,CAACC,OAAO,CAAC,gBAAgB,EAAE,MAAM;QACjD,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;EACF;EAEA,MAAMC,WAAW,GAAGX,KAAK,CAACI,cAAc,CAAC,CACvC,SAAS,EAAE,cAAc,CAC1B,CAAC;EACF,KAAK,MAAMC,GAAG,IAAIM,WAAW,EAAE;IAC7B,IAAIN,GAAG,CAACO,WAAW,CAACC,IAAI,
|
|
1
|
+
{"version":3,"file":"noDefaults.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","utils","noOptionalParamNames","options","paramTags","getPresentTags","tag","optional","reportJSDoc","changeTag","name","replace","defaultTags","description","trim","postTag","contextDefaults","meta","docs","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","type","comment","exports","module"],"sources":["../../src/rules/noDefaults.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n utils,\n}) => {\n const {\n noOptionalParamNames,\n } = context.options[0] || {};\n const paramTags = utils.getPresentTags([\n 'param', 'arg', 'argument',\n ]);\n for (const tag of paramTags) {\n if (noOptionalParamNames && tag.optional) {\n utils.reportJSDoc(`Optional param names are not permitted on @${tag.tag}.`, tag, () => {\n utils.changeTag(tag, {\n name: tag.name.replace(/([^=]*)(=.+)?/u, '$1'),\n });\n });\n } else if (tag.default) {\n utils.reportJSDoc(`Defaults are not permitted on @${tag.tag}.`, tag, () => {\n utils.changeTag(tag, {\n name: tag.name.replace(/([^=]*)(=.+)?/u, '[$1]'),\n });\n });\n }\n }\n\n const defaultTags = utils.getPresentTags([\n 'default', 'defaultvalue',\n ]);\n for (const tag of defaultTags) {\n if (tag.description.trim()) {\n utils.reportJSDoc(`Default values are not permitted on @${tag.tag}.`, tag, () => {\n utils.changeTag(tag, {\n description: '',\n postTag: '',\n });\n });\n }\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'This rule reports defaults being used on the relevant portion of `@param` or `@default`.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-defaults',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\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 noOptionalParamNames: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC;EACF,CAAC,GAAGF,OAAO,CAACG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAC5B,MAAMC,SAAS,GAAGH,KAAK,CAACI,cAAc,CAAC,CACrC,OAAO,EAAE,KAAK,EAAE,UAAU,CAC3B,CAAC;EACF,KAAK,MAAMC,GAAG,IAAIF,SAAS,EAAE;IAC3B,IAAIF,oBAAoB,IAAII,GAAG,CAACC,QAAQ,EAAE;MACxCN,KAAK,CAACO,WAAW,CAAE,8CAA6CF,GAAG,CAACA,GAAI,GAAE,EAAEA,GAAG,EAAE,MAAM;QACrFL,KAAK,CAACQ,SAAS,CAACH,GAAG,EAAE;UACnBI,IAAI,EAAEJ,GAAG,CAACI,IAAI,CAACC,OAAO,CAAC,gBAAgB,EAAE,IAAI;QAC/C,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,MAAM,IAAIL,GAAG,CAACT,OAAO,EAAE;MACtBI,KAAK,CAACO,WAAW,CAAE,kCAAiCF,GAAG,CAACA,GAAI,GAAE,EAAEA,GAAG,EAAE,MAAM;QACzEL,KAAK,CAACQ,SAAS,CAACH,GAAG,EAAE;UACnBI,IAAI,EAAEJ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GAAAC,QAAA;AAAAgC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAhC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noMultiAsterisks.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","middleAsterisksBlockWS","middleAsterisksNoBlockWS","endAsterisksSingleLineBlockWS","endAsterisksMultipleLineBlockWS","endAsterisksSingleLineNoBlockWS","endAsterisksMultipleLineNoBlockWS","_default","iterateJsdoc","context","jsdoc","utils","allowWhitespace","preventAtEnd","preventAtMiddleLines","options","middleAsterisks","source","some","tokens","number","delimiter","tag","name","type","description","end","postDelimiter","test","fix","replace","reportJSDoc","line","isSingleLineBlock","delim","endAsterisks","endingAsterisksAndSpaces","match","trim","endFix","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","exports","module"],"sources":["../../src/rules/noMultiAsterisks.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst middleAsterisksBlockWS = /^([\\t ]|\\*(?!\\*))+/u;\nconst middleAsterisksNoBlockWS = /^\\*+/u;\n\nconst endAsterisksSingleLineBlockWS = /\\*((?:\\*|(?: |\\t))*)\\*$/u;\nconst endAsterisksMultipleLineBlockWS = /((?:\\*|(?: |\\t))*)\\*$/u;\n\nconst endAsterisksSingleLineNoBlockWS = /\\*(\\**)\\*$/u;\nconst endAsterisksMultipleLineNoBlockWS = /(\\**)\\*$/u;\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const {\n allowWhitespace = false,\n preventAtEnd = true,\n preventAtMiddleLines = true,\n } = context.options[0] || {};\n\n const middleAsterisks = allowWhitespace ? middleAsterisksNoBlockWS : middleAsterisksBlockWS;\n\n // eslint-disable-next-line complexity -- Todo\n jsdoc.source.some(({\n tokens,\n number,\n }) => {\n const {\n delimiter,\n tag,\n name,\n type,\n description,\n end,\n postDelimiter,\n } = tokens;\n\n if (\n preventAtMiddleLines &&\n !end && !tag && !type && !name &&\n (\n !allowWhitespace && middleAsterisks.test(description) ||\n allowWhitespace && middleAsterisks.test(postDelimiter + description)\n )\n ) {\n // console.log('description', JSON.stringify(description));\n const fix = () => {\n tokens.description = description.replace(middleAsterisks, '');\n };\n\n utils.reportJSDoc(\n 'Should be no multiple asterisks on middle lines.',\n {\n line: number,\n },\n fix,\n true,\n );\n\n return true;\n }\n\n if (!preventAtEnd || !end) {\n return false;\n }\n\n const isSingleLineBlock = delimiter === '/**';\n const delim = isSingleLineBlock ? '*' : delimiter;\n let endAsterisks;\n if (allowWhitespace) {\n endAsterisks = isSingleLineBlock ? endAsterisksSingleLineNoBlockWS : endAsterisksMultipleLineNoBlockWS;\n } else {\n endAsterisks = isSingleLineBlock ? endAsterisksSingleLineBlockWS : endAsterisksMultipleLineBlockWS;\n }\n\n const endingAsterisksAndSpaces = (\n allowWhitespace ? postDelimiter + description + delim : description + delim\n ).match(\n endAsterisks,\n );\n\n if (\n !endingAsterisksAndSpaces ||\n !isSingleLineBlock && endingAsterisksAndSpaces[1] && !endingAsterisksAndSpaces[1].trim()\n ) {\n return false;\n }\n\n const endFix = () => {\n if (!isSingleLineBlock) {\n tokens.delimiter = '';\n }\n\n tokens.description = (description + delim).replace(endAsterisks, '');\n };\n\n utils.reportJSDoc(\n 'Should be no multiple asterisks on end lines.',\n {\n line: number,\n },\n endFix,\n true,\n );\n\n return true;\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: '',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-multi-asterisks',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowWhitespace: {\n type: 'boolean',\n },\n preventAtEnd: {\n type: 'boolean',\n },\n preventAtMiddleLines: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uB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CACf,kDAAkD,EAClD;QACEC,IAAI,EAAEZ;MACR,CAAC,EACDS,GAAG,EACH,
|
|
1
|
+
{"version":3,"file":"noMultiAsterisks.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","middleAsterisksBlockWS","middleAsterisksNoBlockWS","endAsterisksSingleLineBlockWS","endAsterisksMultipleLineBlockWS","endAsterisksSingleLineNoBlockWS","endAsterisksMultipleLineNoBlockWS","_default","iterateJsdoc","context","jsdoc","utils","allowWhitespace","preventAtEnd","preventAtMiddleLines","options","middleAsterisks","source","some","tokens","number","delimiter","tag","name","type","description","end","postDelimiter","test","fix","replace","reportJSDoc","line","isSingleLineBlock","delim","endAsterisks","endingAsterisksAndSpaces","match","trim","endFix","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperties","properties","exports","module"],"sources":["../../src/rules/noMultiAsterisks.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst middleAsterisksBlockWS = /^([\\t ]|\\*(?!\\*))+/u;\nconst middleAsterisksNoBlockWS = /^\\*+/u;\n\nconst endAsterisksSingleLineBlockWS = /\\*((?:\\*|(?: |\\t))*)\\*$/u;\nconst endAsterisksMultipleLineBlockWS = /((?:\\*|(?: |\\t))*)\\*$/u;\n\nconst endAsterisksSingleLineNoBlockWS = /\\*(\\**)\\*$/u;\nconst endAsterisksMultipleLineNoBlockWS = /(\\**)\\*$/u;\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n}) => {\n const {\n allowWhitespace = false,\n preventAtEnd = true,\n preventAtMiddleLines = true,\n } = context.options[0] || {};\n\n const middleAsterisks = allowWhitespace ? middleAsterisksNoBlockWS : middleAsterisksBlockWS;\n\n // eslint-disable-next-line complexity -- Todo\n jsdoc.source.some(({\n tokens,\n number,\n }) => {\n const {\n delimiter,\n tag,\n name,\n type,\n description,\n end,\n postDelimiter,\n } = tokens;\n\n if (\n preventAtMiddleLines &&\n !end && !tag && !type && !name &&\n (\n !allowWhitespace && middleAsterisks.test(description) ||\n allowWhitespace && middleAsterisks.test(postDelimiter + description)\n )\n ) {\n // console.log('description', JSON.stringify(description));\n const fix = () => {\n tokens.description = description.replace(middleAsterisks, '');\n };\n\n utils.reportJSDoc(\n 'Should be no multiple asterisks on middle lines.',\n {\n line: number,\n },\n fix,\n true,\n );\n\n return true;\n }\n\n if (!preventAtEnd || !end) {\n return false;\n }\n\n const isSingleLineBlock = delimiter === '/**';\n const delim = isSingleLineBlock ? '*' : delimiter;\n let endAsterisks;\n if (allowWhitespace) {\n endAsterisks = isSingleLineBlock ? endAsterisksSingleLineNoBlockWS : endAsterisksMultipleLineNoBlockWS;\n } else {\n endAsterisks = isSingleLineBlock ? endAsterisksSingleLineBlockWS : endAsterisksMultipleLineBlockWS;\n }\n\n const endingAsterisksAndSpaces = (\n allowWhitespace ? postDelimiter + description + delim : description + delim\n ).match(\n endAsterisks,\n );\n\n if (\n !endingAsterisksAndSpaces ||\n !isSingleLineBlock && endingAsterisksAndSpaces[1] && !endingAsterisksAndSpaces[1].trim()\n ) {\n return false;\n }\n\n const endFix = () => {\n if (!isSingleLineBlock) {\n tokens.delimiter = '';\n }\n\n tokens.description = (description + delim).replace(endAsterisks, '');\n };\n\n utils.reportJSDoc(\n 'Should be no multiple asterisks on end lines.',\n {\n line: number,\n },\n endFix,\n true,\n );\n\n return true;\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: '',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-multi-asterisks',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowWhitespace: {\n type: 'boolean',\n },\n preventAtEnd: {\n type: 'boolean',\n },\n preventAtMiddleLines: {\n type: 'boolean',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA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,EAAE;MACfkB,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVnC,eAAe,EAAE;UACfY,IAAI,EAAE;QACR,CAAC;QACDX,YAAY,EAAE;UACZW,IAAI,EAAE;QACR,CAAC;QACDV,oBAAoB,EAAE;UACpBU,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAwB,OAAA,CAAAhD,OAAA,GAAAO,QAAA;AAAA0C,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAhD,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noTypes.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","removeType","tokens","postTag","type","_default","iterateJsdoc","utils","isIteratingFunction","isVirtualFunction","tags","getPresentTags","tag","reportJSDoc","source","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","exports","module"],"sources":["../../src/rules/noTypes.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst removeType = ({\n tokens,\n}) => {\n tokens.postTag = '';\n tokens.type = '';\n};\n\nexport default iterateJsdoc(({\n utils,\n}) => {\n if (!utils.isIteratingFunction() && !utils.isVirtualFunction()) {\n return;\n }\n\n const tags = utils.getPresentTags([\n 'param', 'arg', 'argument', 'returns', 'return',\n ]);\n\n for (const tag of tags) {\n if (tag.type) {\n utils.reportJSDoc(`Types are not permitted on @${tag.tag}.`, tag, () => {\n for (const source of tag.source) {\n removeType(source);\n }\n });\n }\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'This rule reports types being used on `@param` or `@returns`.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-types',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\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 },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,UAAU,GAAGA,CAAC;EAClBC;AACF,CAAC,KAAK;EACJA,MAAM,CAACC,OAAO,GAAG,EAAE;EACnBD,MAAM,CAACE,IAAI,GAAG,EAAE;AAClB,CAAC;AAAC,IAAAC,QAAA,GAEa,IAAAC,qBAAY,EAAC,CAAC;EAC3BC;AACF,CAAC,KAAK;EACJ,IAAI,CAACA,KAAK,CAACC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"noTypes.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","removeType","tokens","postTag","type","_default","iterateJsdoc","utils","isIteratingFunction","isVirtualFunction","tags","getPresentTags","tag","reportJSDoc","source","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","comment","context","exports","module"],"sources":["../../src/rules/noTypes.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst removeType = ({\n tokens,\n}) => {\n tokens.postTag = '';\n tokens.type = '';\n};\n\nexport default iterateJsdoc(({\n utils,\n}) => {\n if (!utils.isIteratingFunction() && !utils.isVirtualFunction()) {\n return;\n }\n\n const tags = utils.getPresentTags([\n 'param', 'arg', 'argument', 'returns', 'return',\n ]);\n\n for (const tag of tags) {\n if (tag.type) {\n utils.reportJSDoc(`Types are not permitted on @${tag.tag}.`, tag, () => {\n for (const source of tag.source) {\n removeType(source);\n }\n });\n }\n }\n}, {\n contextDefaults: true,\n meta: {\n docs: {\n description: 'This rule reports types being used on `@param` or `@returns`.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-types',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\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 },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,UAAU,GAAGA,CAAC;EAClBC;AACF,CAAC,KAAK;EACJA,MAAM,CAACC,OAAO,GAAG,EAAE;EACnBD,MAAM,CAACE,IAAI,GAAG,EAAE;AAClB,CAAC;AAAC,IAAAC,QAAA,GAEa,IAAAC,qBAAY,EAAC,CAAC;EAC3BC;AACF,CAAC,KAAK;EACJ,IAAI,CAACA,KAAK,CAACC,mBAAmB,CAAC,CAAC,IAAI,CAACD,KAAK,CAACE,iBAAiB,CAAC,CAAC,EAAE;IAC9D;EACF;EAEA,MAAMC,IAAI,GAAGH,KAAK,CAACI,cAAc,CAAC,CAChC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,CAChD,CAAC;EAEF,KAAK,MAAMC,GAAG,IAAIF,IAAI,EAAE;IACtB,IAAIE,GAAG,CAACR,IAAI,EAAE;MACZG,KAAK,CAACM,WAAW,CAAE,+BAA8BD,GAAG,CAACA,GAAI,GAAE,EAAEA,GAAG,EAAE,MAAM;QACtE,KAAK,MAAME,MAAM,IAAIF,GAAG,CAACE,MAAM,EAAE;UAC/Bb,UAAU,CAACa,MAAM,CAAC;QACpB;MACF,CAAC,CAAC;IACJ;EACF;AACF,CAAC,EAAE;EACDC,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,+DAA+D;MAC5EC,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVC,QAAQ,EAAE;UACRC,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEtB,IAAI,EAAE;YACR,CAAC,EACD;cACEkB,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVI,OAAO,EAAE;kBACPvB,IAAI,EAAE;gBACR,CAAC;gBACDwB,OAAO,EAAE;kBACPxB,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAyB,OAAA,CAAA7B,OAAA,GAAAK,QAAA;AAAAyB,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA7B,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noUndefinedTypes.js","names":["_jsdoccomment","require","_iterateJsdoc","_interopRequireWildcard","_jsdocUtils","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","extraTypes","typescriptGlobals","stripPseudoTypes","str","replace","_default","iterateJsdoc","context","node","report","settings","sourceCode","utils","_globalScope$childSco","_globalScope$childSco2","scopeManager","globalScope","definedTypes","options","definedPreferredTypes","preferredTypes","structuredTags","mode","keys","length","values","map","preferredType","undefined","reportSettings","replacement","filter","typedefDeclarations","getAllComments","comment","test","value","commentNode","parseComment","flatMap","doc","tags","tag","isNamepathDefiningTag","name","ancestorNodes","currentNode","_currentNode","parent","push","getTemplateTags","ancestorNode","getJSDocComment","jsdoc","jsdocUtils","filterTags","templateTags","getPresentTags","closureGenericTypes","parseClosureTemplateTag","cjsOrESMScope","childScopes","block","type","allDefinedTypes","Set","variables","concat","jsdocTagsWithPossibleType","tagMightHaveTypePosition","parsedType","tryParseType","parseType","traverse","_structuredTags$tag$t","structuredTypes","Array","isArray","includes","markVariableAsUsed","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","items","exports","module"],"sources":["../../src/rules/noUndefinedTypes.js"],"sourcesContent":["import {\n getJSDocComment,\n\n traverse,\n parse as parseType,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\nimport iterateJsdoc, {\n parseComment,\n} from '../iterateJsdoc';\nimport jsdocUtils from '../jsdocUtils';\n\nconst extraTypes = [\n 'null', 'undefined', 'void', 'string', 'boolean', 'object',\n 'function', 'symbol',\n 'number', 'bigint', 'NaN', 'Infinity',\n 'any', '*', 'never', 'unknown', 'const',\n 'this', 'true', 'false',\n 'Array', 'Object', 'RegExp', 'Date', 'Function',\n];\n\nconst typescriptGlobals = [\n // https://www.typescriptlang.org/docs/handbook/utility-types.html\n 'Partial',\n 'Required',\n 'Readonly',\n 'Record',\n 'Pick',\n 'Omit',\n 'Exclude',\n 'Extract',\n 'NonNullable',\n 'Parameters',\n 'ConstructorParameters',\n 'ReturnType',\n 'InstanceType',\n 'ThisParameterType',\n 'OmitThisParameter',\n 'ThisType',\n 'Uppercase',\n 'Lowercase',\n 'Capitalize',\n 'Uncapitalize',\n];\n\nconst stripPseudoTypes = (str) => {\n return str && str.replace(/(?:\\.|<>|\\.<>|\\[\\])$/u, '');\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n sourceCode,\n utils,\n}) => {\n const {\n scopeManager,\n } = sourceCode;\n const {\n globalScope,\n } = scopeManager;\n\n const {\n definedTypes = [],\n } = context.options[0] || {};\n\n let definedPreferredTypes = [];\n const {\n preferredTypes,\n structuredTags,\n mode,\n } = settings;\n if (Object.keys(preferredTypes).length) {\n definedPreferredTypes = Object.values(preferredTypes).map((preferredType) => {\n if (typeof preferredType === 'string') {\n // May become an empty string but will be filtered out below\n return stripPseudoTypes(preferredType);\n }\n\n if (!preferredType) {\n return undefined;\n }\n\n if (typeof preferredType !== 'object') {\n utils.reportSettings(\n 'Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.',\n );\n }\n\n return stripPseudoTypes(preferredType.replacement);\n })\n .filter((preferredType) => {\n return preferredType;\n });\n }\n\n const typedefDeclarations = context.getAllComments()\n .filter((comment) => {\n return (/^\\*\\s/u).test(comment.value);\n })\n .map((commentNode) => {\n return parseComment(commentNode, '');\n })\n .flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return utils.isNamepathDefiningTag(tag);\n });\n })\n .map((tag) => {\n return tag.name;\n });\n\n const ancestorNodes = [];\n\n let currentNode = node;\n // No need for Program node?\n while (currentNode?.parent) {\n ancestorNodes.push(currentNode);\n currentNode = currentNode.parent;\n }\n\n const getTemplateTags = function (ancestorNode) {\n const commentNode = getJSDocComment(sourceCode, ancestorNode, settings);\n if (!commentNode) {\n return [];\n }\n\n const jsdoc = parseComment(commentNode, '');\n\n return jsdocUtils.filterTags(jsdoc.tags, (tag) => {\n return tag.tag === 'template';\n });\n };\n\n // `currentScope` may be `null` or `Program`, so in such a case,\n // we look to present tags instead\n const templateTags = ancestorNodes.length ?\n ancestorNodes.flatMap((ancestorNode) => {\n return getTemplateTags(ancestorNode);\n }) :\n utils.getPresentTags('template');\n\n const closureGenericTypes = templateTags.flatMap((tag) => {\n return utils.parseClosureTemplateTag(tag);\n });\n\n // In modules, including Node, there is a global scope at top with the\n // Program scope inside\n const cjsOrESMScope = globalScope.childScopes[0]?.block?.type === 'Program';\n\n const allDefinedTypes = new Set(globalScope.variables.map(({\n name,\n }) => {\n return name;\n })\n\n // If the file is a module, concat the variables from the module scope.\n .concat(\n cjsOrESMScope ?\n globalScope.childScopes.flatMap(({\n variables,\n }) => {\n return variables;\n }).map(({\n name,\n }) => {\n return name;\n }) : [],\n )\n .concat(extraTypes)\n .concat(typedefDeclarations)\n .concat(definedTypes)\n .concat(definedPreferredTypes)\n .concat(\n settings.mode === 'jsdoc' ?\n [] :\n [\n ...settings.mode === 'typescript' ? typescriptGlobals : [],\n ...closureGenericTypes,\n ],\n ));\n\n const jsdocTagsWithPossibleType = utils.filterTags(({\n tag,\n }) => {\n return utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');\n });\n\n for (const tag of jsdocTagsWithPossibleType) {\n let parsedType;\n\n try {\n parsedType = mode === 'permissive' ? tryParseType(tag.type) : parseType(tag.type, mode);\n } catch {\n // On syntax error, will be handled by valid-types.\n continue;\n }\n\n traverse(parsedType, ({\n type,\n value,\n }) => {\n if (type === 'JsdocTypeName') {\n const structuredTypes = structuredTags[tag.tag]?.type;\n if (!allDefinedTypes.has(value) &&\n (!Array.isArray(structuredTypes) || !structuredTypes.includes(value))\n ) {\n report(`The type '${value}' is undefined.`, null, tag);\n } else if (!extraTypes.includes(value)) {\n context.markVariableAsUsed(value);\n }\n }\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Checks that types in jsdoc comments are defined.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-undefined-types',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n definedTypes: {\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,OAAA;AAOA,IAAAC,aAAA,GAAAC,uBAAA,CAAAF,OAAA;AAGA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAuC,SA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AAA;QAC5B,MAAMC,eAAe,IAAAD,qBAAA,GAAGrD,cAAc,CAACqB,GAAG,CAACA,GAAG,CAAC,cAAAgC,qBAAA,uBAAvBA,qBAAA,CAAyBX,IAAI;QACrD,IAAI,CAACC,eAAe,CAAC7E,GAAG,CAACiD,KAAK,CAAC,KAC5B,CAACwC,KAAK,CAACC,OAAO,CAACF,eAAe,CAAC,IAAI,CAACA,eAAe,CAACG,QAAQ,CAAC1C,KAAK,CAAC,CAAC,EACrE;UACA3B,MAAM,CAAE,aAAY2B,KAAM,iBAAgB,EAAE,IAAI,EAAEM,GAAG,CAAC;QACxD,CAAC,MAAM,IAAI,CAAC1C,UAAU,CAAC8E,QAAQ,CAAC1C,KAAK,CAAC,EAAE;UACtC7B,OAAO,CAACwE,kBAAkB,CAAC3C,KAAK,CAAC;QACnC;MACF;IACF,CAAC,CAAC;EACJ;AACF,CAAC,EAAE;EACD4C,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,kDAAkD;MAC/DC,GAAG,EAAE;IACP,CAAC;IACDC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVtE,YAAY,EAAE;UACZuE,KAAK,EAAE;YACLzB,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA0B,OAAA,CAAA7G,OAAA,GAAAyB,QAAA;AAAAqF,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA7G,OAAA"}
|
|
1
|
+
{"version":3,"file":"noUndefinedTypes.js","names":["_jsdoccomment","require","_iterateJsdoc","_interopRequireWildcard","_jsdocUtils","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","extraTypes","typescriptGlobals","stripPseudoTypes","str","replace","_default","iterateJsdoc","context","node","report","settings","sourceCode","utils","_globalScope$childSco","_globalScope$childSco2","scopeManager","globalScope","definedTypes","options","definedPreferredTypes","preferredTypes","structuredTags","mode","keys","length","values","map","preferredType","undefined","reportSettings","replacement","filter","typedefDeclarations","getAllComments","comment","test","value","commentNode","parseComment","flatMap","doc","tags","tag","isNamepathDefiningTag","name","ancestorNodes","currentNode","_currentNode","parent","push","getTemplateTags","ancestorNode","getJSDocComment","jsdoc","jsdocUtils","filterTags","templateTags","getPresentTags","closureGenericTypes","parseClosureTemplateTag","cjsOrESMScope","childScopes","block","type","allDefinedTypes","Set","variables","concat","jsdocTagsWithPossibleType","tagMightHaveTypePosition","parsedType","tryParseType","parseType","traverse","_structuredTags$tag$t","structuredTypes","Array","isArray","includes","markVariableAsUsed","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","items","exports","module"],"sources":["../../src/rules/noUndefinedTypes.js"],"sourcesContent":["import {\n getJSDocComment,\n\n traverse,\n parse as parseType,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\nimport iterateJsdoc, {\n parseComment,\n} from '../iterateJsdoc';\nimport jsdocUtils from '../jsdocUtils';\n\nconst extraTypes = [\n 'null', 'undefined', 'void', 'string', 'boolean', 'object',\n 'function', 'symbol',\n 'number', 'bigint', 'NaN', 'Infinity',\n 'any', '*', 'never', 'unknown', 'const',\n 'this', 'true', 'false',\n 'Array', 'Object', 'RegExp', 'Date', 'Function',\n];\n\nconst typescriptGlobals = [\n // https://www.typescriptlang.org/docs/handbook/utility-types.html\n 'Partial',\n 'Required',\n 'Readonly',\n 'Record',\n 'Pick',\n 'Omit',\n 'Exclude',\n 'Extract',\n 'NonNullable',\n 'Parameters',\n 'ConstructorParameters',\n 'ReturnType',\n 'InstanceType',\n 'ThisParameterType',\n 'OmitThisParameter',\n 'ThisType',\n 'Uppercase',\n 'Lowercase',\n 'Capitalize',\n 'Uncapitalize',\n];\n\nconst stripPseudoTypes = (str) => {\n return str && str.replace(/(?:\\.|<>|\\.<>|\\[\\])$/u, '');\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n report,\n settings,\n sourceCode,\n utils,\n}) => {\n const {\n scopeManager,\n } = sourceCode;\n const {\n globalScope,\n } = scopeManager;\n\n const {\n definedTypes = [],\n } = context.options[0] || {};\n\n let definedPreferredTypes = [];\n const {\n preferredTypes,\n structuredTags,\n mode,\n } = settings;\n if (Object.keys(preferredTypes).length) {\n definedPreferredTypes = Object.values(preferredTypes).map((preferredType) => {\n if (typeof preferredType === 'string') {\n // May become an empty string but will be filtered out below\n return stripPseudoTypes(preferredType);\n }\n\n if (!preferredType) {\n return undefined;\n }\n\n if (typeof preferredType !== 'object') {\n utils.reportSettings(\n 'Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.',\n );\n }\n\n return stripPseudoTypes(preferredType.replacement);\n })\n .filter((preferredType) => {\n return preferredType;\n });\n }\n\n const typedefDeclarations = context.getAllComments()\n .filter((comment) => {\n return (/^\\*\\s/u).test(comment.value);\n })\n .map((commentNode) => {\n return parseComment(commentNode, '');\n })\n .flatMap((doc) => {\n return doc.tags.filter(({\n tag,\n }) => {\n return utils.isNamepathDefiningTag(tag);\n });\n })\n .map((tag) => {\n return tag.name;\n });\n\n const ancestorNodes = [];\n\n let currentNode = node;\n // No need for Program node?\n while (currentNode?.parent) {\n ancestorNodes.push(currentNode);\n currentNode = currentNode.parent;\n }\n\n const getTemplateTags = function (ancestorNode) {\n const commentNode = getJSDocComment(sourceCode, ancestorNode, settings);\n if (!commentNode) {\n return [];\n }\n\n const jsdoc = parseComment(commentNode, '');\n\n return jsdocUtils.filterTags(jsdoc.tags, (tag) => {\n return tag.tag === 'template';\n });\n };\n\n // `currentScope` may be `null` or `Program`, so in such a case,\n // we look to present tags instead\n const templateTags = ancestorNodes.length ?\n ancestorNodes.flatMap((ancestorNode) => {\n return getTemplateTags(ancestorNode);\n }) :\n utils.getPresentTags('template');\n\n const closureGenericTypes = templateTags.flatMap((tag) => {\n return utils.parseClosureTemplateTag(tag);\n });\n\n // In modules, including Node, there is a global scope at top with the\n // Program scope inside\n const cjsOrESMScope = globalScope.childScopes[0]?.block?.type === 'Program';\n\n const allDefinedTypes = new Set(globalScope.variables.map(({\n name,\n }) => {\n return name;\n })\n\n // If the file is a module, concat the variables from the module scope.\n .concat(\n cjsOrESMScope ?\n globalScope.childScopes.flatMap(({\n variables,\n }) => {\n return variables;\n }).map(({\n name,\n }) => {\n return name;\n }) : [],\n )\n .concat(extraTypes)\n .concat(typedefDeclarations)\n .concat(definedTypes)\n .concat(definedPreferredTypes)\n .concat(\n settings.mode === 'jsdoc' ?\n [] :\n [\n ...settings.mode === 'typescript' ? typescriptGlobals : [],\n ...closureGenericTypes,\n ],\n ));\n\n const jsdocTagsWithPossibleType = utils.filterTags(({\n tag,\n }) => {\n return utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');\n });\n\n for (const tag of jsdocTagsWithPossibleType) {\n let parsedType;\n\n try {\n parsedType = mode === 'permissive' ? tryParseType(tag.type) : parseType(tag.type, mode);\n } catch {\n // On syntax error, will be handled by valid-types.\n continue;\n }\n\n traverse(parsedType, ({\n type,\n value,\n }) => {\n if (type === 'JsdocTypeName') {\n const structuredTypes = structuredTags[tag.tag]?.type;\n if (!allDefinedTypes.has(value) &&\n (!Array.isArray(structuredTypes) || !structuredTypes.includes(value))\n ) {\n report(`The type '${value}' is undefined.`, null, tag);\n } else if (!extraTypes.includes(value)) {\n context.markVariableAsUsed(value);\n }\n }\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Checks that types in jsdoc comments are defined.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-undefined-types',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n definedTypes: {\n items: {\n type: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AA,CAAA7G,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireDescription.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","checkDescription","description","trim","split","filter","Boolean","length","_default","iterateJsdoc","jsdoc","report","utils","context","avoidDocs","descriptionStyle","options","targetTagName","getPreferredTagName","skipReportingBlockedTag","tagName","isBlocked","blocked","getDescription","descTags","getPresentTags","tag","functionExamples","tags","example","name","getTagDescription","contextDefaults","meta","docs","url","schema","additionalProperties","properties","checkConstructors","type","checkGetters","checkSetters","contexts","items","anyOf","comment","enum","exemptedBy","exports","module"],"sources":["../../src/rules/requireDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst checkDescription = (description) => {\n return description\n .trim()\n .split('\\n')\n .filter(Boolean)\n .length;\n};\n\nexport default iterateJsdoc(({\n jsdoc,\n report,\n utils,\n context,\n}) => {\n if (utils.avoidDocs()) {\n return;\n }\n\n const {\n descriptionStyle = 'body',\n } = context.options[0] || {};\n\n let targetTagName = utils.getPreferredTagName({\n // We skip reporting except when `@description` is essential to the rule,\n // so user can block the tag and still meaningfully use this rule\n // even if the tag is present (and `check-tag-names` is the one to\n // normally report the fact that it is blocked but present)\n skipReportingBlockedTag: descriptionStyle !== 'tag',\n tagName: 'description',\n });\n if (!targetTagName) {\n return;\n }\n\n const isBlocked = typeof targetTagName === 'object' && targetTagName.blocked;\n if (isBlocked) {\n targetTagName = targetTagName.tagName;\n }\n\n if (descriptionStyle !== 'tag') {\n const {\n description,\n } = utils.getDescription();\n if (checkDescription(description || '')) {\n return;\n }\n\n if (descriptionStyle === 'body') {\n const descTags = utils.getPresentTags([\n 'desc', 'description',\n ]);\n if (descTags.length) {\n const [\n {\n tag: tagName,\n },\n ] = descTags;\n report(`Remove the @${tagName} tag to leave a plain block description or add additional description text above the @${tagName} line.`);\n } else {\n report('Missing JSDoc block description.');\n }\n\n return;\n }\n }\n\n const functionExamples = isBlocked ?\n [] :\n jsdoc.tags.filter(({\n tag,\n }) => {\n return tag === targetTagName;\n });\n\n if (!functionExamples.length) {\n report(\n descriptionStyle === 'any' ?\n `Missing JSDoc block description or @${targetTagName} declaration.` :\n `Missing JSDoc @${targetTagName} declaration.`,\n );\n\n return;\n }\n\n for (const example of functionExamples) {\n if (!checkDescription(`${example.name} ${utils.getTagDescription(example)}`)) {\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 a description.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-description',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n default: true,\n type: 'boolean',\n },\n checkSetters: {\n default: true,\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 descriptionStyle: {\n enum: [\n 'body', 'tag', 'any',\n ],\n type: 'string',\n },\n exemptedBy: {\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;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,gBAAgB,GAAIC,WAAW,IAAK;EACxC,OAAOA,WAAW,CACfC,IAAI,
|
|
1
|
+
{"version":3,"file":"requireDescription.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","checkDescription","description","trim","split","filter","Boolean","length","_default","iterateJsdoc","jsdoc","report","utils","context","avoidDocs","descriptionStyle","options","targetTagName","getPreferredTagName","skipReportingBlockedTag","tagName","isBlocked","blocked","getDescription","descTags","getPresentTags","tag","functionExamples","tags","example","name","getTagDescription","contextDefaults","meta","docs","url","schema","additionalProperties","properties","checkConstructors","type","checkGetters","checkSetters","contexts","items","anyOf","comment","enum","exemptedBy","exports","module"],"sources":["../../src/rules/requireDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst checkDescription = (description) => {\n return description\n .trim()\n .split('\\n')\n .filter(Boolean)\n .length;\n};\n\nexport default iterateJsdoc(({\n jsdoc,\n report,\n utils,\n context,\n}) => {\n if (utils.avoidDocs()) {\n return;\n }\n\n const {\n descriptionStyle = 'body',\n } = context.options[0] || {};\n\n let targetTagName = utils.getPreferredTagName({\n // We skip reporting except when `@description` is essential to the rule,\n // so user can block the tag and still meaningfully use this rule\n // even if the tag is present (and `check-tag-names` is the one to\n // normally report the fact that it is blocked but present)\n skipReportingBlockedTag: descriptionStyle !== 'tag',\n tagName: 'description',\n });\n if (!targetTagName) {\n return;\n }\n\n const isBlocked = typeof targetTagName === 'object' && targetTagName.blocked;\n if (isBlocked) {\n targetTagName = targetTagName.tagName;\n }\n\n if (descriptionStyle !== 'tag') {\n const {\n description,\n } = utils.getDescription();\n if (checkDescription(description || '')) {\n return;\n }\n\n if (descriptionStyle === 'body') {\n const descTags = utils.getPresentTags([\n 'desc', 'description',\n ]);\n if (descTags.length) {\n const [\n {\n tag: tagName,\n },\n ] = descTags;\n report(`Remove the @${tagName} tag to leave a plain block description or add additional description text above the @${tagName} line.`);\n } else {\n report('Missing JSDoc block description.');\n }\n\n return;\n }\n }\n\n const functionExamples = isBlocked ?\n [] :\n jsdoc.tags.filter(({\n tag,\n }) => {\n return tag === targetTagName;\n });\n\n if (!functionExamples.length) {\n report(\n descriptionStyle === 'any' ?\n `Missing JSDoc block description or @${targetTagName} declaration.` :\n `Missing JSDoc @${targetTagName} declaration.`,\n );\n\n return;\n }\n\n for (const example of functionExamples) {\n if (!checkDescription(`${example.name} ${utils.getTagDescription(example)}`)) {\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 a description.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-description',\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n checkConstructors: {\n default: true,\n type: 'boolean',\n },\n checkGetters: {\n default: true,\n type: 'boolean',\n },\n checkSetters: {\n default: true,\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 descriptionStyle: {\n enum: [\n 'body', 'tag', 'any',\n ],\n type: 'string',\n },\n exemptedBy: {\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;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,gBAAgB,GAAIC,WAAW,IAAK;EACxC,OAAOA,WAAW,CACfC,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,IAAI,CAAC,CACXC,MAAM,CAACC,OAAO,CAAC,CACfC,MAAM;AACX,CAAC;AAAC,IAAAC,QAAA,GAEa,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,IAAID,KAAK,CAACE,SAAS,CAAC,CAAC,EAAE;IACrB;EACF;EAEA,MAAM;IACJC,gBAAgB,GAAG;EACrB,CAAC,GAAGF,OAAO,CAACG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,IAAIC,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AC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAS,OAAA,CAAAjD,OAAA,GAAAQ,QAAA;AAAA0C,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAjD,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireDescriptionCompleteSentence.js","names":["_escapeStringRegexp","_interopRequireDefault","require","_iterateJsdoc","obj","__esModule","default","otherDescriptiveTags","Set","extractParagraphs","text","split","extractSentences","abbreviationsRegex","txt","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","paragraphs","filter","Boolean","paragraph","parIdx","sentences","fix","fixer","getText","pop","RegExp","escapeStringRegexp","sentence_","beginning","reg","_$0","$1","replaceText","report","msg","tagObj","source","number","column","paragraphNoAbbreviations","_default","iterateJsdoc","context","jsdoc","utils","options","abbreviations","length","abbreviation","join","getDescription","indices","match","index","reverse","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","exports","module"],"sources":["../../src/rules/requireDescriptionCompleteSentence.js"],"sourcesContent":["import escapeStringRegexp from 'escape-string-regexp';\nimport iterateJsdoc from '../iterateJsdoc';\n\nconst otherDescriptiveTags = new Set([\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', 'file', 'fileoverview', 'overview', 'classdesc', 'todo',\n 'deprecated', 'throws', 'exception', 'yields', 'yield',\n]);\n\nconst extractParagraphs = (text) => {\n return text.split(/(?<![;:])\\n\\n/u);\n};\n\nconst extractSentences = (text, abbreviationsRegex) => {\n const txt = text\n // Remove all {} tags.\n .replace(/\\{[\\s\\S]*?\\}\\s*/gu, '')\n\n // Remove custom abbreviations\n .replace(abbreviationsRegex, '');\n\n const sentenceEndGrouping = /([.?!])(?:\\s+|$)/ug;\n\n const puncts = [\n ...txt.matchAll(sentenceEndGrouping),\n ].map((sentEnd) => {\n return sentEnd[0];\n });\n\n return txt\n .split(/[.?!](?:\\s+|$)/u)\n\n // Re-add the dot.\n .map((sentence, idx) => {\n return !puncts[idx] && /^\\s*$/u.test(sentence) ? sentence : `${sentence}${puncts[idx] || ''}`;\n });\n};\n\nconst isNewLinePrecededByAPeriod = (text) => {\n let lastLineEndsSentence;\n\n const lines = text.split('\\n');\n\n return !lines.some((line) => {\n if (lastLineEndsSentence === false && /^[A-Z][a-z]/u.test(line)) {\n return true;\n }\n\n lastLineEndsSentence = /[.:?!|]$/u.test(line);\n\n return false;\n });\n};\n\nconst isCapitalized = (str) => {\n return str[0] === str[0].toUpperCase();\n};\n\nconst isTable = (str) => {\n return str.charAt() === '|';\n};\n\nconst capitalize = (str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\nconst validateDescription = (\n description, reportOrig, jsdocNode, abbreviationsRegex,\n sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd,\n) => {\n if (!description || (/^\\n+$/u).test(description)) {\n return false;\n }\n\n const paragraphs = extractParagraphs(description).filter(Boolean);\n\n return paragraphs.some((paragraph, parIdx) => {\n const sentences = extractSentences(paragraph, abbreviationsRegex);\n\n const fix = (fixer) => {\n let text = sourceCode.getText(jsdocNode);\n\n if (!/[.:?!]$/u.test(paragraph)) {\n const line = paragraph.split('\\n').filter(Boolean).pop();\n\n text = text.replace(new RegExp(`${escapeStringRegexp(line)}$`, 'mu'), `${line}.`);\n }\n\n for (const sentence of sentences.filter((sentence_) => {\n return !(/^\\s*$/u).test(sentence_) && !isCapitalized(sentence_) &&\n !isTable(sentence_);\n })) {\n const beginning = sentence.split('\\n')[0];\n\n if (tag.tag) {\n const reg = new RegExp(`(@${escapeStringRegexp(tag.tag)}.*)${escapeStringRegexp(beginning)}`, 'u');\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), 'u'), '$1' + capitalize(beginning));\n }\n }\n\n return fixer.replaceText(jsdocNode, text);\n };\n\n const report = (msg, fixer, tagObj) => {\n if ('line' in tagObj) {\n tagObj.line += parIdx * 2;\n } else {\n tagObj.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 (/^[.?!]$/u).test(sentence);\n })) {\n report('Sentences must be more than punctuation.', null, tag);\n }\n\n if (sentences.some((sentence) => {\n return !(/^\\s*$/u).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*$/u.test(paragraphNoAbbreviations)) {\n report('Sentences must end with a period.', fix, tag);\n\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 sourceCode,\n context,\n jsdoc,\n report,\n jsdocNode,\n utils,\n}) => {\n const options = context.options[0] || {};\n const {\n abbreviations = [],\n newlineBeforeCapsAssumesBadSentenceEnd = false,\n } = options;\n\n const abbreviationsRegex = abbreviations.length ?\n new RegExp('\\\\b' + abbreviations.map((abbreviation) => {\n return escapeStringRegexp(abbreviation.replace(/\\.$/ug, '') + '.');\n }).join('|') + '(?:$|\\\\s)', 'gu') :\n '';\n\n let {\n description,\n } = utils.getDescription();\n\n const indices = [\n ...description.matchAll(/```[\\s\\S]*```/gu),\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 }).reverse();\n\n for (const {\n index,\n length,\n } of indices) {\n description = description.slice(0, index) + description.slice(index + 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 = utils.getTagDescription(tag).replace(/^- /u, '').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#eslint-plugin-jsdoc-rules-require-description-complete-sentence',\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,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,oBAAoB,GAAG,IAAIC,GAAG,CAAC;AACnC;AACA;AACA;AACA,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAClE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,CACvD,CAAC;AAEF,MAAMC,iBAAiB,GAAIC,IAAI,IAAK;EAClC,OAAOA,IAAI,CAACC,KAAK,CAAC,gBAAgB,CAAC;AACrC,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAACF,IAAI,EAAEG,kBAAkB,KAAK;EACrD,MAAMC,GAAG,GAAGJ;EACV;EAAA,CACCK,OAAO,CAAC,mBAAmB,EAAE,EAAE;;EAEhC;EAAA,CACCA,OAAO,CAACF,kBAAkB,EAAE,EAAE,CAAC;EAElC,MAAMG,mBAAmB,GAAG,oBAAoB;EAEhD,MAAMC,MAAM,GAAG,CACb,GAAGH,GAAG,CAACI,QAAQ,CAACF,mBAAmB,CAAC,CACrC,CAACG,GAAG,CAAEC,OAAO,IAAK;IACjB,OAAOA,OAAO,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC;EAEF,OAAON,GAAG,CACPH,KAAK,CAAC,iBAAiB;;EAExB;EAAA,CACCQ,GAAG,CAAC,CAACE,QAAQ,EAAEC,GAAG,KAAK;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jE,sCAAsC,EAAE;UACtCiE,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,OAAA,CAAAtG,OAAA,GAAA8D,QAAA;AAAAyC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAtG,OAAA"}
|
|
1
|
+
{"version":3,"file":"requireDescriptionCompleteSentence.js","names":["_escapeStringRegexp","_interopRequireDefault","require","_iterateJsdoc","obj","__esModule","default","otherDescriptiveTags","Set","extractParagraphs","text","split","extractSentences","abbreviationsRegex","txt","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","paragraphs","filter","Boolean","paragraph","parIdx","sentences","fix","fixer","getText","pop","RegExp","escapeStringRegexp","sentence_","beginning","reg","_$0","$1","replaceText","report","msg","tagObj","source","number","column","paragraphNoAbbreviations","_default","iterateJsdoc","context","jsdoc","utils","options","abbreviations","length","abbreviation","join","getDescription","indices","match","index","reverse","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","exports","module"],"sources":["../../src/rules/requireDescriptionCompleteSentence.js"],"sourcesContent":["import escapeStringRegexp from 'escape-string-regexp';\nimport iterateJsdoc from '../iterateJsdoc';\n\nconst otherDescriptiveTags = new Set([\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', 'file', 'fileoverview', 'overview', 'classdesc', 'todo',\n 'deprecated', 'throws', 'exception', 'yields', 'yield',\n]);\n\nconst extractParagraphs = (text) => {\n return text.split(/(?<![;:])\\n\\n/u);\n};\n\nconst extractSentences = (text, abbreviationsRegex) => {\n const txt = text\n // Remove all {} tags.\n .replace(/\\{[\\s\\S]*?\\}\\s*/gu, '')\n\n // Remove custom abbreviations\n .replace(abbreviationsRegex, '');\n\n const sentenceEndGrouping = /([.?!])(?:\\s+|$)/ug;\n\n const puncts = [\n ...txt.matchAll(sentenceEndGrouping),\n ].map((sentEnd) => {\n return sentEnd[0];\n });\n\n return txt\n .split(/[.?!](?:\\s+|$)/u)\n\n // Re-add the dot.\n .map((sentence, idx) => {\n return !puncts[idx] && /^\\s*$/u.test(sentence) ? sentence : `${sentence}${puncts[idx] || ''}`;\n });\n};\n\nconst isNewLinePrecededByAPeriod = (text) => {\n let lastLineEndsSentence;\n\n const lines = text.split('\\n');\n\n return !lines.some((line) => {\n if (lastLineEndsSentence === false && /^[A-Z][a-z]/u.test(line)) {\n return true;\n }\n\n lastLineEndsSentence = /[.:?!|]$/u.test(line);\n\n return false;\n });\n};\n\nconst isCapitalized = (str) => {\n return str[0] === str[0].toUpperCase();\n};\n\nconst isTable = (str) => {\n return str.charAt() === '|';\n};\n\nconst capitalize = (str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\nconst validateDescription = (\n description, reportOrig, jsdocNode, abbreviationsRegex,\n sourceCode, tag, newlineBeforeCapsAssumesBadSentenceEnd,\n) => {\n if (!description || (/^\\n+$/u).test(description)) {\n return false;\n }\n\n const paragraphs = extractParagraphs(description).filter(Boolean);\n\n return paragraphs.some((paragraph, parIdx) => {\n const sentences = extractSentences(paragraph, abbreviationsRegex);\n\n const fix = (fixer) => {\n let text = sourceCode.getText(jsdocNode);\n\n if (!/[.:?!]$/u.test(paragraph)) {\n const line = paragraph.split('\\n').filter(Boolean).pop();\n\n text = text.replace(new RegExp(`${escapeStringRegexp(line)}$`, 'mu'), `${line}.`);\n }\n\n for (const sentence of sentences.filter((sentence_) => {\n return !(/^\\s*$/u).test(sentence_) && !isCapitalized(sentence_) &&\n !isTable(sentence_);\n })) {\n const beginning = sentence.split('\\n')[0];\n\n if (tag.tag) {\n const reg = new RegExp(`(@${escapeStringRegexp(tag.tag)}.*)${escapeStringRegexp(beginning)}`, 'u');\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), 'u'), '$1' + capitalize(beginning));\n }\n }\n\n return fixer.replaceText(jsdocNode, text);\n };\n\n const report = (msg, fixer, tagObj) => {\n if ('line' in tagObj) {\n tagObj.line += parIdx * 2;\n } else {\n tagObj.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 (/^[.?!]$/u).test(sentence);\n })) {\n report('Sentences must be more than punctuation.', null, tag);\n }\n\n if (sentences.some((sentence) => {\n return !(/^\\s*$/u).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*$/u.test(paragraphNoAbbreviations)) {\n report('Sentences must end with a period.', fix, tag);\n\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 sourceCode,\n context,\n jsdoc,\n report,\n jsdocNode,\n utils,\n}) => {\n const options = context.options[0] || {};\n const {\n abbreviations = [],\n newlineBeforeCapsAssumesBadSentenceEnd = false,\n } = options;\n\n const abbreviationsRegex = abbreviations.length ?\n new RegExp('\\\\b' + abbreviations.map((abbreviation) => {\n return escapeStringRegexp(abbreviation.replace(/\\.$/ug, '') + '.');\n }).join('|') + '(?:$|\\\\s)', 'gu') :\n '';\n\n let {\n description,\n } = utils.getDescription();\n\n const indices = [\n ...description.matchAll(/```[\\s\\S]*```/gu),\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 }).reverse();\n\n for (const {\n index,\n length,\n } of indices) {\n description = description.slice(0, index) + description.slice(index + 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 = utils.getTagDescription(tag).replace(/^- /u, '').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#eslint-plugin-jsdoc-rules-require-description-complete-sentence',\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,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,oBAAoB,GAAG,IAAIC,GAAG,CAAC;AACnC;AACA;AACA;AACA,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAClE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,CACvD,CAAC;AAEF,MAAMC,iBAAiB,GAAIC,IAAI,IAAK;EAClC,OAAOA,IAAI,CAACC,KAAK,CAAC,gBAAgB,CAAC;AACrC,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAACF,IAAI,EAAEG,kBAAkB,KAAK;EACrD,MAAMC,GAAG,GAAGJ;EACV;EAAA,CACCK,OAAO,CAAC,mBAAmB,EAAE,EAAE;;EAEhC;EAAA,CACCA,OAAO,CAACF,kBAAkB,EAAE,EAAE,CAAC;EAElC,MAAMG,mBAAmB,GAAG,oBAAoB;EAEhD,MAAMC,MAAM,GAAG,CACb,GAAGH,GAAG,CAACI,QAAQ,CAACF,mBAAmB,CAAC,CACrC,CAACG,GAAG,CAAEC,OAAO,IAAK;IACjB,OAAOA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E;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACV/B,aAAa,EAAE;UACbgC,KAAK,EAAE;YACLC,IAAI,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDjE,sCAAsC,EAAE;UACtCiE,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,OAAA,CAAAtG,OAAA,GAAA8D,QAAA;AAAAyC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAtG,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireExample.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","report","utils","avoidDocs","enableFixer","exemptNoArguments","options","targetTagName","functionExamples","tags","filter","tag","length","isIteratingFunction","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","exports","module"],"sources":["../../src/rules/requireExample.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\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.isIteratingFunction() &&\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#eslint-plugin-jsdoc-rules-require-example',\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;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,IAAIA,KAAK,CAACC,SAAS,
|
|
1
|
+
{"version":3,"file":"requireExample.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","report","utils","avoidDocs","enableFixer","exemptNoArguments","options","targetTagName","functionExamples","tags","filter","tag","length","isIteratingFunction","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","exports","module"],"sources":["../../src/rules/requireExample.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\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.isIteratingFunction() &&\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#eslint-plugin-jsdoc-rules-require-example',\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;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE5B,IAAAC,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,mBAAmB,CAAC,CAAC,IAClD,CAACX,KAAK,CAACY,SAAS,CAAC,CAAC,EAClB;MACA;IACF;IAEAZ,KAAK,CAACa,WAAW,CAAE,kBAAiBR,aAAc,eAAc,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,GAA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C;QACD7B,iBAAiB,EAAE;UACjBT,OAAO,EAAE,KAAK;UACdsC,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAQ,OAAA,CAAA9C,OAAA,GAAAC,QAAA;AAAA8C,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAA9C,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireFileOverview.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","defaultTags","file","initialCommentsOnly","mustExist","preventDuplicates","setDefaults","state","globalTags","hasDuplicates","hasTag","hasNonCommentBeforeTag","_default","iterateJsdoc","jsdocNode","utils","context","tags","options","tagName","Object","keys","targetTagName","getPreferredTagName","hasDuplicate","hasNonComment","range","exit","entries","getPreferredTagNameObject","blocked","reportSettings","replacement","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","patternProperties","type","nonComment","node","exports","module"],"sources":["../../src/rules/requireFileOverview.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst defaultTags = {\n file: {\n initialCommentsOnly: true,\n mustExist: true,\n preventDuplicates: true,\n },\n};\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 jsdocNode,\n state,\n utils,\n context,\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 = utils.getPreferredTagName({\n tagName,\n });\n\n const hasTag = 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 mustExist = false,\n preventDuplicates = false,\n initialCommentsOnly = false,\n },\n ] of Object.entries(tags)) {\n const obj = utils.getPreferredTagNameObject({\n tagName,\n });\n if (obj && obj.blocked) {\n utils.reportSettings(\n `\\`settings.jsdoc.tagNamePreference\\` cannot block @${obj.tagName} ` +\n 'for the `require-file-overview` rule',\n );\n } else {\n const targetTagName = obj && obj.replacement || 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#eslint-plugin-jsdoc-rules-require-file-overview',\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 state,\n node,\n }) {\n if (!state.hasNonComment) {\n state.hasNonComment = node.range[0];\n }\n },\n});\n"],"mapp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jD,IAAIK,YAAY,KAAK,KAAK,EAAE;MAC1B;MACAjB,KAAK,CAACE,aAAa,CAACU,OAAO,CAAC,GAAGT,MAAM;IACvC,CAAC,MAAM,IAAI,CAACc,YAAY,IAAId,MAAM,EAAE;MAClC;MACA;MACAH,KAAK,CAACE,aAAa,CAACU,OAAO,CAAC,GAAG,KAAK;MACpCZ,KAAK,CAACI,sBAAsB,CAACQ,OAAO,CAAC,GAAGZ,KAAK,CAACkB,aAAa,IACzDlB,KAAK,CAACkB,aAAa,GAAGX,SAAS,CAACY,KAAK,CAAC,CAAC,CAAC;IAC5C;EACF;AACF,CAAC,EAAE;EACDC,IAAIA,CAAE;IACJX,OAAO;IACPT,KAAK;IACLQ;EACF,CAAC,EAAE;IACDT,WAAW,CAACC,KAAK,CAAC;IAClB,MAAM;MACJU,IAAI,GAAGhB;IACT,CAAC,GAAGe,OAAO,CAACE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAE5B,KAAK,MAAM,CACTC,OAAO,EACP;MACEf,SAAS,GAAG,KAAK;MACjBC,iBAAiB,GAAG,KAAK;MACzBF,mBAAmB,GAAG;IACxB,CAAC,CACF,IAAIiB,MAAM,CAACQ,OAAO,CAACX,IAAI,CAAC,EAAE;MACzB,MAAMnB,GAAG,GAAGiB,KAAK,CAACc,yBAAyB,CAAC;QAC1CV;MACF,CAAC,CAAC;MACF,IAAIrB,GAAG,IAAIA,GAAG,CAACgC,OAAO,EAAE;QACtBf,KAAK,CAACgB,cAAc,CACjB,sDAAqDjC,GAAG,CAACqB,OAAQ,GAAE,GACpE,
|
|
1
|
+
{"version":3,"file":"requireFileOverview.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","defaultTags","file","initialCommentsOnly","mustExist","preventDuplicates","setDefaults","state","globalTags","hasDuplicates","hasTag","hasNonCommentBeforeTag","_default","iterateJsdoc","jsdocNode","utils","context","tags","options","tagName","Object","keys","targetTagName","getPreferredTagName","hasDuplicate","hasNonComment","range","exit","entries","getPreferredTagNameObject","blocked","reportSettings","replacement","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","patternProperties","type","nonComment","node","exports","module"],"sources":["../../src/rules/requireFileOverview.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst defaultTags = {\n file: {\n initialCommentsOnly: true,\n mustExist: true,\n preventDuplicates: true,\n },\n};\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 jsdocNode,\n state,\n utils,\n context,\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 = utils.getPreferredTagName({\n tagName,\n });\n\n const hasTag = 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 mustExist = false,\n preventDuplicates = false,\n initialCommentsOnly = false,\n },\n ] of Object.entries(tags)) {\n const obj = utils.getPreferredTagNameObject({\n tagName,\n });\n if (obj && obj.blocked) {\n utils.reportSettings(\n `\\`settings.jsdoc.tagNamePreference\\` cannot block @${obj.tagName} ` +\n 'for the `require-file-overview` rule',\n );\n } else {\n const targetTagName = obj && obj.replacement || 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#eslint-plugin-jsdoc-rules-require-file-overview',\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 state,\n node,\n }) {\n if (!state.hasNonComment) {\n state.hasNonComment = node.range[0];\n }\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,WAAW,GAAG;EAClBC,IAAI,EAAE;IACJC,mBAAmB,EAAE,IAAI;IACzBC,SAAS,EAAE,IAAI;IACfC,iBAAiB,EAAE;EACrB;AACF,CAAC;AAED,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,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