eslint-plugin-jsdoc 40.0.2 → 40.1.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 +10 -0
- package/dist/WarnSettings.js.map +1 -1
- package/dist/alignTransform.js.map +1 -1
- package/dist/bin/generateRule.js.map +1 -1
- package/dist/defaultTagOrder.js.map +1 -1
- package/dist/exportParser.js.map +1 -1
- package/dist/generateRule.js.map +1 -1
- package/dist/getDefaultTagStructureForMode.js.map +1 -1
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- 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/checkAlignment.js.map +1 -1
- package/dist/rules/checkExamples.js.map +1 -1
- package/dist/rules/checkIndentation.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/checkSyntax.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/matchDescription.js.map +1 -1
- package/dist/rules/matchName.js.map +1 -1
- package/dist/rules/multilineBlocks.js.map +1 -1
- package/dist/rules/newlineAfterDescription.js.map +1 -1
- package/dist/rules/noBadBlocks.js.map +1 -1
- package/dist/rules/noDefaults.js.map +1 -1
- package/dist/rules/noMissingSyntax.js.map +1 -1
- package/dist/rules/noMultiAsterisks.js.map +1 -1
- package/dist/rules/noRestrictedSyntax.js.map +1 -1
- package/dist/rules/noTypes.js.map +1 -1
- package/dist/rules/noUndefinedTypes.js.map +1 -1
- package/dist/rules/requireAsteriskPrefix.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/requireProperty.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/requireReturnsType.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/tagNames.js.map +1 -1
- package/dist/utils/hasReturnValue.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchName.js","names":["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","additionalProperies","properties","items","type","comment","required"],"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 additionalProperies: false,\n properties: {\n match: {\n additionalProperies: 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;AAA2C;AAE3C;AAAA,
|
|
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","additionalProperies","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 additionalProperies: false,\n properties: {\n match: {\n additionalProperies: 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,CA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,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","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","obj","desc","type","typ","name","nme","lineEnd","postType","postName","postTag","nameOrDescription","seedTokens","postDelimiter","iterateAllJsdocs","meta","docs","url","fixable","schema","additionalProperies","properties","anyOf","enum","items"],"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 additionalProperies: 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;AAA2C;AAAA,eAE5B,IAAAA,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,iBAAiB,GAAG,IAAI;IACxBC,eAAe,GAAG,IAAI;IACtBC,cAAc,GAAG,IAAI;IACrBC,kBAAkB,GAAG,KAAK;IAC1BC,cAAc,GAAG,CACf,OAAO,EAAE,MAAM,CAChB;IACDC,iBAAiB,GAAG,KAAK;IACzBC,yBAAyB,GAAGC,MAAM,CAACC,iBAAiB;IACpDC,aAAa,GAAG,CACd,GAAG;EAEP,CAAC,GAAGZ,OAAO,CAACa,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAM;IACJC,MAAM,EAAE,CACN;MACEC;IACF,CAAC;EAEL,CAAC,GAAGd,KAAK;EACT,MAAM;IACJe,WAAW;IACXC;EACF,CAAC,GAAGF,MAAM;EACV,MAAMG,YAAY,GAAGjB,KAAK,CAACa,MAAM,CAACK,MAAM;EAExC,MAAMC,mBAAmB,GAAIC,OAAO,IAAK;IACvC,OAAO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R,CAAC;QACDzC,kBAAkB,EAAE;UAClByC,IAAI,EAAE;QACR,CAAC;QACD1C,cAAc,EAAE;UACd0C,IAAI,EAAE;QACR,CAAC;QACDxC,cAAc,EAAE;UACd6D,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;AAAA;AAAA"}
|
|
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","additionalProperies","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 additionalProperies: 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,iBAAiB,GAAG,IAAI;IACxBC,eAAe,GAAG,IAAI;IACtBC,cAAc,GAAG,IAAI;IACrBC,kBAAkB,GAAG,KAAK;IAC1BC,cAAc,GAAG,CACf,OAAO,EAAE,MAAM,CAChB;IACDC,iBAAiB,GAAG,KAAK;IACzBC,yBAAyB,GAAGC,MAAM,CAACC,iBAAiB;IACpDC,aAAa,GAAG,CACd,GAAG;EAEP,CAAC,GAAGZ,OAAO,CAACa,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAM;IACJC,MAAM,EAAE,CACN;MACEC;IACF,CAAC;EAEL,CAAC,GAAGd,KAAK;EACT,MAAM;IACJe,WAAW;IACXC;EACF,CAAC,GAAGF,MAAM;EACV,MAAMG,YAAY,GAAGjB,KAAK,CAACa,MAAM,CAACK,MAAM;EAExC,MAAMC,mBAAmB,GAAIC,OAAO,IAAK;IACvC,OAAOf,kBAAkB,KACtB,CAACe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AAE;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":"newlineAfterDescription.js","names":["iterateJsdoc","jsdoc","report","context","jsdocNode","sourceCode","indent","utils","always","description","trim","tags","length","options","lastDescriptionLine","getDescription","descriptionEndsWithANewline","test","sourceLines","getText","split","fixer","injectedLine","endsWith","splice","replaceText","join","line","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","type"],"sources":["../../src/rules/newlineAfterDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n jsdoc,\n report,\n context,\n jsdocNode,\n sourceCode,\n indent,\n utils,\n}) => {\n let always;\n\n if (!jsdoc.description.trim() || !jsdoc.tags.length) {\n return;\n }\n\n if (0 in context.options) {\n always = context.options[0] === 'always';\n } else {\n always = true;\n }\n\n const {\n description,\n lastDescriptionLine,\n } = utils.getDescription();\n const descriptionEndsWithANewline = (/\\n\\r?$/u).test(description);\n\n if (always) {\n if (!descriptionEndsWithANewline) {\n const sourceLines = sourceCode.getText(jsdocNode).split('\\n');\n\n report('There must be a newline after the description of the JSDoc block.', (fixer) => {\n // Add the new line\n const injectedLine = `${indent} *` +\n (sourceLines[lastDescriptionLine].endsWith('\\r') ? '\\r' : '');\n sourceLines.splice(lastDescriptionLine + 1, 0, injectedLine);\n\n return fixer.replaceText(jsdocNode, sourceLines.join('\\n'));\n }, {\n line: lastDescriptionLine,\n });\n }\n } else if (descriptionEndsWithANewline) {\n const sourceLines = sourceCode.getText(jsdocNode).split('\\n');\n report('There must be no newline after the description of the JSDoc block.', (fixer) => {\n // Remove the extra line\n sourceLines.splice(lastDescriptionLine, 1);\n\n return fixer.replaceText(jsdocNode, sourceLines.join('\\n'));\n }, {\n line: lastDescriptionLine,\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Enforces a consistent padding of the block description.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-newline-after-description',\n },\n fixable: 'whitespace',\n schema: [\n {\n enum: [\n 'always', 'never',\n ],\n type: 'string',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA;AAA2C;AAAA,
|
|
1
|
+
{"version":3,"file":"newlineAfterDescription.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","jsdoc","report","context","jsdocNode","sourceCode","indent","utils","always","description","trim","tags","length","options","lastDescriptionLine","getDescription","descriptionEndsWithANewline","test","sourceLines","getText","split","fixer","injectedLine","endsWith","splice","replaceText","join","line","iterateAllJsdocs","meta","docs","url","fixable","schema","enum","type","exports","module"],"sources":["../../src/rules/newlineAfterDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n jsdoc,\n report,\n context,\n jsdocNode,\n sourceCode,\n indent,\n utils,\n}) => {\n let always;\n\n if (!jsdoc.description.trim() || !jsdoc.tags.length) {\n return;\n }\n\n if (0 in context.options) {\n always = context.options[0] === 'always';\n } else {\n always = true;\n }\n\n const {\n description,\n lastDescriptionLine,\n } = utils.getDescription();\n const descriptionEndsWithANewline = (/\\n\\r?$/u).test(description);\n\n if (always) {\n if (!descriptionEndsWithANewline) {\n const sourceLines = sourceCode.getText(jsdocNode).split('\\n');\n\n report('There must be a newline after the description of the JSDoc block.', (fixer) => {\n // Add the new line\n const injectedLine = `${indent} *` +\n (sourceLines[lastDescriptionLine].endsWith('\\r') ? '\\r' : '');\n sourceLines.splice(lastDescriptionLine + 1, 0, injectedLine);\n\n return fixer.replaceText(jsdocNode, sourceLines.join('\\n'));\n }, {\n line: lastDescriptionLine,\n });\n }\n } else if (descriptionEndsWithANewline) {\n const sourceLines = sourceCode.getText(jsdocNode).split('\\n');\n report('There must be no newline after the description of the JSDoc block.', (fixer) => {\n // Remove the extra line\n sourceLines.splice(lastDescriptionLine, 1);\n\n return fixer.replaceText(jsdocNode, sourceLines.join('\\n'));\n }, {\n line: lastDescriptionLine,\n });\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Enforces a consistent padding of the block description.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-newline-after-description',\n },\n fixable: 'whitespace',\n schema: [\n {\n enum: [\n 'always', 'never',\n ],\n type: 'string',\n },\n ],\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;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,KAAK;EACLC,MAAM;EACNC,OAAO;EACPC,SAAS;EACTC,UAAU;EACVC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,IAAIC,MAAM;EAEV,IAAI,CAACP,KAAK,CAACQ,WAAW,CAACC,IAAI,EAAE,IAAI,CAACT,KAAK,CAACU,IAAI,CAACC,MAAM,EAAE;IACnD;EACF;EAEA,IAAI,CAAC,IAAIT,OAAO,CAACU,OAAO,EAAE;IACxBL,MAAM,GAAGL,OAAO,CAACU,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ;EAC1C,CAAC,MAAM;IACLL,MAAM,GAA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B,WAAW,EAAE,yDAAyD;MACtEsB,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,YAAY;IACrBC,MAAM,EAAE,CACN;MACEC,IAAI,EAAE,CACJ,QAAQ,EAAE,OAAO,CAClB;MACDC,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAC,OAAA,CAAAtC,OAAA,GAAAC,QAAA;AAAAsC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAtC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noBadBlocks.js","names":["commentRegexp","extraAsteriskCommentRegexp","iterateJsdoc","context","sourceCode","allComments","makeReport","ignore","preventAllMultiAsteriskBlocks","options","extraAsterisks","nonJsdocNodes","filter","comment","commentText","getText","sliceIndex","test","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"],"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;AAGA;AAA2C;AAE3C;AACA;AACA,
|
|
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,6BAA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,EAAE;UACR,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDrC,6BAA6B,EAAE;UAC7BqC,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAC,OAAA,CAAAhD,OAAA,GAAAG,QAAA;AAAA8C,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAhD,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noDefaults.js","names":["iterateJsdoc","context","utils","noOptionalParamNames","options","paramTags","getPresentTags","tag","optional","reportJSDoc","changeTag","name","replace","
|
|
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,EA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gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR,CAAC;QACDzB,oBAAoB,EAAE;UACpByB,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAE,OAAA,CAAAhC,OAAA,GAAAC,QAAA;AAAAgC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAhC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noMissingSyntax.js","names":["setDefaults","state","selectorMap","incrementSelector","selector","comment","iterateJsdoc","context","node","info","sourceCode","options","contexts","foundContext","find","cntxt","esquery","matches","parse","visitorKeys","contextStr","contextSelected","exit","settings","length","report","loc","start","column","line","message","some","contextKey","undefined","minimum","Object","values","every","cmmnt","data","end","matchContext","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","anyOf","type"],"sources":["../../src/rules/noMissingSyntax.js"],"sourcesContent":["import esquery from 'esquery';\nimport iterateJsdoc from '../iterateJsdoc';\n\nconst setDefaults = (state) => {\n if (!state.selectorMap) {\n state.selectorMap = {};\n }\n};\n\nconst incrementSelector = (state, selector, comment) => {\n if (!state.selectorMap[selector]) {\n state.selectorMap[selector] = {};\n }\n\n if (!state.selectorMap[selector][comment]) {\n state.selectorMap[selector][comment] = 0;\n }\n\n state.selectorMap[selector][comment]++;\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n info: {\n comment,\n },\n sourceCode,\n state,\n}) => {\n if (!context.options[0]) {\n // Handle error later\n return;\n }\n\n const {\n contexts,\n } = context.options[0];\n\n const foundContext = contexts.find((cntxt) => {\n return typeof cntxt === 'string' ?\n esquery.matches(node, esquery.parse(cntxt), null, {\n visitorKeys: sourceCode.visitorKeys,\n }) :\n (!cntxt.context || cntxt.context === 'any' || esquery.matches(node, esquery.parse(cntxt.context), null, {\n visitorKeys: sourceCode.visitorKeys,\n })) &&\n comment === cntxt.comment;\n });\n\n const contextStr = typeof foundContext === 'object' ?\n foundContext.context ?? 'any' :\n foundContext;\n\n setDefaults(state);\n\n incrementSelector(state, contextStr, comment);\n}, {\n contextSelected: true,\n exit ({\n context,\n settings,\n state,\n }) {\n if (!context.options.length && !settings.contexts) {\n context.report({\n loc: {\n start: {\n column: 1,\n line: 1,\n },\n },\n message: 'Rule `no-missing-syntax` is missing a `contexts` option.',\n });\n\n return;\n }\n\n setDefaults(state);\n const {\n contexts = settings?.contexts,\n } = context.options[0] || {};\n\n // Report when MISSING\n contexts.some((cntxt) => {\n const contextStr = typeof cntxt === 'object' ? cntxt.context ?? 'any' : cntxt;\n const comment = cntxt?.comment ?? '';\n\n const contextKey = contextStr === 'any' ? undefined : contextStr;\n\n if (\n (!state.selectorMap[contextKey] ||\n !state.selectorMap[contextKey][comment] ||\n state.selectorMap[contextKey][comment] < (cntxt?.minimum ?? 1)) &&\n (contextStr !== 'any' || Object.values(state.selectorMap).every((cmmnt) => {\n return !cmmnt[comment] || cmmnt[comment] < (cntxt?.minimum ?? 1);\n }))\n ) {\n const message = cntxt?.message ?? 'Syntax is required: {{context}}' +\n (comment ? ' with {{comment}}' : '');\n context.report({\n data: {\n comment,\n context: contextStr,\n },\n loc: {\n end: {\n line: 1,\n },\n start: {\n line: 1,\n },\n },\n message,\n });\n\n return true;\n }\n\n return false;\n });\n },\n matchContext: true,\n meta: {\n docs: {\n description: 'Reports when certain comment structures are always expected.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-missing-syntax',\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 message: {\n type: 'string',\n },\n minimum: {\n type: 'integer',\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;AACA;AAA2C;AAE3C,
|
|
1
|
+
{"version":3,"file":"noMissingSyntax.js","names":["_esquery","_interopRequireDefault","require","_iterateJsdoc","obj","__esModule","default","setDefaults","state","selectorMap","incrementSelector","selector","comment","_default","iterateJsdoc","context","node","info","sourceCode","options","contexts","foundContext","find","cntxt","esquery","matches","parse","visitorKeys","contextStr","contextSelected","exit","settings","length","report","loc","start","column","line","message","some","contextKey","undefined","minimum","Object","values","every","cmmnt","data","end","matchContext","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","anyOf","type","exports","module"],"sources":["../../src/rules/noMissingSyntax.js"],"sourcesContent":["import esquery from 'esquery';\nimport iterateJsdoc from '../iterateJsdoc';\n\nconst setDefaults = (state) => {\n if (!state.selectorMap) {\n state.selectorMap = {};\n }\n};\n\nconst incrementSelector = (state, selector, comment) => {\n if (!state.selectorMap[selector]) {\n state.selectorMap[selector] = {};\n }\n\n if (!state.selectorMap[selector][comment]) {\n state.selectorMap[selector][comment] = 0;\n }\n\n state.selectorMap[selector][comment]++;\n};\n\nexport default iterateJsdoc(({\n context,\n node,\n info: {\n comment,\n },\n sourceCode,\n state,\n}) => {\n if (!context.options[0]) {\n // Handle error later\n return;\n }\n\n const {\n contexts,\n } = context.options[0];\n\n const foundContext = contexts.find((cntxt) => {\n return typeof cntxt === 'string' ?\n esquery.matches(node, esquery.parse(cntxt), null, {\n visitorKeys: sourceCode.visitorKeys,\n }) :\n (!cntxt.context || cntxt.context === 'any' || esquery.matches(node, esquery.parse(cntxt.context), null, {\n visitorKeys: sourceCode.visitorKeys,\n })) &&\n comment === cntxt.comment;\n });\n\n const contextStr = typeof foundContext === 'object' ?\n foundContext.context ?? 'any' :\n foundContext;\n\n setDefaults(state);\n\n incrementSelector(state, contextStr, comment);\n}, {\n contextSelected: true,\n exit ({\n context,\n settings,\n state,\n }) {\n if (!context.options.length && !settings.contexts) {\n context.report({\n loc: {\n start: {\n column: 1,\n line: 1,\n },\n },\n message: 'Rule `no-missing-syntax` is missing a `contexts` option.',\n });\n\n return;\n }\n\n setDefaults(state);\n const {\n contexts = settings?.contexts,\n } = context.options[0] || {};\n\n // Report when MISSING\n contexts.some((cntxt) => {\n const contextStr = typeof cntxt === 'object' ? cntxt.context ?? 'any' : cntxt;\n const comment = cntxt?.comment ?? '';\n\n const contextKey = contextStr === 'any' ? undefined : contextStr;\n\n if (\n (!state.selectorMap[contextKey] ||\n !state.selectorMap[contextKey][comment] ||\n state.selectorMap[contextKey][comment] < (cntxt?.minimum ?? 1)) &&\n (contextStr !== 'any' || Object.values(state.selectorMap).every((cmmnt) => {\n return !cmmnt[comment] || cmmnt[comment] < (cntxt?.minimum ?? 1);\n }))\n ) {\n const message = cntxt?.message ?? 'Syntax is required: {{context}}' +\n (comment ? ' with {{comment}}' : '');\n context.report({\n data: {\n comment,\n context: contextStr,\n },\n loc: {\n end: {\n line: 1,\n },\n start: {\n line: 1,\n },\n },\n message,\n });\n\n return true;\n }\n\n return false;\n });\n },\n matchContext: true,\n meta: {\n docs: {\n description: 'Reports when certain comment structures are always expected.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-missing-syntax',\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 message: {\n type: 'string',\n },\n minimum: {\n type: 'integer',\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,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KA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EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVrC,QAAQ,EAAE;UACRsC,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEC,IAAI,EAAE;YACR,CAAC,EACD;cACEJ,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACV7C,OAAO,EAAE;kBACPgD,IAAI,EAAE;gBACR,CAAC;gBACD7C,OAAO,EAAE;kBACP6C,IAAI,EAAE;gBACR,CAAC;gBACDtB,OAAO,EAAE;kBACPsB,IAAI,EAAE;gBACR,CAAC;gBACDlB,OAAO,EAAE;kBACPkB,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;AAAAC,OAAA,CAAAvD,OAAA,GAAAO,QAAA;AAAAiD,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAvD,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noMultiAsterisks.js","names":["middleAsterisksBlockWS","middleAsterisksNoBlockWS","endAsterisksSingleLineBlockWS","endAsterisksMultipleLineBlockWS","endAsterisksSingleLineNoBlockWS","endAsterisksMultipleLineNoBlockWS","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","additionalProperies","properties"],"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 additionalProperies: 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;AAA2C;AAE3C,
|
|
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","additionalProperies","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 additionalProperies: 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,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,sBAAsB,GAAG,qBAAqB;AACpD,MAAMC,wBAAwB,GAAG,OAAO;AAExC,MAAMC,6BAA6B,GAAG,0BAA0B;AAChE,MAAMC,+BAA+B,GAAG,wBAAwB;AAEhE,MAAMC,+BAA+B,GAAG,aAAa;AACrD,MAAMC,iCAAiC,GAAG,WAAW;AAAC,IAAAC,QAAA,GAEvC,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAM;IACJC,eAAe,GAAG,KAAK;IACvBC,YAAY,GAAG,IAAI;IACnBC,oBAAoB,GAAG;EACzB,CAAC,GAAGL,OAAO,CAACM,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAMC,eAAe,GAAGJ,eAAe,GAAGV,wBAAwB,GAAGD,sBAAsB;;EAE3F;EACAS,KAAK,CAACO,MAAM,CAACC,IAAI,CAAC,CAAC;IACjBC,MAAM;IACNC;EACF,CAAC,KAAK;IACJ,MAAM;MACJC,SAAS;MACTC,GAAG;MACHC,IAAI;MACJC,IAAI;MACJC,WAAW;MACX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AM,GAAGA,CAAA,KAAM;MACnB,IAAI,CAACN,iBAAiB,EAAE;QACtBd,MAAM,CAACE,SAAS,GAAG,EAAE;MACvB;MAEAF,MAAM,CAACM,WAAW,GAAG,CAACA,WAAW,GAAGS,KAAK,EAAEJ,OAAO,CAACK,YAAY,EAAE,EAAE,CAAC;IACtE,CAAC;IAEDxB,KAAK,CAACoB,WAAW,CACf,+CAA+C,EAC/C;MACEC,IAAI,EAAEZ;IACR,CAAC,EACDmB,MAAM,EACN,IAAI,CACL;IAED,OAAO,IAAI;EACb,CAAC,CAAC;AACJ,CAAC,EAAE;EACDC,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJjB,WAAW,EAAE,EAAE;MACfkB,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,mBAAmB,EAAE,KAAK;MAC1BC,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":"noRestrictedSyntax.js","names":["iterateJsdoc","node","context","info","comment","sourceCode","report","options","length","contexts","foundContext","find","cntxt","esquery","matches","parse","visitorKeys","contextStr","message","contextSelected","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","anyOf","type","required","nonGlobalSettings"],"sources":["../../src/rules/noRestrictedSyntax.js"],"sourcesContent":["import esquery from 'esquery';\nimport iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n node,\n context,\n info: {\n comment,\n },\n sourceCode,\n report,\n}) => {\n if (!context.options.length) {\n report('Rule `no-restricted-syntax` is missing a `contexts` option.');\n\n return;\n }\n\n const {\n contexts,\n } = context.options[0];\n\n const foundContext = contexts.find((cntxt) => {\n return typeof cntxt === 'string' ?\n esquery.matches(node, esquery.parse(cntxt), null, {\n visitorKeys: sourceCode.visitorKeys,\n }) :\n (!cntxt.context || cntxt.context === 'any' || esquery.matches(node, esquery.parse(cntxt.context), null, {\n visitorKeys: sourceCode.visitorKeys,\n })) &&\n comment === cntxt.comment;\n });\n\n // We are not on the *particular* matching context/comment, so don't assume\n // we need reporting\n if (!foundContext) {\n return;\n }\n\n const contextStr = typeof foundContext === 'object' ?\n foundContext.context ?? 'any' :\n foundContext;\n const message = foundContext?.message ??\n 'Syntax is restricted: {{context}}' +\n (comment ? ' with {{comment}}' : '');\n\n report(message, null, null, {\n comment,\n context: contextStr,\n });\n}, {\n contextSelected: true,\n meta: {\n docs: {\n description: 'Reports when certain comment structures are present.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-restricted-syntax',\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 message: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n required: [\n 'contexts',\n ],\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n nonGlobalSettings: true,\n});\n"],"mappings":";;;;;;AAAA;AACA;AAA2C;AAAA,
|
|
1
|
+
{"version":3,"file":"noRestrictedSyntax.js","names":["_esquery","_interopRequireDefault","require","_iterateJsdoc","obj","__esModule","default","_default","iterateJsdoc","node","context","info","comment","sourceCode","report","options","length","contexts","foundContext","find","cntxt","esquery","matches","parse","visitorKeys","contextStr","message","contextSelected","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","anyOf","type","required","nonGlobalSettings","exports","module"],"sources":["../../src/rules/noRestrictedSyntax.js"],"sourcesContent":["import esquery from 'esquery';\nimport iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n node,\n context,\n info: {\n comment,\n },\n sourceCode,\n report,\n}) => {\n if (!context.options.length) {\n report('Rule `no-restricted-syntax` is missing a `contexts` option.');\n\n return;\n }\n\n const {\n contexts,\n } = context.options[0];\n\n const foundContext = contexts.find((cntxt) => {\n return typeof cntxt === 'string' ?\n esquery.matches(node, esquery.parse(cntxt), null, {\n visitorKeys: sourceCode.visitorKeys,\n }) :\n (!cntxt.context || cntxt.context === 'any' || esquery.matches(node, esquery.parse(cntxt.context), null, {\n visitorKeys: sourceCode.visitorKeys,\n })) &&\n comment === cntxt.comment;\n });\n\n // We are not on the *particular* matching context/comment, so don't assume\n // we need reporting\n if (!foundContext) {\n return;\n }\n\n const contextStr = typeof foundContext === 'object' ?\n foundContext.context ?? 'any' :\n foundContext;\n const message = foundContext?.message ??\n 'Syntax is restricted: {{context}}' +\n (comment ? ' with {{comment}}' : '');\n\n report(message, null, null, {\n comment,\n context: contextStr,\n });\n}, {\n contextSelected: true,\n meta: {\n docs: {\n description: 'Reports when certain comment structures are present.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-restricted-syntax',\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 message: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n required: [\n 'contexts',\n ],\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n nonGlobalSettings: true,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAA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Y,CAAEQ,OAAO,KACnC,mCAAmC,IAChCd,OAAO,GAAG,mBAAmB,GAAG,EAAE,CAAC;EAExCE,MAAM,CAACY,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;IAC1Bd,OAAO;IACPF,OAAO,EAAEe;EACX,CAAC,CAAC;AACJ,CAAC,EAAE;EACDE,eAAe,EAAE,IAAI;EACrBC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,WAAW,EAAE,sDAAsD;MACnEC,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVlB,QAAQ,EAAE;UACRmB,KAAK,EAAE;YACLC,KAAK,EAAE,CACL;cACEC,IAAI,EAAE;YACR,CAAC,EACD;cACEJ,oBAAoB,EAAE,KAAK;cAC3BC,UAAU,EAAE;gBACVvB,OAAO,EAAE;kBACP0B,IAAI,EAAE;gBACR,CAAC;gBACD5B,OAAO,EAAE;kBACP4B,IAAI,EAAE;gBACR,CAAC;gBACDZ,OAAO,EAAE;kBACPY,IAAI,EAAE;gBACR;cACF,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;UAEL,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDC,QAAQ,EAAE,CACR,UAAU,CACX;MACDD,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR,CAAC;EACDE,iBAAiB,EAAE;AACrB,CAAC,CAAC;AAAAC,OAAA,CAAAnC,OAAA,GAAAC,QAAA;AAAAmC,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAnC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noTypes.js","names":["removeType","tokens","postTag","type","iterateJsdoc","utils","isIteratingFunction","isVirtualFunction","tags","getPresentTags","tag","reportJSDoc","source","contextDefaults","meta","docs","description","url","fixable","schema","additionalProperties","properties","contexts","items","anyOf","comment","context"],"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;AAA2C;AAE3C,
|
|
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,EAAE,IAAI,CAACD,KAAK,CAACE,iBAAiB,EAAE,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":["extraTypes","typescriptGlobals","stripPseudoTypes","str","replace","iterateJsdoc","context","node","report","settings","sourceCode","utils","scopeManager","globalScope","definedTypes","options","definedPreferredTypes","preferredTypes","structuredTags","mode","Object","keys","length","values","map","preferredType","undefined","reportSettings","replacement","filter","typedefDeclarations","getAllComments","comment","test","value","commentNode","parseComment","flatMap","doc","tags","tag","isNamepathDefiningTag","name","ancestorNodes","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","structuredTypes","has","Array","isArray","includes","markVariableAsUsed","iterateAllJsdocs","meta","docs","description","url","schema","additionalProperties","properties","items"],"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;AAOA;AAGA;AAAuC;AAAA;AAAA;AAEvC,MAAMA,UAAU,GAAG,CACjB,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAC1D,UAAU,EAAE,QAAQ,EACpB,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EACrC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,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,KAAK,CAAC,EAAE;UACtC5B,OAAO,CAACsE,kBAAkB,CAAC1C,KAAK,CAAC;QACnC;MACF;IACF,CAAC,CAAC;EACJ;AACF,CAAC,EAAE;EACD2C,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;AAAA;AAAA"}
|
|
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,SAAAI,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAG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A3B,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireAsteriskPrefix.js","names":["iterateJsdoc","context","jsdoc","utils","indent","defaultRequireValue","tags","tagMap","options","source","always","never","currentTag","some","number","tokens","delimiter","tag","end","description","neverFix","postDelimiter","checkNever","checkValue","includes","reportJSDoc","column","line","alwaysFix","start","checkAlways","slice","any","iterateAllJsdocs","meta","fixable","schema","enum","type","additionalProperties","properties","items"],"sources":["../../src/rules/requireAsteriskPrefix.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n indent,\n}) => {\n const [\n defaultRequireValue = 'always',\n {\n tags: tagMap = {},\n } = {},\n ] = context.options;\n\n const {\n source,\n } = jsdoc;\n\n const always = defaultRequireValue === 'always';\n const never = defaultRequireValue === 'never';\n\n let currentTag;\n source.some(({\n number,\n tokens,\n }) => {\n const {\n delimiter,\n tag,\n end,\n description,\n } = tokens;\n\n const neverFix = () => {\n tokens.delimiter = '';\n tokens.postDelimiter = '';\n };\n\n const checkNever = (checkValue) => {\n if (delimiter && delimiter !== '/**' && (\n never && !tagMap.always?.includes(checkValue) ||\n tagMap.never?.includes(checkValue)\n )) {\n utils.reportJSDoc('Expected JSDoc line to have no prefix.', {\n column: 0,\n line: number,\n }, neverFix);\n\n return true;\n }\n\n return false;\n };\n\n const alwaysFix = () => {\n if (!tokens.start) {\n tokens.start = indent + ' ';\n }\n\n tokens.delimiter = '*';\n tokens.postDelimiter = tag || description ? ' ' : '';\n };\n\n const checkAlways = (checkValue) => {\n if (\n !delimiter && (\n always && !tagMap.never?.includes(checkValue) ||\n tagMap.always?.includes(checkValue)\n )\n ) {\n utils.reportJSDoc('Expected JSDoc line to have the prefix.', {\n column: 0,\n line: number,\n }, alwaysFix);\n\n return true;\n }\n\n return false;\n };\n\n if (tag) {\n // Remove at sign\n currentTag = tag.slice(1);\n }\n\n if (\n // If this is the end but has a tag, the delimiter will also be\n // populated and will be safely ignored later\n end && !tag\n ) {\n return false;\n }\n\n if (!currentTag) {\n if (tagMap.any?.includes('*description')) {\n return false;\n }\n\n if (checkNever('*description')) {\n return true;\n }\n\n if (checkAlways('*description')) {\n return true;\n }\n\n return false;\n }\n\n if (tagMap.any?.includes(currentTag)) {\n return false;\n }\n\n if (checkNever(currentTag)) {\n return true;\n }\n\n if (checkAlways(currentTag)) {\n return true;\n }\n\n return false;\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n fixable: 'code',\n schema: [\n {\n enum: [\n 'always', 'never', 'any',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n tags: {\n properties: {\n always: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n any: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n never: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n },\n ],\n type: 'layout',\n },\n});\n"],"mappings":";;;;;;AAAA;AAA2C;AAAA,
|
|
1
|
+
{"version":3,"file":"requireAsteriskPrefix.js","names":["_iterateJsdoc","_interopRequireDefault","require","obj","__esModule","default","_default","iterateJsdoc","context","jsdoc","utils","indent","defaultRequireValue","tags","tagMap","options","source","always","never","currentTag","some","number","tokens","_tagMap$any2","delimiter","tag","end","description","neverFix","postDelimiter","checkNever","checkValue","_tagMap$always","_tagMap$never","includes","reportJSDoc","column","line","alwaysFix","start","checkAlways","_tagMap$never2","_tagMap$always2","slice","_tagMap$any","any","iterateAllJsdocs","meta","fixable","schema","enum","type","additionalProperties","properties","items","exports","module"],"sources":["../../src/rules/requireAsteriskPrefix.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n utils,\n indent,\n}) => {\n const [\n defaultRequireValue = 'always',\n {\n tags: tagMap = {},\n } = {},\n ] = context.options;\n\n const {\n source,\n } = jsdoc;\n\n const always = defaultRequireValue === 'always';\n const never = defaultRequireValue === 'never';\n\n let currentTag;\n source.some(({\n number,\n tokens,\n }) => {\n const {\n delimiter,\n tag,\n end,\n description,\n } = tokens;\n\n const neverFix = () => {\n tokens.delimiter = '';\n tokens.postDelimiter = '';\n };\n\n const checkNever = (checkValue) => {\n if (delimiter && delimiter !== '/**' && (\n never && !tagMap.always?.includes(checkValue) ||\n tagMap.never?.includes(checkValue)\n )) {\n utils.reportJSDoc('Expected JSDoc line to have no prefix.', {\n column: 0,\n line: number,\n }, neverFix);\n\n return true;\n }\n\n return false;\n };\n\n const alwaysFix = () => {\n if (!tokens.start) {\n tokens.start = indent + ' ';\n }\n\n tokens.delimiter = '*';\n tokens.postDelimiter = tag || description ? ' ' : '';\n };\n\n const checkAlways = (checkValue) => {\n if (\n !delimiter && (\n always && !tagMap.never?.includes(checkValue) ||\n tagMap.always?.includes(checkValue)\n )\n ) {\n utils.reportJSDoc('Expected JSDoc line to have the prefix.', {\n column: 0,\n line: number,\n }, alwaysFix);\n\n return true;\n }\n\n return false;\n };\n\n if (tag) {\n // Remove at sign\n currentTag = tag.slice(1);\n }\n\n if (\n // If this is the end but has a tag, the delimiter will also be\n // populated and will be safely ignored later\n end && !tag\n ) {\n return false;\n }\n\n if (!currentTag) {\n if (tagMap.any?.includes('*description')) {\n return false;\n }\n\n if (checkNever('*description')) {\n return true;\n }\n\n if (checkAlways('*description')) {\n return true;\n }\n\n return false;\n }\n\n if (tagMap.any?.includes(currentTag)) {\n return false;\n }\n\n if (checkNever(currentTag)) {\n return true;\n }\n\n if (checkAlways(currentTag)) {\n return true;\n }\n\n return false;\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n fixable: 'code',\n schema: [\n {\n enum: [\n 'always', 'never', 'any',\n ],\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n tags: {\n properties: {\n always: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n any: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n never: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n },\n type: 'object',\n },\n },\n type: 'object',\n },\n ],\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;AAAA,IAAAG,QAAA,GAE5B,IAAAC,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAM,CACJC,mBAAmB,GAAG,QAAQ,EAC9B;IACEC,IAAI,EAAEC,MAAM,GAAG,CAAC;EAClB,CAAC,GAAG,CAAC,CAAC,CACP,GAAGN,OAAO,CAACO,OAAO;EAEnB,MAAM;IACJC;EACF,CAAC,GAAGP,KAAK;EAET,MA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OAAO,IAAI;IACb;IAEA,OAAO,KAAK;EACd,CAAC,CAAC;AACJ,CAAC,EAAE;EACD2B,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE;IACJC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,CACN;MACEC,IAAI,EAAE,CACJ,QAAQ,EAAE,OAAO,EAAE,KAAK,CACzB;MACDC,IAAI,EAAE;IACR,CAAC,EACD;MACEC,oBAAoB,EAAE,KAAK;MAC3BC,UAAU,EAAE;QACVxC,IAAI,EAAE;UACJwC,UAAU,EAAE;YACVpC,MAAM,EAAE;cACNqC,KAAK,EAAE;gBACLH,IAAI,EAAE;cACR,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;YACDN,GAAG,EAAE;cACHS,KAAK,EAAE;gBACLH,IAAI,EAAE;cACR,CAAC;cACDA,IAAI,EAAE;YACR,CAAC;YACDjC,KAAK,EAAE;cACLoC,KAAK,EAAE;gBACLH,IAAI,EAAE;cACR,CAAC;cACDA,IAAI,EAAE;YACR;UACF,CAAC;UACDA,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAAI,OAAA,CAAAlD,OAAA,GAAAC,QAAA;AAAAkD,MAAA,CAAAD,OAAA,GAAAA,OAAA,CAAAlD,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireDescription.js","names":["checkDescription","description","trim","split","filter","Boolean","length","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","
|
|
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,EAAE,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,EAAE,EAAE;IACrB;EACF;EAEA,MAAM;IACJC,gBAAgB,GAAG;EACrB,CAAC,GAAGF,OAAO,CAACG,OAAO,CAAC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