eslint-plugin-jsdoc 63.0.13 → 63.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 +1 -0
- package/dist/cjs/rules/normalizeSeeLinks.d.ts +2 -0
- package/dist/index-cjs.cjs +3 -0
- package/dist/index-cjs.cjs.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/rules/escapeInlineTags.cjs +24 -1
- package/dist/rules/escapeInlineTags.cjs.map +1 -1
- package/dist/rules/normalizeSeeLinks.cjs +204 -0
- package/dist/rules/normalizeSeeLinks.cjs.map +1 -0
- package/dist/rules/normalizeSeeLinks.d.ts +3 -0
- package/dist/rules.d.ts +16 -0
- package/package.json +1 -1
- package/src/index-cjs.js +3 -0
- package/src/index.js +3 -0
- package/src/rules/escapeInlineTags.js +31 -2
- package/src/rules/normalizeSeeLinks.js +283 -0
- package/src/rules.d.ts +16 -0
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTemplateNames","checkTypes","checkValues","convertToJsdocComments","emptyTags","escapeInlineTags","implementsOnClasses","importsAsDependencies","informativeDocs","linesBeforeBlock","matchDescription","matchName","multilineBlocks","noBadBlocks","noBlankBlockDescriptions","noBlankBlocks","noDefaults","noMissingSyntax","noMultiAsterisks","noRestrictedSyntax","noTypes","noUndefinedTypes","preferImportTag","buildRejectOrPreferRuleDefinition","requireAsteriskPrefix","requireDescription","requireDescriptionCompleteSentence","requireExample","requireFileOverview","requireHyphenBeforeParamDescription","requireJsdoc","buildForbidRuleDefinition","requireParam","requireParamDescription","requireParamName","requireParamType","requireProperty","requirePropertyDescription","requirePropertyName","requirePropertyType","requireRejects","requireReturns","requireReturnsCheck","requireReturnsDescription","requireReturnsType","requireTags","requireTemplate","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","tsMethodSignatureStyle","tsNoEmptyObjectType","tsNoUnnecessaryTemplateExpression","tsPreferFunctionType","typeFormatting","validTypes","getJsdocProcessorPlugin","semver","ESLint","merge"],"sources":["../src/index.js"],"sourcesContent":["/* AUTO-GENERATED BY build SCRIPT */\n/* eslint-disable perfectionist/sort-imports -- For auto-generate; Do not remove */\nimport {\n merge,\n} from 'object-deep-merge';\n\nimport {\n buildForbidRuleDefinition,\n} from './buildForbidRuleDefinition.js';\nimport {\n buildRejectOrPreferRuleDefinition,\n} from './buildRejectOrPreferRuleDefinition.js';\nimport {\n getJsdocProcessorPlugin,\n} from './getJsdocProcessorPlugin.js';\nimport checkAccess from './rules/checkAccess.js';\nimport checkAlignment from './rules/checkAlignment.js';\nimport checkExamples from './rules/checkExamples.js';\nimport checkIndentation from './rules/checkIndentation.js';\nimport checkLineAlignment from './rules/checkLineAlignment.js';\nimport checkParamNames from './rules/checkParamNames.js';\nimport checkPropertyNames from './rules/checkPropertyNames.js';\nimport checkSyntax from './rules/checkSyntax.js';\nimport checkTagNames from './rules/checkTagNames.js';\nimport checkTemplateNames from './rules/checkTemplateNames.js';\nimport checkTypes from './rules/checkTypes.js';\nimport checkValues from './rules/checkValues.js';\nimport convertToJsdocComments from './rules/convertToJsdocComments.js';\nimport emptyTags from './rules/emptyTags.js';\nimport escapeInlineTags from './rules/escapeInlineTags.js';\nimport implementsOnClasses from './rules/implementsOnClasses.js';\nimport importsAsDependencies from './rules/importsAsDependencies.js';\nimport informativeDocs from './rules/informativeDocs.js';\nimport linesBeforeBlock from './rules/linesBeforeBlock.js';\nimport matchDescription from './rules/matchDescription.js';\nimport matchName from './rules/matchName.js';\nimport multilineBlocks from './rules/multilineBlocks.js';\nimport noBadBlocks from './rules/noBadBlocks.js';\nimport noBlankBlockDescriptions from './rules/noBlankBlockDescriptions.js';\nimport noBlankBlocks from './rules/noBlankBlocks.js';\nimport noDefaults from './rules/noDefaults.js';\nimport noMissingSyntax from './rules/noMissingSyntax.js';\nimport noMultiAsterisks from './rules/noMultiAsterisks.js';\nimport noRestrictedSyntax from './rules/noRestrictedSyntax.js';\nimport noTypes from './rules/noTypes.js';\nimport noUndefinedTypes from './rules/noUndefinedTypes.js';\nimport preferImportTag from './rules/preferImportTag.js';\nimport requireAsteriskPrefix from './rules/requireAsteriskPrefix.js';\nimport requireDescription from './rules/requireDescription.js';\nimport requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence.js';\nimport requireExample from './rules/requireExample.js';\nimport requireFileOverview from './rules/requireFileOverview.js';\nimport requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription.js';\nimport requireJsdoc from './rules/requireJsdoc.js';\nimport requireParam from './rules/requireParam.js';\nimport requireParamDescription from './rules/requireParamDescription.js';\nimport requireParamName from './rules/requireParamName.js';\nimport requireParamType from './rules/requireParamType.js';\nimport requireProperty from './rules/requireProperty.js';\nimport requirePropertyDescription from './rules/requirePropertyDescription.js';\nimport requirePropertyName from './rules/requirePropertyName.js';\nimport requirePropertyType from './rules/requirePropertyType.js';\nimport requireRejects from './rules/requireRejects.js';\nimport requireReturns from './rules/requireReturns.js';\nimport requireReturnsCheck from './rules/requireReturnsCheck.js';\nimport requireReturnsDescription from './rules/requireReturnsDescription.js';\nimport requireReturnsType from './rules/requireReturnsType.js';\nimport requireTags from './rules/requireTags.js';\nimport requireTemplate from './rules/requireTemplate.js';\nimport requireThrows from './rules/requireThrows.js';\nimport requireYields from './rules/requireYields.js';\nimport requireYieldsCheck from './rules/requireYieldsCheck.js';\nimport sortTags from './rules/sortTags.js';\nimport tagLines from './rules/tagLines.js';\nimport textEscaping from './rules/textEscaping.js';\nimport tsMethodSignatureStyle from './rules/tsMethodSignatureStyle.js';\nimport tsNoEmptyObjectType from './rules/tsNoEmptyObjectType.js';\nimport tsNoUnnecessaryTemplateExpression from './rules/tsNoUnnecessaryTemplateExpression.js';\nimport tsPreferFunctionType from './rules/tsPreferFunctionType.js';\nimport typeFormatting from './rules/typeFormatting.js';\nimport validTypes from './rules/validTypes.js';\nimport {\n ESLint,\n} from 'eslint';\nimport semver from 'semver';\n\n/**\n * @typedef {\"recommended\" | \"stylistic\" | \"contents\" | \"logical\" | \"requirements\"} ConfigGroups\n * @typedef {\"\" | \"-typescript\" | \"-typescript-flavor\"} ConfigVariants\n * @typedef {\"\" | \"-error\"} ErrorLevelVariants\n * @type {import('eslint').ESLint.Plugin & {\n * configs: Record<\n * `flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,\n * import('eslint').Linter.Config\n * > &\n * Record<\n * \"examples\"|\"default-expressions\"|\"examples-and-default-expressions\",\n * import('eslint').Linter.Config[]\n * > &\n * Record<\"flat/recommended-mixed\", import('eslint').Linter.Config[]>\n * }}\n */\nconst index = {};\nindex.configs = {};\nindex.rules = {\n 'check-access': checkAccess,\n 'check-alignment': checkAlignment,\n 'check-examples': checkExamples,\n 'check-indentation': checkIndentation,\n 'check-line-alignment': checkLineAlignment,\n 'check-param-names': checkParamNames,\n 'check-property-names': checkPropertyNames,\n 'check-syntax': checkSyntax,\n 'check-tag-names': checkTagNames,\n 'check-template-names': checkTemplateNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'convert-to-jsdoc-comments': convertToJsdocComments,\n 'empty-tags': emptyTags,\n 'escape-inline-tags': escapeInlineTags,\n 'implements-on-classes': implementsOnClasses,\n 'imports-as-dependencies': importsAsDependencies,\n 'informative-docs': informativeDocs,\n 'lines-before-block': linesBeforeBlock,\n 'match-description': matchDescription,\n 'match-name': matchName,\n 'multiline-blocks': multilineBlocks,\n 'no-bad-blocks': noBadBlocks,\n 'no-blank-block-descriptions': noBlankBlockDescriptions,\n 'no-blank-blocks': noBlankBlocks,\n 'no-defaults': noDefaults,\n 'no-missing-syntax': noMissingSyntax,\n 'no-multi-asterisks': noMultiAsterisks,\n 'no-restricted-syntax': noRestrictedSyntax,\n 'no-types': noTypes,\n 'no-undefined-types': noUndefinedTypes,\n 'prefer-import-tag': preferImportTag,\n 'reject-any-type': buildRejectOrPreferRuleDefinition({\n description: 'Reports use of `any` or `*` type',\n overrideSettings: {\n '*': {\n message: 'Prefer a more specific type to `*`',\n replacement: false,\n unifyParentAndChildTypeChecks: true,\n },\n any: {\n message: 'Prefer a more specific type to `any`',\n replacement: false,\n unifyParentAndChildTypeChecks: true,\n },\n },\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/reject-any-type.md#repos-sticky-header',\n }),\n 'reject-function-type': buildRejectOrPreferRuleDefinition({\n description: 'Reports use of `Function` type',\n overrideSettings: {\n Function: {\n message: 'Prefer a more specific type to `Function`',\n replacement: false,\n unifyParentAndChildTypeChecks: true,\n },\n },\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/reject-function-type.md#repos-sticky-header',\n }),\n 'require-asterisk-prefix': requireAsteriskPrefix,\n 'require-description': requireDescription,\n 'require-description-complete-sentence': requireDescriptionCompleteSentence,\n 'require-example': requireExample,\n 'require-file-overview': requireFileOverview,\n 'require-hyphen-before-param-description': requireHyphenBeforeParamDescription,\n 'require-jsdoc': requireJsdoc,\n 'require-next-description': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=next]:not([name!=\"\"]):not([description!=\"\"]))',\n context: 'any',\n message: '@next should have a description',\n },\n ],\n description: 'Requires a description for `@next` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-next-description.md#repos-sticky-header',\n }),\n 'require-next-type': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=next]:not([parsedType.type]))',\n context: 'any',\n message: '@next should have a type',\n },\n ],\n description: 'Requires a type for `@next` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-next-type.md#repos-sticky-header',\n }),\n 'require-param': requireParam,\n 'require-param-description': requireParamDescription,\n 'require-param-name': requireParamName,\n 'require-param-type': requireParamType,\n 'require-property': requireProperty,\n 'require-property-description': requirePropertyDescription,\n 'require-property-name': requirePropertyName,\n 'require-property-type': requirePropertyType,\n 'require-rejects': requireRejects,\n 'require-returns': requireReturns,\n 'require-returns-check': requireReturnsCheck,\n 'require-returns-description': requireReturnsDescription,\n 'require-returns-type': requireReturnsType,\n 'require-tags': requireTags,\n 'require-template': requireTemplate,\n 'require-template-description': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=template]:not([description!=\"\"]))',\n context: 'any',\n message: '@template should have a description',\n },\n ],\n description: 'Requires a description for `@template` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template-description.md#repos-sticky-header',\n }),\n 'require-throws': requireThrows,\n 'require-throws-description': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=/^(?:throws|exception)$/]:not([description!=\"\"]))',\n context: 'any',\n message: '@throws should have a description',\n },\n ],\n description: 'Requires a description for `@throws` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws-description.md#repos-sticky-header',\n }),\n 'require-throws-type': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=/^(?:throws|exception)$/]:not([parsedType.type]))',\n context: 'any',\n message: '@throws should have a type',\n },\n ],\n description: 'Requires a type for `@throws` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws-type.md#repos-sticky-header',\n }),\n 'require-yields': requireYields,\n 'require-yields-check': requireYieldsCheck,\n 'require-yields-description': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=/^yields?$/]:not([name!=\"\"]):not([description!=\"\"]))',\n context: 'any',\n message: '@yields should have a description',\n },\n ],\n description: 'Requires a description for `@yields` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-description.md#repos-sticky-header',\n }),\n 'require-yields-type': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=/^yields?$/]:not([parsedType.type]))',\n context: 'any',\n message: '@yields should have a type',\n },\n ],\n description: 'Requires a type for `@yields` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-type.md#repos-sticky-header',\n }),\n 'sort-tags': sortTags,\n 'tag-lines': tagLines,\n 'text-escaping': textEscaping,\n 'ts-method-signature-style': tsMethodSignatureStyle,\n 'ts-no-empty-object-type': tsNoEmptyObjectType,\n 'ts-no-unnecessary-template-expression': tsNoUnnecessaryTemplateExpression,\n 'ts-prefer-function-type': tsPreferFunctionType,\n 'type-formatting': typeFormatting,\n 'valid-types': validTypes,\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\nconst createRecommendedRuleset = (warnOrError, flatName) => {\n return {\n ...(flatName ? {\n name: 'jsdoc/' + flatName,\n } : {}),\n // @ts-expect-error ESLint 8 plugins\n plugins:\n flatName ? {\n jsdoc: index,\n } : [\n 'jsdoc',\n ],\n rules: {\n 'jsdoc/check-access': warnOrError,\n 'jsdoc/check-alignment': warnOrError,\n 'jsdoc/check-examples': 'off',\n 'jsdoc/check-indentation': 'off',\n 'jsdoc/check-line-alignment': 'off',\n 'jsdoc/check-param-names': warnOrError,\n 'jsdoc/check-property-names': warnOrError,\n 'jsdoc/check-syntax': 'off',\n 'jsdoc/check-tag-names': warnOrError,\n 'jsdoc/check-template-names': 'off',\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/convert-to-jsdoc-comments': 'off',\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/escape-inline-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/imports-as-dependencies': 'off',\n 'jsdoc/informative-docs': 'off',\n 'jsdoc/lines-before-block': 'off',\n 'jsdoc/match-description': 'off',\n 'jsdoc/match-name': 'off',\n 'jsdoc/multiline-blocks': warnOrError,\n 'jsdoc/no-bad-blocks': 'off',\n 'jsdoc/no-blank-block-descriptions': 'off',\n 'jsdoc/no-blank-blocks': 'off',\n 'jsdoc/no-defaults': warnOrError,\n 'jsdoc/no-missing-syntax': 'off',\n 'jsdoc/no-multi-asterisks': warnOrError,\n 'jsdoc/no-restricted-syntax': 'off',\n 'jsdoc/no-types': 'off',\n 'jsdoc/no-undefined-types': warnOrError,\n 'jsdoc/prefer-import-tag': 'off',\n 'jsdoc/reject-any-type': warnOrError,\n 'jsdoc/reject-function-type': warnOrError,\n 'jsdoc/require-asterisk-prefix': 'off',\n 'jsdoc/require-description': 'off',\n 'jsdoc/require-description-complete-sentence': 'off',\n 'jsdoc/require-example': 'off',\n 'jsdoc/require-file-overview': 'off',\n 'jsdoc/require-hyphen-before-param-description': 'off',\n 'jsdoc/require-jsdoc': warnOrError,\n 'jsdoc/require-next-description': 'off',\n 'jsdoc/require-next-type': warnOrError,\n 'jsdoc/require-param': warnOrError,\n 'jsdoc/require-param-description': warnOrError,\n 'jsdoc/require-param-name': warnOrError,\n 'jsdoc/require-param-type': warnOrError,\n 'jsdoc/require-property': warnOrError,\n 'jsdoc/require-property-description': warnOrError,\n 'jsdoc/require-property-name': warnOrError,\n 'jsdoc/require-property-type': warnOrError,\n 'jsdoc/require-rejects': 'off',\n 'jsdoc/require-returns': warnOrError,\n 'jsdoc/require-returns-check': warnOrError,\n 'jsdoc/require-returns-description': warnOrError,\n 'jsdoc/require-returns-type': warnOrError,\n 'jsdoc/require-tags': 'off',\n 'jsdoc/require-template': 'off',\n 'jsdoc/require-template-description': 'off',\n 'jsdoc/require-throws': 'off',\n 'jsdoc/require-throws-description': 'off',\n 'jsdoc/require-throws-type': warnOrError,\n 'jsdoc/require-yields': warnOrError,\n 'jsdoc/require-yields-check': warnOrError,\n 'jsdoc/require-yields-description': 'off',\n 'jsdoc/require-yields-type': warnOrError,\n 'jsdoc/sort-tags': 'off',\n 'jsdoc/tag-lines': warnOrError,\n 'jsdoc/text-escaping': 'off',\n 'jsdoc/ts-method-signature-style': 'off',\n 'jsdoc/ts-no-empty-object-type': warnOrError,\n 'jsdoc/ts-no-unnecessary-template-expression': 'off',\n 'jsdoc/ts-prefer-function-type': 'off',\n 'jsdoc/type-formatting': 'off',\n 'jsdoc/valid-types': warnOrError,\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\nconst createRecommendedTypeScriptRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedRuleset(warnOrError, flatName);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable @stylistic/indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/check-tag-names': [\n warnOrError, {\n typed: true,\n },\n ],\n 'jsdoc/no-types': warnOrError,\n 'jsdoc/no-undefined-types': 'off',\n 'jsdoc/require-param-type': 'off',\n 'jsdoc/require-property-type': 'off',\n 'jsdoc/require-returns-type': 'off',\n /* eslint-enable @stylistic/indent */\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\nconst createRecommendedTsDocRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedTypeScriptRuleset(warnOrError, flatName);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable @stylistic/indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/require-next-type': 'off',\n 'jsdoc/require-throws-type': 'off',\n 'jsdoc/require-yields-type': 'off',\n /* eslint-enable @stylistic/indent */\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\nconst createRecommendedTypeScriptFlavorRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedRuleset(warnOrError, flatName);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable @stylistic/indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/no-undefined-types': 'off',\n /* eslint-enable @stylistic/indent */\n },\n };\n};\n\n/**\n * @param {(string | unknown[])[]} ruleNames\n */\nconst createStandaloneRulesetFactory = (ruleNames) => {\n /**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\n return (warnOrError, flatName) => {\n return {\n name: 'jsdoc/' + flatName,\n plugins: {\n jsdoc: index,\n },\n rules: Object.fromEntries(\n ruleNames.map(\n (ruleName) => {\n return (typeof ruleName === 'string' ?\n [\n ruleName, warnOrError,\n ] :\n [\n ruleName[0], [\n warnOrError, ...ruleName.slice(1),\n ],\n ]);\n },\n ),\n ),\n };\n };\n};\n\nconst contentsRules = [\n 'jsdoc/informative-docs',\n 'jsdoc/match-description',\n 'jsdoc/no-blank-block-descriptions',\n 'jsdoc/no-blank-blocks',\n [\n 'jsdoc/text-escaping', {\n escapeHTML: true,\n },\n ],\n];\n\nconst createContentsTypescriptRuleset = createStandaloneRulesetFactory(contentsRules);\n\nconst createContentsTypescriptFlavorRuleset = createStandaloneRulesetFactory(contentsRules);\n\nconst logicalRules = [\n 'jsdoc/check-access',\n 'jsdoc/check-param-names',\n 'jsdoc/check-property-names',\n 'jsdoc/check-syntax',\n 'jsdoc/check-tag-names',\n 'jsdoc/check-template-names',\n 'jsdoc/check-types',\n 'jsdoc/check-values',\n 'jsdoc/empty-tags',\n 'jsdoc/escape-inline-tags',\n 'jsdoc/implements-on-classes',\n 'jsdoc/require-returns-check',\n 'jsdoc/require-yields-check',\n 'jsdoc/no-bad-blocks',\n 'jsdoc/no-defaults',\n 'jsdoc/no-types',\n 'jsdoc/no-undefined-types',\n 'jsdoc/valid-types',\n];\n\nconst createLogicalTypescriptRuleset = createStandaloneRulesetFactory(logicalRules);\n\nconst createLogicalTypescriptFlavorRuleset = createStandaloneRulesetFactory(logicalRules);\n\nconst requirementsRules = [\n 'jsdoc/require-example',\n 'jsdoc/require-jsdoc',\n 'jsdoc/require-next-type',\n 'jsdoc/require-param',\n 'jsdoc/require-param-description',\n 'jsdoc/require-param-name',\n 'jsdoc/require-property',\n 'jsdoc/require-property-description',\n 'jsdoc/require-property-name',\n 'jsdoc/require-returns',\n 'jsdoc/require-returns-description',\n 'jsdoc/require-throws-type',\n 'jsdoc/require-yields',\n 'jsdoc/require-yields-type',\n];\n\nconst createRequirementsTypeScriptRuleset = createStandaloneRulesetFactory(requirementsRules);\n\nconst createRequirementsTypeScriptFlavorRuleset = createStandaloneRulesetFactory([\n ...requirementsRules,\n 'jsdoc/require-param-type',\n 'jsdoc/require-property-type',\n 'jsdoc/require-returns-type',\n 'jsdoc/require-template',\n]);\n\nconst stylisticRules = [\n 'jsdoc/check-alignment',\n 'jsdoc/check-line-alignment',\n 'jsdoc/lines-before-block',\n 'jsdoc/multiline-blocks',\n 'jsdoc/no-multi-asterisks',\n 'jsdoc/require-asterisk-prefix',\n [\n 'jsdoc/require-hyphen-before-param-description', 'never',\n ],\n 'jsdoc/tag-lines',\n];\n\nconst createStylisticTypeScriptRuleset = createStandaloneRulesetFactory(stylisticRules);\n\nconst createStylisticTypeScriptFlavorRuleset = createStandaloneRulesetFactory(stylisticRules);\n\n/* c8 ignore next 3 -- TS */\nif (!index.configs) {\n throw new Error('TypeScript guard');\n}\n\nindex.configs.recommended = createRecommendedRuleset('warn');\nindex.configs['recommended-error'] = createRecommendedRuleset('error');\nindex.configs['recommended-typescript'] = createRecommendedTypeScriptRuleset('warn');\nindex.configs['recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error');\nindex.configs['recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn');\nindex.configs['recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlavorRuleset('error');\nindex.configs['recommended-tsdoc'] = createRecommendedTsDocRuleset('warn');\nindex.configs['recommended-tsdoc-error'] = createRecommendedTsDocRuleset('error');\n\nindex.configs['flat/recommended'] = createRecommendedRuleset('warn', 'flat/recommended');\nindex.configs['flat/recommended-error'] = createRecommendedRuleset('error', 'flat/recommended-error');\nindex.configs['flat/recommended-typescript'] = createRecommendedTypeScriptRuleset('warn', 'flat/recommended-typescript');\nindex.configs['flat/recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error', 'flat/recommended-typescript-error');\nindex.configs['flat/recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn', 'flat/recommended-typescript-flavor');\nindex.configs['flat/recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlavorRuleset('error', 'flat/recommended-typescript-flavor-error');\nindex.configs['flat/recommended-tsdoc'] = createRecommendedTsDocRuleset('warn', 'flat/recommended-tsdoc');\nindex.configs['flat/recommended-tsdoc-error'] = createRecommendedTsDocRuleset('error', 'flat/recommended-tsdoc-error');\n\nindex.configs['flat/contents-typescript'] = createContentsTypescriptRuleset('warn', 'flat/contents-typescript');\nindex.configs['flat/contents-typescript-error'] = createContentsTypescriptRuleset('error', 'flat/contents-typescript-error');\nindex.configs['flat/contents-typescript-flavor'] = createContentsTypescriptFlavorRuleset('warn', 'flat/contents-typescript-flavor');\nindex.configs['flat/contents-typescript-flavor-error'] = createContentsTypescriptFlavorRuleset('error', 'flat/contents-typescript-error-flavor');\nindex.configs['flat/logical-typescript'] = createLogicalTypescriptRuleset('warn', 'flat/logical-typescript');\nindex.configs['flat/logical-typescript-error'] = createLogicalTypescriptRuleset('error', 'flat/logical-typescript-error');\nindex.configs['flat/logical-typescript-flavor'] = createLogicalTypescriptFlavorRuleset('warn', 'flat/logical-typescript-flavor');\nindex.configs['flat/logical-typescript-flavor-error'] = createLogicalTypescriptFlavorRuleset('error', 'flat/logical-typescript-error-flavor');\nindex.configs['flat/requirements-typescript'] = createRequirementsTypeScriptRuleset('warn', 'flat/requirements-typescript');\nindex.configs['flat/requirements-typescript-error'] = createRequirementsTypeScriptRuleset('error', 'flat/requirements-typescript-error');\nindex.configs['flat/requirements-typescript-flavor'] = createRequirementsTypeScriptFlavorRuleset('warn', 'flat/requirements-typescript-flavor');\nindex.configs['flat/requirements-typescript-flavor-error'] = createRequirementsTypeScriptFlavorRuleset('error', 'flat/requirements-typescript-error-flavor');\nindex.configs['flat/stylistic-typescript'] = createStylisticTypeScriptRuleset('warn', 'flat/stylistic-typescript');\nindex.configs['flat/stylistic-typescript-error'] = createStylisticTypeScriptRuleset('error', 'flat/stylistic-typescript-error');\nindex.configs['flat/stylistic-typescript-flavor'] = createStylisticTypeScriptFlavorRuleset('warn', 'flat/stylistic-typescript-flavor');\nindex.configs['flat/stylistic-typescript-flavor-error'] = createStylisticTypeScriptFlavorRuleset('error', 'flat/stylistic-typescript-error-flavor');\n\nindex.configs.examples = /** @type {import('eslint').Linter.Config[]} */ ([\n {\n files: [\n '**/*.js',\n ],\n name: 'jsdoc/examples/processor',\n plugins: {\n examples: getJsdocProcessorPlugin(),\n },\n processor: 'examples/examples',\n },\n {\n files: [\n '**/*.md/*.js',\n ],\n name: 'jsdoc/examples/rules',\n rules: {\n // \"always\" newline rule at end unlikely in sample code\n '@stylistic/eol-last': 0,\n // Often wish to start `@example` code after newline; also may use\n // empty lines for spacing\n '@stylistic/no-multiple-empty-lines': 0,\n\n // Can generally look nicer to pad a little even if code imposes more stringency\n '@stylistic/padded-blocks': 0,\n\n '@typescript-eslint/no-unused-vars': 0,\n\n // Wouldn't generally expect example paths to resolve relative to JS file\n 'import/no-unresolved': 0,\n\n // Snippets likely too short to always include import/export info\n 'import/unambiguous': 0,\n\n 'jsdoc/require-file-overview': 0,\n\n // The end of a multiline comment would end the comment the example is in.\n 'jsdoc/require-jsdoc': 0,\n\n // See import/no-unresolved\n 'n/no-missing-import': 0,\n\n 'n/no-missing-require': 0,\n\n // Unlikely to have inadvertent debugging within examples\n 'no-console': 0,\n\n /* c8 ignore next 11 -- Coercion should work */\n ...(semver.gte(semver.coerce(ESLint.version) ?? '9.0.0', '9.0.0') ? {} : {\n // \"always\" newline rule at end unlikely in sample code\n 'eol-last': 0,\n\n // Often wish to start `@example` code after newline; also may use\n // empty lines for spacing\n 'no-multiple-empty-lines': 0,\n\n // Can generally look nicer to pad a little even if code imposes more stringency\n 'padded-blocks': 0,\n }),\n\n // Many variables in examples will be `undefined`\n 'no-undef': 0,\n // Common to define variables for clarity without always using them\n 'no-unused-vars': 0,\n\n // See import/no-unresolved\n 'node/no-missing-import': 0,\n 'node/no-missing-require': 0,\n },\n },\n]);\n\nindex.configs['default-expressions'] = /** @type {import('eslint').Linter.Config[]} */ ([\n {\n files: [\n '**/*.js',\n ],\n name: 'jsdoc/default-expressions/processor',\n plugins: {\n examples: getJsdocProcessorPlugin({\n checkDefaults: true,\n checkParams: true,\n checkProperties: true,\n }),\n },\n processor: 'examples/examples',\n },\n {\n files: [\n '**/*.jsdoc-defaults', '**/*.jsdoc-params', '**/*.jsdoc-properties',\n ],\n name: 'jsdoc/default-expressions/rules',\n rules: {\n ...index.configs.examples[1].rules,\n '@stylistic/quotes': [\n 'error', 'double',\n ],\n '@stylistic/semi': [\n 'error', 'never',\n ],\n '@typescript-eslint/no-unused-expressions': 0,\n 'chai-friendly/no-unused-expressions': 0,\n 'no-empty-function': 0,\n 'no-new': 0,\n 'no-unused-expressions': 0,\n /* c8 ignore next 8 -- Coercion should work */\n ...(semver.gte(semver.coerce(ESLint.version) ?? '9.0.0', '9.0.0') ? {} : {\n quotes: [\n 'error', 'double',\n ],\n semi: [\n 'error', 'never',\n ],\n }),\n strict: 0,\n },\n },\n]);\n\nindex.configs['examples-and-default-expressions'] = /** @type {import('eslint').Linter.Config[]} */ ([\n {\n name: 'jsdoc/examples-and-default-expressions',\n plugins: {\n examples: getJsdocProcessorPlugin({\n checkDefaults: true,\n checkParams: true,\n checkProperties: true,\n }),\n },\n },\n ...index.configs.examples.map((config) => {\n return {\n ...config,\n plugins: {},\n };\n }),\n ...index.configs['default-expressions'].map((config) => {\n return {\n ...config,\n plugins: {},\n };\n }),\n]);\n\nindex.configs['flat/recommended-mixed'] = [\n {\n ...index.configs['flat/recommended-typescript-flavor'],\n files: [\n '**/*.{js,jsx,cjs,mjs}',\n ],\n },\n {\n ...index.configs['flat/recommended-typescript'],\n files: [\n '**/*.{ts,tsx,cts,mts}',\n ],\n },\n];\n\nexport default index;\n\n/**\n * @type {((\n * cfg?: import('eslint').Linter.Config & {\n * config?: `flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,\n * mergeSettings?: boolean,\n * settings?: Partial<import('./iterateJsdoc.js').Settings>,\n * rules?: {[key in keyof import('./rules.d.ts').Rules]?: import('eslint').Linter.RuleEntry<import('./rules.d.ts').Rules[key]>},\n * extraRuleDefinitions?: {\n * forbid?: {\n * [contextName: string]: {\n * description?: string,\n * url?: string,\n * contexts: (string|{\n * message: string,\n * context: string,\n * comment: string\n * })[]\n * }\n * },\n * preferTypes?: {\n * [typeName: string]: {\n * description: string,\n * overrideSettings: {\n * [typeNodeName: string]: {\n * message: string,\n * replacement?: false|string,\n * unifyParentAndChildTypeChecks?: boolean,\n * }\n * },\n * url: string,\n * }\n * }\n * }\n * }\n * ) => import('eslint').Linter.Config)}\n */\nexport const jsdoc = function (cfg) {\n /** @type {import('eslint').Linter.Config} */\n let outputConfig = {\n plugins: {\n jsdoc: index,\n },\n };\n\n if (cfg) {\n if (cfg.config) {\n // @ts-expect-error Security check\n if (cfg.config === '__proto__') {\n throw new TypeError('Disallowed config value');\n }\n\n outputConfig = /** @type {import('eslint').Linter.Config} */ (index.configs[cfg.config]);\n }\n\n if (cfg.rules) {\n outputConfig.rules = {\n ...outputConfig.rules,\n ...cfg.rules,\n };\n }\n\n if (cfg.plugins) {\n outputConfig.plugins = {\n ...outputConfig.plugins,\n ...cfg.plugins,\n };\n }\n\n if (cfg.name) {\n outputConfig.name = cfg.name;\n }\n\n if (cfg.basePath) {\n outputConfig.basePath = cfg.basePath;\n }\n\n if (cfg.files) {\n outputConfig.files = cfg.files;\n }\n\n if (cfg.ignores) {\n outputConfig.ignores = cfg.ignores;\n }\n\n if (cfg.language) {\n outputConfig.language = cfg.language;\n }\n\n if (cfg.languageOptions) {\n outputConfig.languageOptions = cfg.languageOptions;\n }\n\n if (cfg.linterOptions) {\n outputConfig.linterOptions = cfg.linterOptions;\n }\n\n if (cfg.processor) {\n outputConfig.processor = cfg.processor;\n }\n\n if (cfg.extraRuleDefinitions) {\n if (!outputConfig.plugins?.jsdoc?.rules) {\n throw new Error('JSDoc plugin required for `extraRuleDefinitions`');\n }\n\n if (cfg.extraRuleDefinitions.forbid) {\n for (const [\n contextName,\n {\n contexts,\n description,\n url,\n },\n ] of Object.entries(cfg.extraRuleDefinitions.forbid)) {\n outputConfig.plugins.jsdoc.rules[`forbid-${contextName}`] =\n buildForbidRuleDefinition({\n contextName,\n contexts,\n description,\n url,\n });\n }\n }\n\n if (cfg.extraRuleDefinitions.preferTypes) {\n for (const [\n typeName,\n {\n description,\n overrideSettings,\n url,\n },\n ] of Object.entries(cfg.extraRuleDefinitions.preferTypes)) {\n outputConfig.plugins.jsdoc.rules[`prefer-type-${typeName}`] =\n buildRejectOrPreferRuleDefinition({\n description,\n overrideSettings,\n typeName,\n url,\n });\n }\n }\n }\n }\n\n outputConfig.settings = {\n jsdoc: cfg?.mergeSettings === false ?\n cfg.settings :\n merge(\n {},\n cfg?.settings ?? {},\n cfg?.config?.includes('recommended') ?\n {\n // We may need to drop these for \"typescript\" (non-\"flavor\") configs,\n // if support is later added: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html\n structuredTags: {\n next: {\n required: [\n 'type',\n ],\n },\n rejects: {\n required: [\n 'type',\n ],\n },\n },\n } :\n {},\n ),\n };\n\n return outputConfig;\n};\n\nexport {\n getJsdocProcessorPlugin,\n} from './getJsdocProcessorPlugin.js';\n"],"mappings":";;;;;;;;;;;;;AAEA;AAIA;AAGA;AAGA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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AAC,GACD,CAAC,CACL;EACJ,CAAC;EAED,OAAO,YAAY;AACrB,CAAC;AAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["checkAccess","checkAlignment","checkExamples","checkIndentation","checkLineAlignment","checkParamNames","checkPropertyNames","checkSyntax","checkTagNames","checkTemplateNames","checkTypes","checkValues","convertToJsdocComments","emptyTags","escapeInlineTags","implementsOnClasses","importsAsDependencies","informativeDocs","linesBeforeBlock","matchDescription","matchName","multilineBlocks","noBadBlocks","noBlankBlockDescriptions","noBlankBlocks","noDefaults","noMissingSyntax","noMultiAsterisks","noRestrictedSyntax","noTypes","noUndefinedTypes","normalizeSeeLinks","preferImportTag","buildRejectOrPreferRuleDefinition","requireAsteriskPrefix","requireDescription","requireDescriptionCompleteSentence","requireExample","requireFileOverview","requireHyphenBeforeParamDescription","requireJsdoc","buildForbidRuleDefinition","requireParam","requireParamDescription","requireParamName","requireParamType","requireProperty","requirePropertyDescription","requirePropertyName","requirePropertyType","requireRejects","requireReturns","requireReturnsCheck","requireReturnsDescription","requireReturnsType","requireTags","requireTemplate","requireThrows","requireYields","requireYieldsCheck","sortTags","tagLines","textEscaping","tsMethodSignatureStyle","tsNoEmptyObjectType","tsNoUnnecessaryTemplateExpression","tsPreferFunctionType","typeFormatting","validTypes","getJsdocProcessorPlugin","semver","ESLint","merge"],"sources":["../src/index.js"],"sourcesContent":["/* AUTO-GENERATED BY build SCRIPT */\n/* eslint-disable perfectionist/sort-imports -- For auto-generate; Do not remove */\nimport {\n merge,\n} from 'object-deep-merge';\n\nimport {\n buildForbidRuleDefinition,\n} from './buildForbidRuleDefinition.js';\nimport {\n buildRejectOrPreferRuleDefinition,\n} from './buildRejectOrPreferRuleDefinition.js';\nimport {\n getJsdocProcessorPlugin,\n} from './getJsdocProcessorPlugin.js';\nimport checkAccess from './rules/checkAccess.js';\nimport checkAlignment from './rules/checkAlignment.js';\nimport checkExamples from './rules/checkExamples.js';\nimport checkIndentation from './rules/checkIndentation.js';\nimport checkLineAlignment from './rules/checkLineAlignment.js';\nimport checkParamNames from './rules/checkParamNames.js';\nimport checkPropertyNames from './rules/checkPropertyNames.js';\nimport checkSyntax from './rules/checkSyntax.js';\nimport checkTagNames from './rules/checkTagNames.js';\nimport checkTemplateNames from './rules/checkTemplateNames.js';\nimport checkTypes from './rules/checkTypes.js';\nimport checkValues from './rules/checkValues.js';\nimport convertToJsdocComments from './rules/convertToJsdocComments.js';\nimport emptyTags from './rules/emptyTags.js';\nimport escapeInlineTags from './rules/escapeInlineTags.js';\nimport implementsOnClasses from './rules/implementsOnClasses.js';\nimport importsAsDependencies from './rules/importsAsDependencies.js';\nimport informativeDocs from './rules/informativeDocs.js';\nimport linesBeforeBlock from './rules/linesBeforeBlock.js';\nimport matchDescription from './rules/matchDescription.js';\nimport matchName from './rules/matchName.js';\nimport multilineBlocks from './rules/multilineBlocks.js';\nimport noBadBlocks from './rules/noBadBlocks.js';\nimport noBlankBlockDescriptions from './rules/noBlankBlockDescriptions.js';\nimport noBlankBlocks from './rules/noBlankBlocks.js';\nimport noDefaults from './rules/noDefaults.js';\nimport noMissingSyntax from './rules/noMissingSyntax.js';\nimport noMultiAsterisks from './rules/noMultiAsterisks.js';\nimport noRestrictedSyntax from './rules/noRestrictedSyntax.js';\nimport normalizeSeeLinks from './rules/normalizeSeeLinks.js';\nimport noTypes from './rules/noTypes.js';\nimport noUndefinedTypes from './rules/noUndefinedTypes.js';\nimport preferImportTag from './rules/preferImportTag.js';\nimport requireAsteriskPrefix from './rules/requireAsteriskPrefix.js';\nimport requireDescription from './rules/requireDescription.js';\nimport requireDescriptionCompleteSentence from './rules/requireDescriptionCompleteSentence.js';\nimport requireExample from './rules/requireExample.js';\nimport requireFileOverview from './rules/requireFileOverview.js';\nimport requireHyphenBeforeParamDescription from './rules/requireHyphenBeforeParamDescription.js';\nimport requireJsdoc from './rules/requireJsdoc.js';\nimport requireParam from './rules/requireParam.js';\nimport requireParamDescription from './rules/requireParamDescription.js';\nimport requireParamName from './rules/requireParamName.js';\nimport requireParamType from './rules/requireParamType.js';\nimport requireProperty from './rules/requireProperty.js';\nimport requirePropertyDescription from './rules/requirePropertyDescription.js';\nimport requirePropertyName from './rules/requirePropertyName.js';\nimport requirePropertyType from './rules/requirePropertyType.js';\nimport requireRejects from './rules/requireRejects.js';\nimport requireReturns from './rules/requireReturns.js';\nimport requireReturnsCheck from './rules/requireReturnsCheck.js';\nimport requireReturnsDescription from './rules/requireReturnsDescription.js';\nimport requireReturnsType from './rules/requireReturnsType.js';\nimport requireTags from './rules/requireTags.js';\nimport requireTemplate from './rules/requireTemplate.js';\nimport requireThrows from './rules/requireThrows.js';\nimport requireYields from './rules/requireYields.js';\nimport requireYieldsCheck from './rules/requireYieldsCheck.js';\nimport sortTags from './rules/sortTags.js';\nimport tagLines from './rules/tagLines.js';\nimport textEscaping from './rules/textEscaping.js';\nimport tsMethodSignatureStyle from './rules/tsMethodSignatureStyle.js';\nimport tsNoEmptyObjectType from './rules/tsNoEmptyObjectType.js';\nimport tsNoUnnecessaryTemplateExpression from './rules/tsNoUnnecessaryTemplateExpression.js';\nimport tsPreferFunctionType from './rules/tsPreferFunctionType.js';\nimport typeFormatting from './rules/typeFormatting.js';\nimport validTypes from './rules/validTypes.js';\nimport {\n ESLint,\n} from 'eslint';\nimport semver from 'semver';\n\n/**\n * @typedef {\"recommended\" | \"stylistic\" | \"contents\" | \"logical\" | \"requirements\"} ConfigGroups\n * @typedef {\"\" | \"-typescript\" | \"-typescript-flavor\"} ConfigVariants\n * @typedef {\"\" | \"-error\"} ErrorLevelVariants\n * @type {import('eslint').ESLint.Plugin & {\n * configs: Record<\n * `flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,\n * import('eslint').Linter.Config\n * > &\n * Record<\n * \"examples\"|\"default-expressions\"|\"examples-and-default-expressions\",\n * import('eslint').Linter.Config[]\n * > &\n * Record<\"flat/recommended-mixed\", import('eslint').Linter.Config[]>\n * }}\n */\nconst index = {};\nindex.configs = {};\nindex.rules = {\n 'check-access': checkAccess,\n 'check-alignment': checkAlignment,\n 'check-examples': checkExamples,\n 'check-indentation': checkIndentation,\n 'check-line-alignment': checkLineAlignment,\n 'check-param-names': checkParamNames,\n 'check-property-names': checkPropertyNames,\n 'check-syntax': checkSyntax,\n 'check-tag-names': checkTagNames,\n 'check-template-names': checkTemplateNames,\n 'check-types': checkTypes,\n 'check-values': checkValues,\n 'convert-to-jsdoc-comments': convertToJsdocComments,\n 'empty-tags': emptyTags,\n 'escape-inline-tags': escapeInlineTags,\n 'implements-on-classes': implementsOnClasses,\n 'imports-as-dependencies': importsAsDependencies,\n 'informative-docs': informativeDocs,\n 'lines-before-block': linesBeforeBlock,\n 'match-description': matchDescription,\n 'match-name': matchName,\n 'multiline-blocks': multilineBlocks,\n 'no-bad-blocks': noBadBlocks,\n 'no-blank-block-descriptions': noBlankBlockDescriptions,\n 'no-blank-blocks': noBlankBlocks,\n 'no-defaults': noDefaults,\n 'no-missing-syntax': noMissingSyntax,\n 'no-multi-asterisks': noMultiAsterisks,\n 'no-restricted-syntax': noRestrictedSyntax,\n 'no-types': noTypes,\n 'no-undefined-types': noUndefinedTypes,\n 'normalize-see-links': normalizeSeeLinks,\n 'prefer-import-tag': preferImportTag,\n 'reject-any-type': buildRejectOrPreferRuleDefinition({\n description: 'Reports use of `any` or `*` type',\n overrideSettings: {\n '*': {\n message: 'Prefer a more specific type to `*`',\n replacement: false,\n unifyParentAndChildTypeChecks: true,\n },\n any: {\n message: 'Prefer a more specific type to `any`',\n replacement: false,\n unifyParentAndChildTypeChecks: true,\n },\n },\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/reject-any-type.md#repos-sticky-header',\n }),\n 'reject-function-type': buildRejectOrPreferRuleDefinition({\n description: 'Reports use of `Function` type',\n overrideSettings: {\n Function: {\n message: 'Prefer a more specific type to `Function`',\n replacement: false,\n unifyParentAndChildTypeChecks: true,\n },\n },\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/reject-function-type.md#repos-sticky-header',\n }),\n 'require-asterisk-prefix': requireAsteriskPrefix,\n 'require-description': requireDescription,\n 'require-description-complete-sentence': requireDescriptionCompleteSentence,\n 'require-example': requireExample,\n 'require-file-overview': requireFileOverview,\n 'require-hyphen-before-param-description': requireHyphenBeforeParamDescription,\n 'require-jsdoc': requireJsdoc,\n 'require-next-description': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=next]:not([name!=\"\"]):not([description!=\"\"]))',\n context: 'any',\n message: '@next should have a description',\n },\n ],\n description: 'Requires a description for `@next` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-next-description.md#repos-sticky-header',\n }),\n 'require-next-type': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=next]:not([parsedType.type]))',\n context: 'any',\n message: '@next should have a type',\n },\n ],\n description: 'Requires a type for `@next` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-next-type.md#repos-sticky-header',\n }),\n 'require-param': requireParam,\n 'require-param-description': requireParamDescription,\n 'require-param-name': requireParamName,\n 'require-param-type': requireParamType,\n 'require-property': requireProperty,\n 'require-property-description': requirePropertyDescription,\n 'require-property-name': requirePropertyName,\n 'require-property-type': requirePropertyType,\n 'require-rejects': requireRejects,\n 'require-returns': requireReturns,\n 'require-returns-check': requireReturnsCheck,\n 'require-returns-description': requireReturnsDescription,\n 'require-returns-type': requireReturnsType,\n 'require-tags': requireTags,\n 'require-template': requireTemplate,\n 'require-template-description': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=template]:not([description!=\"\"]))',\n context: 'any',\n message: '@template should have a description',\n },\n ],\n description: 'Requires a description for `@template` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template-description.md#repos-sticky-header',\n }),\n 'require-throws': requireThrows,\n 'require-throws-description': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=/^(?:throws|exception)$/]:not([description!=\"\"]))',\n context: 'any',\n message: '@throws should have a description',\n },\n ],\n description: 'Requires a description for `@throws` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws-description.md#repos-sticky-header',\n }),\n 'require-throws-type': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=/^(?:throws|exception)$/]:not([parsedType.type]))',\n context: 'any',\n message: '@throws should have a type',\n },\n ],\n description: 'Requires a type for `@throws` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws-type.md#repos-sticky-header',\n }),\n 'require-yields': requireYields,\n 'require-yields-check': requireYieldsCheck,\n 'require-yields-description': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=/^yields?$/]:not([name!=\"\"]):not([description!=\"\"]))',\n context: 'any',\n message: '@yields should have a description',\n },\n ],\n description: 'Requires a description for `@yields` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-description.md#repos-sticky-header',\n }),\n 'require-yields-type': buildForbidRuleDefinition({\n contexts: [\n {\n comment: 'JsdocBlock:has(JsdocTag[tag=/^yields?$/]:not([parsedType.type]))',\n context: 'any',\n message: '@yields should have a type',\n },\n ],\n description: 'Requires a type for `@yields` tags',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-type.md#repos-sticky-header',\n }),\n 'sort-tags': sortTags,\n 'tag-lines': tagLines,\n 'text-escaping': textEscaping,\n 'ts-method-signature-style': tsMethodSignatureStyle,\n 'ts-no-empty-object-type': tsNoEmptyObjectType,\n 'ts-no-unnecessary-template-expression': tsNoUnnecessaryTemplateExpression,\n 'ts-prefer-function-type': tsPreferFunctionType,\n 'type-formatting': typeFormatting,\n 'valid-types': validTypes,\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\nconst createRecommendedRuleset = (warnOrError, flatName) => {\n return {\n ...(flatName ? {\n name: 'jsdoc/' + flatName,\n } : {}),\n // @ts-expect-error ESLint 8 plugins\n plugins:\n flatName ? {\n jsdoc: index,\n } : [\n 'jsdoc',\n ],\n rules: {\n 'jsdoc/check-access': warnOrError,\n 'jsdoc/check-alignment': warnOrError,\n 'jsdoc/check-examples': 'off',\n 'jsdoc/check-indentation': 'off',\n 'jsdoc/check-line-alignment': 'off',\n 'jsdoc/check-param-names': warnOrError,\n 'jsdoc/check-property-names': warnOrError,\n 'jsdoc/check-syntax': 'off',\n 'jsdoc/check-tag-names': warnOrError,\n 'jsdoc/check-template-names': 'off',\n 'jsdoc/check-types': warnOrError,\n 'jsdoc/check-values': warnOrError,\n 'jsdoc/convert-to-jsdoc-comments': 'off',\n 'jsdoc/empty-tags': warnOrError,\n 'jsdoc/escape-inline-tags': warnOrError,\n 'jsdoc/implements-on-classes': warnOrError,\n 'jsdoc/imports-as-dependencies': 'off',\n 'jsdoc/informative-docs': 'off',\n 'jsdoc/lines-before-block': 'off',\n 'jsdoc/match-description': 'off',\n 'jsdoc/match-name': 'off',\n 'jsdoc/multiline-blocks': warnOrError,\n 'jsdoc/no-bad-blocks': 'off',\n 'jsdoc/no-blank-block-descriptions': 'off',\n 'jsdoc/no-blank-blocks': 'off',\n 'jsdoc/no-defaults': warnOrError,\n 'jsdoc/no-missing-syntax': 'off',\n 'jsdoc/no-multi-asterisks': warnOrError,\n 'jsdoc/no-restricted-syntax': 'off',\n 'jsdoc/no-types': 'off',\n 'jsdoc/no-undefined-types': warnOrError,\n 'jsdoc/normalize-see-links': 'off',\n 'jsdoc/prefer-import-tag': 'off',\n 'jsdoc/reject-any-type': warnOrError,\n 'jsdoc/reject-function-type': warnOrError,\n 'jsdoc/require-asterisk-prefix': 'off',\n 'jsdoc/require-description': 'off',\n 'jsdoc/require-description-complete-sentence': 'off',\n 'jsdoc/require-example': 'off',\n 'jsdoc/require-file-overview': 'off',\n 'jsdoc/require-hyphen-before-param-description': 'off',\n 'jsdoc/require-jsdoc': warnOrError,\n 'jsdoc/require-next-description': 'off',\n 'jsdoc/require-next-type': warnOrError,\n 'jsdoc/require-param': warnOrError,\n 'jsdoc/require-param-description': warnOrError,\n 'jsdoc/require-param-name': warnOrError,\n 'jsdoc/require-param-type': warnOrError,\n 'jsdoc/require-property': warnOrError,\n 'jsdoc/require-property-description': warnOrError,\n 'jsdoc/require-property-name': warnOrError,\n 'jsdoc/require-property-type': warnOrError,\n 'jsdoc/require-rejects': 'off',\n 'jsdoc/require-returns': warnOrError,\n 'jsdoc/require-returns-check': warnOrError,\n 'jsdoc/require-returns-description': warnOrError,\n 'jsdoc/require-returns-type': warnOrError,\n 'jsdoc/require-tags': 'off',\n 'jsdoc/require-template': 'off',\n 'jsdoc/require-template-description': 'off',\n 'jsdoc/require-throws': 'off',\n 'jsdoc/require-throws-description': 'off',\n 'jsdoc/require-throws-type': warnOrError,\n 'jsdoc/require-yields': warnOrError,\n 'jsdoc/require-yields-check': warnOrError,\n 'jsdoc/require-yields-description': 'off',\n 'jsdoc/require-yields-type': warnOrError,\n 'jsdoc/sort-tags': 'off',\n 'jsdoc/tag-lines': warnOrError,\n 'jsdoc/text-escaping': 'off',\n 'jsdoc/ts-method-signature-style': 'off',\n 'jsdoc/ts-no-empty-object-type': warnOrError,\n 'jsdoc/ts-no-unnecessary-template-expression': 'off',\n 'jsdoc/ts-prefer-function-type': 'off',\n 'jsdoc/type-formatting': 'off',\n 'jsdoc/valid-types': warnOrError,\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\nconst createRecommendedTypeScriptRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedRuleset(warnOrError, flatName);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable @stylistic/indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/check-tag-names': [\n warnOrError, {\n typed: true,\n },\n ],\n 'jsdoc/no-types': warnOrError,\n 'jsdoc/no-undefined-types': 'off',\n 'jsdoc/require-param-type': 'off',\n 'jsdoc/require-property-type': 'off',\n 'jsdoc/require-returns-type': 'off',\n /* eslint-enable @stylistic/indent */\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\nconst createRecommendedTsDocRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedTypeScriptRuleset(warnOrError, flatName);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable @stylistic/indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/require-next-type': 'off',\n 'jsdoc/require-throws-type': 'off',\n 'jsdoc/require-yields-type': 'off',\n /* eslint-enable @stylistic/indent */\n },\n };\n};\n\n/**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\nconst createRecommendedTypeScriptFlavorRuleset = (warnOrError, flatName) => {\n const ruleset = createRecommendedRuleset(warnOrError, flatName);\n\n return {\n ...ruleset,\n rules: {\n ...ruleset.rules,\n /* eslint-disable @stylistic/indent -- Extra indent to avoid use by auto-rule-editing */\n 'jsdoc/no-undefined-types': 'off',\n /* eslint-enable @stylistic/indent */\n },\n };\n};\n\n/**\n * @param {(string | unknown[])[]} ruleNames\n */\nconst createStandaloneRulesetFactory = (ruleNames) => {\n /**\n * @param {\"warn\"|\"error\"} warnOrError\n * @param {string} [flatName]\n * @returns {import('eslint').Linter.Config}\n */\n return (warnOrError, flatName) => {\n return {\n name: 'jsdoc/' + flatName,\n plugins: {\n jsdoc: index,\n },\n rules: Object.fromEntries(\n ruleNames.map(\n (ruleName) => {\n return (typeof ruleName === 'string' ?\n [\n ruleName, warnOrError,\n ] :\n [\n ruleName[0], [\n warnOrError, ...ruleName.slice(1),\n ],\n ]);\n },\n ),\n ),\n };\n };\n};\n\nconst contentsRules = [\n 'jsdoc/informative-docs',\n 'jsdoc/match-description',\n 'jsdoc/no-blank-block-descriptions',\n 'jsdoc/no-blank-blocks',\n [\n 'jsdoc/text-escaping', {\n escapeHTML: true,\n },\n ],\n];\n\nconst createContentsTypescriptRuleset = createStandaloneRulesetFactory(contentsRules);\n\nconst createContentsTypescriptFlavorRuleset = createStandaloneRulesetFactory(contentsRules);\n\nconst logicalRules = [\n 'jsdoc/check-access',\n 'jsdoc/check-param-names',\n 'jsdoc/check-property-names',\n 'jsdoc/check-syntax',\n 'jsdoc/check-tag-names',\n 'jsdoc/check-template-names',\n 'jsdoc/check-types',\n 'jsdoc/check-values',\n 'jsdoc/empty-tags',\n 'jsdoc/escape-inline-tags',\n 'jsdoc/implements-on-classes',\n 'jsdoc/require-returns-check',\n 'jsdoc/require-yields-check',\n 'jsdoc/no-bad-blocks',\n 'jsdoc/no-defaults',\n 'jsdoc/no-types',\n 'jsdoc/no-undefined-types',\n 'jsdoc/valid-types',\n];\n\nconst createLogicalTypescriptRuleset = createStandaloneRulesetFactory(logicalRules);\n\nconst createLogicalTypescriptFlavorRuleset = createStandaloneRulesetFactory(logicalRules);\n\nconst requirementsRules = [\n 'jsdoc/require-example',\n 'jsdoc/require-jsdoc',\n 'jsdoc/require-next-type',\n 'jsdoc/require-param',\n 'jsdoc/require-param-description',\n 'jsdoc/require-param-name',\n 'jsdoc/require-property',\n 'jsdoc/require-property-description',\n 'jsdoc/require-property-name',\n 'jsdoc/require-returns',\n 'jsdoc/require-returns-description',\n 'jsdoc/require-throws-type',\n 'jsdoc/require-yields',\n 'jsdoc/require-yields-type',\n];\n\nconst createRequirementsTypeScriptRuleset = createStandaloneRulesetFactory(requirementsRules);\n\nconst createRequirementsTypeScriptFlavorRuleset = createStandaloneRulesetFactory([\n ...requirementsRules,\n 'jsdoc/require-param-type',\n 'jsdoc/require-property-type',\n 'jsdoc/require-returns-type',\n 'jsdoc/require-template',\n]);\n\nconst stylisticRules = [\n 'jsdoc/check-alignment',\n 'jsdoc/check-line-alignment',\n 'jsdoc/lines-before-block',\n 'jsdoc/multiline-blocks',\n 'jsdoc/no-multi-asterisks',\n 'jsdoc/require-asterisk-prefix',\n [\n 'jsdoc/require-hyphen-before-param-description', 'never',\n ],\n 'jsdoc/tag-lines',\n];\n\nconst createStylisticTypeScriptRuleset = createStandaloneRulesetFactory(stylisticRules);\n\nconst createStylisticTypeScriptFlavorRuleset = createStandaloneRulesetFactory(stylisticRules);\n\n/* c8 ignore next 3 -- TS */\nif (!index.configs) {\n throw new Error('TypeScript guard');\n}\n\nindex.configs.recommended = createRecommendedRuleset('warn');\nindex.configs['recommended-error'] = createRecommendedRuleset('error');\nindex.configs['recommended-typescript'] = createRecommendedTypeScriptRuleset('warn');\nindex.configs['recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error');\nindex.configs['recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn');\nindex.configs['recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlavorRuleset('error');\nindex.configs['recommended-tsdoc'] = createRecommendedTsDocRuleset('warn');\nindex.configs['recommended-tsdoc-error'] = createRecommendedTsDocRuleset('error');\n\nindex.configs['flat/recommended'] = createRecommendedRuleset('warn', 'flat/recommended');\nindex.configs['flat/recommended-error'] = createRecommendedRuleset('error', 'flat/recommended-error');\nindex.configs['flat/recommended-typescript'] = createRecommendedTypeScriptRuleset('warn', 'flat/recommended-typescript');\nindex.configs['flat/recommended-typescript-error'] = createRecommendedTypeScriptRuleset('error', 'flat/recommended-typescript-error');\nindex.configs['flat/recommended-typescript-flavor'] = createRecommendedTypeScriptFlavorRuleset('warn', 'flat/recommended-typescript-flavor');\nindex.configs['flat/recommended-typescript-flavor-error'] = createRecommendedTypeScriptFlavorRuleset('error', 'flat/recommended-typescript-flavor-error');\nindex.configs['flat/recommended-tsdoc'] = createRecommendedTsDocRuleset('warn', 'flat/recommended-tsdoc');\nindex.configs['flat/recommended-tsdoc-error'] = createRecommendedTsDocRuleset('error', 'flat/recommended-tsdoc-error');\n\nindex.configs['flat/contents-typescript'] = createContentsTypescriptRuleset('warn', 'flat/contents-typescript');\nindex.configs['flat/contents-typescript-error'] = createContentsTypescriptRuleset('error', 'flat/contents-typescript-error');\nindex.configs['flat/contents-typescript-flavor'] = createContentsTypescriptFlavorRuleset('warn', 'flat/contents-typescript-flavor');\nindex.configs['flat/contents-typescript-flavor-error'] = createContentsTypescriptFlavorRuleset('error', 'flat/contents-typescript-error-flavor');\nindex.configs['flat/logical-typescript'] = createLogicalTypescriptRuleset('warn', 'flat/logical-typescript');\nindex.configs['flat/logical-typescript-error'] = createLogicalTypescriptRuleset('error', 'flat/logical-typescript-error');\nindex.configs['flat/logical-typescript-flavor'] = createLogicalTypescriptFlavorRuleset('warn', 'flat/logical-typescript-flavor');\nindex.configs['flat/logical-typescript-flavor-error'] = createLogicalTypescriptFlavorRuleset('error', 'flat/logical-typescript-error-flavor');\nindex.configs['flat/requirements-typescript'] = createRequirementsTypeScriptRuleset('warn', 'flat/requirements-typescript');\nindex.configs['flat/requirements-typescript-error'] = createRequirementsTypeScriptRuleset('error', 'flat/requirements-typescript-error');\nindex.configs['flat/requirements-typescript-flavor'] = createRequirementsTypeScriptFlavorRuleset('warn', 'flat/requirements-typescript-flavor');\nindex.configs['flat/requirements-typescript-flavor-error'] = createRequirementsTypeScriptFlavorRuleset('error', 'flat/requirements-typescript-error-flavor');\nindex.configs['flat/stylistic-typescript'] = createStylisticTypeScriptRuleset('warn', 'flat/stylistic-typescript');\nindex.configs['flat/stylistic-typescript-error'] = createStylisticTypeScriptRuleset('error', 'flat/stylistic-typescript-error');\nindex.configs['flat/stylistic-typescript-flavor'] = createStylisticTypeScriptFlavorRuleset('warn', 'flat/stylistic-typescript-flavor');\nindex.configs['flat/stylistic-typescript-flavor-error'] = createStylisticTypeScriptFlavorRuleset('error', 'flat/stylistic-typescript-error-flavor');\n\nindex.configs.examples = /** @type {import('eslint').Linter.Config[]} */ ([\n {\n files: [\n '**/*.js',\n ],\n name: 'jsdoc/examples/processor',\n plugins: {\n examples: getJsdocProcessorPlugin(),\n },\n processor: 'examples/examples',\n },\n {\n files: [\n '**/*.md/*.js',\n ],\n name: 'jsdoc/examples/rules',\n rules: {\n // \"always\" newline rule at end unlikely in sample code\n '@stylistic/eol-last': 0,\n // Often wish to start `@example` code after newline; also may use\n // empty lines for spacing\n '@stylistic/no-multiple-empty-lines': 0,\n\n // Can generally look nicer to pad a little even if code imposes more stringency\n '@stylistic/padded-blocks': 0,\n\n '@typescript-eslint/no-unused-vars': 0,\n\n // Wouldn't generally expect example paths to resolve relative to JS file\n 'import/no-unresolved': 0,\n\n // Snippets likely too short to always include import/export info\n 'import/unambiguous': 0,\n\n 'jsdoc/require-file-overview': 0,\n\n // The end of a multiline comment would end the comment the example is in.\n 'jsdoc/require-jsdoc': 0,\n\n // See import/no-unresolved\n 'n/no-missing-import': 0,\n\n 'n/no-missing-require': 0,\n\n // Unlikely to have inadvertent debugging within examples\n 'no-console': 0,\n\n /* c8 ignore next 11 -- Coercion should work */\n ...(semver.gte(semver.coerce(ESLint.version) ?? '9.0.0', '9.0.0') ? {} : {\n // \"always\" newline rule at end unlikely in sample code\n 'eol-last': 0,\n\n // Often wish to start `@example` code after newline; also may use\n // empty lines for spacing\n 'no-multiple-empty-lines': 0,\n\n // Can generally look nicer to pad a little even if code imposes more stringency\n 'padded-blocks': 0,\n }),\n\n // Many variables in examples will be `undefined`\n 'no-undef': 0,\n // Common to define variables for clarity without always using them\n 'no-unused-vars': 0,\n\n // See import/no-unresolved\n 'node/no-missing-import': 0,\n 'node/no-missing-require': 0,\n },\n },\n]);\n\nindex.configs['default-expressions'] = /** @type {import('eslint').Linter.Config[]} */ ([\n {\n files: [\n '**/*.js',\n ],\n name: 'jsdoc/default-expressions/processor',\n plugins: {\n examples: getJsdocProcessorPlugin({\n checkDefaults: true,\n checkParams: true,\n checkProperties: true,\n }),\n },\n processor: 'examples/examples',\n },\n {\n files: [\n '**/*.jsdoc-defaults', '**/*.jsdoc-params', '**/*.jsdoc-properties',\n ],\n name: 'jsdoc/default-expressions/rules',\n rules: {\n ...index.configs.examples[1].rules,\n '@stylistic/quotes': [\n 'error', 'double',\n ],\n '@stylistic/semi': [\n 'error', 'never',\n ],\n '@typescript-eslint/no-unused-expressions': 0,\n 'chai-friendly/no-unused-expressions': 0,\n 'no-empty-function': 0,\n 'no-new': 0,\n 'no-unused-expressions': 0,\n /* c8 ignore next 8 -- Coercion should work */\n ...(semver.gte(semver.coerce(ESLint.version) ?? '9.0.0', '9.0.0') ? {} : {\n quotes: [\n 'error', 'double',\n ],\n semi: [\n 'error', 'never',\n ],\n }),\n strict: 0,\n },\n },\n]);\n\nindex.configs['examples-and-default-expressions'] = /** @type {import('eslint').Linter.Config[]} */ ([\n {\n name: 'jsdoc/examples-and-default-expressions',\n plugins: {\n examples: getJsdocProcessorPlugin({\n checkDefaults: true,\n checkParams: true,\n checkProperties: true,\n }),\n },\n },\n ...index.configs.examples.map((config) => {\n return {\n ...config,\n plugins: {},\n };\n }),\n ...index.configs['default-expressions'].map((config) => {\n return {\n ...config,\n plugins: {},\n };\n }),\n]);\n\nindex.configs['flat/recommended-mixed'] = [\n {\n ...index.configs['flat/recommended-typescript-flavor'],\n files: [\n '**/*.{js,jsx,cjs,mjs}',\n ],\n },\n {\n ...index.configs['flat/recommended-typescript'],\n files: [\n '**/*.{ts,tsx,cts,mts}',\n ],\n },\n];\n\nexport default index;\n\n/**\n * @type {((\n * cfg?: import('eslint').Linter.Config & {\n * config?: `flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,\n * mergeSettings?: boolean,\n * settings?: Partial<import('./iterateJsdoc.js').Settings>,\n * rules?: {[key in keyof import('./rules.d.ts').Rules]?: import('eslint').Linter.RuleEntry<import('./rules.d.ts').Rules[key]>},\n * extraRuleDefinitions?: {\n * forbid?: {\n * [contextName: string]: {\n * description?: string,\n * url?: string,\n * contexts: (string|{\n * message: string,\n * context: string,\n * comment: string\n * })[]\n * }\n * },\n * preferTypes?: {\n * [typeName: string]: {\n * description: string,\n * overrideSettings: {\n * [typeNodeName: string]: {\n * message: string,\n * replacement?: false|string,\n * unifyParentAndChildTypeChecks?: boolean,\n * }\n * },\n * url: string,\n * }\n * }\n * }\n * }\n * ) => import('eslint').Linter.Config)}\n */\nexport const jsdoc = function (cfg) {\n /** @type {import('eslint').Linter.Config} */\n let outputConfig = {\n plugins: {\n jsdoc: index,\n },\n };\n\n if (cfg) {\n if (cfg.config) {\n // @ts-expect-error Security check\n if (cfg.config === '__proto__') {\n throw new TypeError('Disallowed config value');\n }\n\n outputConfig = /** @type {import('eslint').Linter.Config} */ (index.configs[cfg.config]);\n }\n\n if (cfg.rules) {\n outputConfig.rules = {\n ...outputConfig.rules,\n ...cfg.rules,\n };\n }\n\n if (cfg.plugins) {\n outputConfig.plugins = {\n ...outputConfig.plugins,\n ...cfg.plugins,\n };\n }\n\n if (cfg.name) {\n outputConfig.name = cfg.name;\n }\n\n if (cfg.basePath) {\n outputConfig.basePath = cfg.basePath;\n }\n\n if (cfg.files) {\n outputConfig.files = cfg.files;\n }\n\n if (cfg.ignores) {\n outputConfig.ignores = cfg.ignores;\n }\n\n if (cfg.language) {\n outputConfig.language = cfg.language;\n }\n\n if (cfg.languageOptions) {\n outputConfig.languageOptions = cfg.languageOptions;\n }\n\n if (cfg.linterOptions) {\n outputConfig.linterOptions = cfg.linterOptions;\n }\n\n if (cfg.processor) {\n outputConfig.processor = cfg.processor;\n }\n\n if (cfg.extraRuleDefinitions) {\n if (!outputConfig.plugins?.jsdoc?.rules) {\n throw new Error('JSDoc plugin required for `extraRuleDefinitions`');\n }\n\n if (cfg.extraRuleDefinitions.forbid) {\n for (const [\n contextName,\n {\n contexts,\n description,\n url,\n },\n ] of Object.entries(cfg.extraRuleDefinitions.forbid)) {\n outputConfig.plugins.jsdoc.rules[`forbid-${contextName}`] =\n buildForbidRuleDefinition({\n contextName,\n contexts,\n description,\n url,\n });\n }\n }\n\n if (cfg.extraRuleDefinitions.preferTypes) {\n for (const [\n typeName,\n {\n description,\n overrideSettings,\n url,\n },\n ] of Object.entries(cfg.extraRuleDefinitions.preferTypes)) {\n outputConfig.plugins.jsdoc.rules[`prefer-type-${typeName}`] =\n buildRejectOrPreferRuleDefinition({\n description,\n overrideSettings,\n typeName,\n url,\n });\n }\n }\n }\n }\n\n outputConfig.settings = {\n jsdoc: cfg?.mergeSettings === false ?\n cfg.settings :\n merge(\n {},\n cfg?.settings ?? {},\n cfg?.config?.includes('recommended') ?\n {\n // We may need to drop these for \"typescript\" (non-\"flavor\") configs,\n // if support is later added: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html\n structuredTags: {\n next: {\n required: [\n 'type',\n ],\n },\n rejects: {\n required: [\n 'type',\n ],\n },\n },\n } :\n {},\n ),\n };\n\n return outputConfig;\n};\n\nexport {\n getJsdocProcessorPlugin,\n} from './getJsdocProcessorPlugin.js';\n"],"mappings":";;;;;;;;;;;;;AAEA;AAIA;AAGA;AAGA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAA4B;AArF5B;AACA;;AAsFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,KAAK,GAAG,CAAC,CAAC;AAChB,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;AAClB,KAAK,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AW;YACX;UACF,CAAC,CAAC;QACN;MACF;MAEA,IAAI,GAAG,CAAC,oBAAoB,CAAC,WAAW,EAAE;QACxC,KAAK,MAAM,CACT,QAAQ,EACR;UACE,WAAW;UACX,gBAAgB;UAChB;QACF,CAAC,CACF,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE;UACzD,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,eAAe,QAAQ,EAAE,CAAC,GACzD,IAAAR,mCAAA,iCAAiC,EAAC;YAChC,WAAW;YACX,gBAAgB;YAChB,QAAQ;YACR;UACF,CAAC,CAAC;QACN;MACF;IACF;EACF;EAEA,YAAY,CAAC,QAAQ,GAAG;IACtB,KAAK,EAAE,GAAG,EAAE,aAAa,KAAK,KAAK,GACjC,GAAG,CAAC,QAAQ,GACZ,IAAAuC,iBAAA,KAAK,EACH,CAAC,CAAC,EACF,GAAG,EAAE,QAAQ,IAAI,CAAC,CAAC,EACnB,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,GAClC;MACE;MACA;MACA,cAAc,EAAE;QACd,IAAI,EAAE;UACJ,QAAQ,EAAE,CACR,MAAM;QAEV,CAAC;QACD,OAAO,EAAE;UACP,QAAQ,EAAE,CACR,MAAM;QAEV;MACF;IACF,CAAC,GACD,CAAC,CACL;EACJ,CAAC;EAED,OAAO,YAAY;AACrB,CAAC;AAAC","ignoreList":[]}
|
|
@@ -35,6 +35,29 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
35
35
|
const unescapedInlineTagRegex = /(?:^|\s)@(\w+)/gv;
|
|
36
36
|
const scopedPackageNameRegex = /^@[\w.\-]+\/[\w.\-]+/v;
|
|
37
37
|
const declarationReferenceInlineTags = new Set(['inheritDoc', 'link', 'linkcode', 'linkplain']);
|
|
38
|
+
const markdownCodeSpanRegex = /(?<!\\)(`+)(?!`)[\s\S]*?(?<!`)\1(?!`)/gv;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {string} desc
|
|
42
|
+
* @param {number} index
|
|
43
|
+
* @returns {boolean}
|
|
44
|
+
*/
|
|
45
|
+
const isInsideMarkdownCodeSpan = (desc, index) => {
|
|
46
|
+
markdownCodeSpanRegex.lastIndex = 0;
|
|
47
|
+
let match;
|
|
48
|
+
while ((match = markdownCodeSpanRegex.exec(desc)) !== null) {
|
|
49
|
+
const delimiterLength = match[1].length;
|
|
50
|
+
const contentStart = match.index + delimiterLength;
|
|
51
|
+
const contentEnd = match.index + match[0].length - delimiterLength;
|
|
52
|
+
if (index < contentStart) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
if (index < contentEnd) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
};
|
|
38
61
|
|
|
39
62
|
/**
|
|
40
63
|
* @param {string} desc
|
|
@@ -62,7 +85,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
62
85
|
const shouldIgnoreMatch = (desc, match, offset) => {
|
|
63
86
|
const atSignIndex = offset + match.lastIndexOf('@');
|
|
64
87
|
const inlineTagName = getInlineTagName(desc, atSignIndex);
|
|
65
|
-
return declarationReferenceInlineTags.has(inlineTagName) && scopedPackageNameRegex.test(desc.slice(atSignIndex));
|
|
88
|
+
return isInsideMarkdownCodeSpan(desc, atSignIndex) || declarationReferenceInlineTags.has(inlineTagName) && scopedPackageNameRegex.test(desc.slice(atSignIndex));
|
|
66
89
|
};
|
|
67
90
|
|
|
68
91
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escapeInlineTags.cjs","names":["iterateJsdoc"],"sources":["../../src/rules/escapeInlineTags.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n settings,\n utils,\n}) => {\n const {\n mode,\n } = settings;\n\n if (mode !== 'typescript') {\n return;\n }\n\n const {\n allowedInlineTags = [],\n enableFixer = false,\n fixType = 'backslash',\n } = context.options[0] || {};\n\n const {\n description,\n } = utils.getDescription();\n\n /** @type {string[]} */\n const tagNames = [];\n\n /** @type {number[]} */\n const indexes = [];\n\n const unescapedInlineTagRegex = /(?:^|\\s)@(\\w+)/gv;\n\n const scopedPackageNameRegex = /^@[\\w.\\-]+\\/[\\w.\\-]+/v;\n\n const declarationReferenceInlineTags = new Set([\n 'inheritDoc',\n 'link',\n 'linkcode',\n 'linkplain',\n ]);\n\n /**\n * @param {string} desc\n * @param {number} atSignIndex\n * @returns {string}\n */\n const getInlineTagName = (desc, atSignIndex) => {\n const inlineTagStart = desc.lastIndexOf('{@', atSignIndex);\n\n if (inlineTagStart === -1) {\n return '';\n }\n\n const inlineTagEnd = desc.indexOf('}', inlineTagStart);\n\n if (inlineTagEnd === -1 || inlineTagEnd <= atSignIndex) {\n return '';\n }\n\n return desc.slice(inlineTagStart + 2).match(/^\\w+/v)?.[0] || '';\n };\n\n /**\n * @param {string} desc\n * @param {string} match\n * @param {number} offset\n * @returns {boolean}\n */\n const shouldIgnoreMatch = (desc, match, offset) => {\n const atSignIndex = offset + match.lastIndexOf('@');\n const inlineTagName = getInlineTagName(desc, atSignIndex);\n\n return declarationReferenceInlineTags.has(inlineTagName) &&\n scopedPackageNameRegex.test(desc.slice(atSignIndex));\n };\n\n /**\n * @param {string} tagName\n * @returns {[\n * RegExp,\n * (description: string) => string\n * ]}\n */\n const escapeInlineTags = (tagName) => {\n const regex = new RegExp(`(^|\\\\s)@${\n // No need to escape, as contains only safe characters\n tagName\n }`, 'gv');\n\n return [\n regex,\n /**\n * @param {string} desc\n */\n (desc) => {\n return desc.replaceAll(\n regex,\n (match, prefix, offset) => {\n if (shouldIgnoreMatch(desc, match, offset)) {\n return match;\n }\n\n return fixType === 'backticks' ?\n prefix + '`@' + tagName + '`' :\n prefix + '\\\\@' + tagName;\n },\n );\n },\n ];\n };\n\n /**\n * @param {string} desc\n * @returns {string}\n */\n const getUnescapedInlineTagName = (desc) => {\n unescapedInlineTagRegex.lastIndex = 0;\n\n let match;\n while ((match = unescapedInlineTagRegex.exec(desc)) !== null) {\n const [\n fullMatch,\n tagName,\n ] = match;\n\n if (\n allowedInlineTags.includes(tagName) ||\n shouldIgnoreMatch(desc, fullMatch, match.index)\n ) {\n continue;\n }\n\n return tagName;\n }\n\n return '';\n };\n\n const normalizedDescription = description.startsWith('\\n') ?\n description.slice(1) :\n description;\n\n let nextLineStartOffset = 0;\n for (const [\n idx,\n descLine,\n ] of normalizedDescription.split('\\n').entries()\n ) {\n const lineStartOffset = nextLineStartOffset;\n\n // +1 for the `\\n` removed by split.\n nextLineStartOffset += descLine.length + 1;\n\n descLine.replaceAll(unescapedInlineTagRegex, (match, tagName, offset) => {\n if (\n allowedInlineTags.includes(tagName) ||\n // Run ignore-detection against the full description text so that\n // multi-line inline tags (e.g. `{@link` on one line and\n // `@scope/pkg#Member}` on the next) are recognized as being inside an\n // inline tag rather than scanned per-line.\n shouldIgnoreMatch(\n normalizedDescription,\n match,\n lineStartOffset + offset,\n )\n ) {\n return match;\n }\n\n tagNames.push(tagName);\n indexes.push(idx);\n\n return match;\n });\n }\n\n for (const [\n idx,\n tagName,\n ] of tagNames.entries()) {\n utils.reportJSDoc(\n `Unexpected inline JSDoc tag. Did you mean to use {@${tagName}}, \\\\@${tagName}, or \\`@${tagName}\\`?`,\n {\n line: indexes[idx] + 1,\n },\n enableFixer ?\n () => {\n // `tagName` and `fixType` are constant here, so compute the escaper\n // once rather than rebuilding the RegExp + closure for every line.\n const [\n ,\n escapeInlineTag,\n ] = escapeInlineTags(tagName);\n\n utils.setBlockDescription((info, seedTokens, descLines) => {\n return descLines.map((desc) => {\n const newDesc = escapeInlineTag(desc);\n\n return {\n number: 0,\n source: '',\n tokens: seedTokens({\n ...info,\n description: newDesc,\n postDelimiter: newDesc.trim() ? ' ' : '',\n }),\n };\n });\n });\n } :\n null,\n );\n }\n\n for (const tag of jsdoc.tags) {\n if (tag.tag === 'example') {\n continue;\n }\n\n /** @type {string} */\n let tagName = '';\n while (/** @type {string[]} */ (\n utils.getTagDescription(tag, true)\n // eslint-disable-next-line no-loop-func -- Safe\n ).some((desc) => {\n tagName = getUnescapedInlineTagName(desc);\n\n return tagName;\n })) {\n const line = utils.setTagDescription(tag, ...escapeInlineTags(tagName)) +\n tag.source[0].number;\n utils.reportJSDoc(\n `Unexpected inline JSDoc tag. Did you mean to use {@${tagName}}, \\\\@${tagName}, or \\`@${tagName}\\`?`,\n {\n line,\n },\n enableFixer ? () => {} : null,\n true,\n );\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Reports use of JSDoc tags in non-tag positions (in the default \"typescript\" mode).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/escape-inline-tags.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowedInlineTags: {\n description: 'A listing of tags you wish to allow unescaped. Defaults to an empty array.',\n items: {\n type: 'string',\n },\n type: 'array',\n },\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `false`.',\n type: 'boolean',\n },\n fixType: {\n description: `How to escape the inline tag.\n\nMay be \"backticks\" to enclose tags in backticks (treating as code segments), or\n\"backslash\" to escape tags with a backslash, i.e., \\`\\\\@\\`\n\nDefaults to \"backslash\".`,\n enum: [\n 'backticks',\n 'backslash',\n ],\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA;AAA8C;AAAA,iCAE/B,IAAAA,qBAAY,EAAC,CAAC;EAC3B,OAAO;EACP,KAAK;EACL,QAAQ;EACR;AACF,CAAC,KAAK;EACJ,MAAM;IACJ;EACF,CAAC,GAAG,QAAQ;EAEZ,IAAI,IAAI,KAAK,YAAY,EAAE;IACzB;EACF;EAEA,MAAM;IACJ,iBAAiB,GAAG,EAAE;IACtB,WAAW,GAAG,KAAK;IAC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;AACA;AACA,yBAAyB;UACb,IAAI,EAAE,CACJ,WAAW,EACX,WAAW,CACZ;UACD,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"escapeInlineTags.cjs","names":["iterateJsdoc"],"sources":["../../src/rules/escapeInlineTags.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n context,\n jsdoc,\n settings,\n utils,\n}) => {\n const {\n mode,\n } = settings;\n\n if (mode !== 'typescript') {\n return;\n }\n\n const {\n allowedInlineTags = [],\n enableFixer = false,\n fixType = 'backslash',\n } = context.options[0] || {};\n\n const {\n description,\n } = utils.getDescription();\n\n /** @type {string[]} */\n const tagNames = [];\n\n /** @type {number[]} */\n const indexes = [];\n\n const unescapedInlineTagRegex = /(?:^|\\s)@(\\w+)/gv;\n\n const scopedPackageNameRegex = /^@[\\w.\\-]+\\/[\\w.\\-]+/v;\n\n const declarationReferenceInlineTags = new Set([\n 'inheritDoc',\n 'link',\n 'linkcode',\n 'linkplain',\n ]);\n\n const markdownCodeSpanRegex = /(?<!\\\\)(`+)(?!`)[\\s\\S]*?(?<!`)\\1(?!`)/gv;\n\n /**\n * @param {string} desc\n * @param {number} index\n * @returns {boolean}\n */\n const isInsideMarkdownCodeSpan = (desc, index) => {\n markdownCodeSpanRegex.lastIndex = 0;\n\n let match;\n while ((match = markdownCodeSpanRegex.exec(desc)) !== null) {\n const delimiterLength = match[1].length;\n const contentStart = match.index + delimiterLength;\n const contentEnd = match.index + match[0].length - delimiterLength;\n\n if (index < contentStart) {\n return false;\n }\n\n if (index < contentEnd) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * @param {string} desc\n * @param {number} atSignIndex\n * @returns {string}\n */\n const getInlineTagName = (desc, atSignIndex) => {\n const inlineTagStart = desc.lastIndexOf('{@', atSignIndex);\n\n if (inlineTagStart === -1) {\n return '';\n }\n\n const inlineTagEnd = desc.indexOf('}', inlineTagStart);\n\n if (inlineTagEnd === -1 || inlineTagEnd <= atSignIndex) {\n return '';\n }\n\n return desc.slice(inlineTagStart + 2).match(/^\\w+/v)?.[0] || '';\n };\n\n /**\n * @param {string} desc\n * @param {string} match\n * @param {number} offset\n * @returns {boolean}\n */\n const shouldIgnoreMatch = (desc, match, offset) => {\n const atSignIndex = offset + match.lastIndexOf('@');\n const inlineTagName = getInlineTagName(desc, atSignIndex);\n\n return isInsideMarkdownCodeSpan(desc, atSignIndex) ||\n declarationReferenceInlineTags.has(inlineTagName) &&\n scopedPackageNameRegex.test(desc.slice(atSignIndex));\n };\n\n /**\n * @param {string} tagName\n * @returns {[\n * RegExp,\n * (description: string) => string\n * ]}\n */\n const escapeInlineTags = (tagName) => {\n const regex = new RegExp(`(^|\\\\s)@${\n // No need to escape, as contains only safe characters\n tagName\n }`, 'gv');\n\n return [\n regex,\n /**\n * @param {string} desc\n */\n (desc) => {\n return desc.replaceAll(\n regex,\n (match, prefix, offset) => {\n if (shouldIgnoreMatch(desc, match, offset)) {\n return match;\n }\n\n return fixType === 'backticks' ?\n prefix + '`@' + tagName + '`' :\n prefix + '\\\\@' + tagName;\n },\n );\n },\n ];\n };\n\n /**\n * @param {string} desc\n * @returns {string}\n */\n const getUnescapedInlineTagName = (desc) => {\n unescapedInlineTagRegex.lastIndex = 0;\n\n let match;\n while ((match = unescapedInlineTagRegex.exec(desc)) !== null) {\n const [\n fullMatch,\n tagName,\n ] = match;\n\n if (\n allowedInlineTags.includes(tagName) ||\n shouldIgnoreMatch(desc, fullMatch, match.index)\n ) {\n continue;\n }\n\n return tagName;\n }\n\n return '';\n };\n\n const normalizedDescription = description.startsWith('\\n') ?\n description.slice(1) :\n description;\n\n let nextLineStartOffset = 0;\n for (const [\n idx,\n descLine,\n ] of normalizedDescription.split('\\n').entries()\n ) {\n const lineStartOffset = nextLineStartOffset;\n\n // +1 for the `\\n` removed by split.\n nextLineStartOffset += descLine.length + 1;\n\n descLine.replaceAll(unescapedInlineTagRegex, (match, tagName, offset) => {\n if (\n allowedInlineTags.includes(tagName) ||\n // Run ignore-detection against the full description text so that\n // multi-line inline tags (e.g. `{@link` on one line and\n // `@scope/pkg#Member}` on the next) are recognized as being inside an\n // inline tag rather than scanned per-line.\n shouldIgnoreMatch(\n normalizedDescription,\n match,\n lineStartOffset + offset,\n )\n ) {\n return match;\n }\n\n tagNames.push(tagName);\n indexes.push(idx);\n\n return match;\n });\n }\n\n for (const [\n idx,\n tagName,\n ] of tagNames.entries()) {\n utils.reportJSDoc(\n `Unexpected inline JSDoc tag. Did you mean to use {@${tagName}}, \\\\@${tagName}, or \\`@${tagName}\\`?`,\n {\n line: indexes[idx] + 1,\n },\n enableFixer ?\n () => {\n // `tagName` and `fixType` are constant here, so compute the escaper\n // once rather than rebuilding the RegExp + closure for every line.\n const [\n ,\n escapeInlineTag,\n ] = escapeInlineTags(tagName);\n\n utils.setBlockDescription((info, seedTokens, descLines) => {\n return descLines.map((desc) => {\n const newDesc = escapeInlineTag(desc);\n\n return {\n number: 0,\n source: '',\n tokens: seedTokens({\n ...info,\n description: newDesc,\n postDelimiter: newDesc.trim() ? ' ' : '',\n }),\n };\n });\n });\n } :\n null,\n );\n }\n\n for (const tag of jsdoc.tags) {\n if (tag.tag === 'example') {\n continue;\n }\n\n /** @type {string} */\n let tagName = '';\n while (/** @type {string[]} */ (\n utils.getTagDescription(tag, true)\n // eslint-disable-next-line no-loop-func -- Safe\n ).some((desc) => {\n tagName = getUnescapedInlineTagName(desc);\n\n return tagName;\n })) {\n const line = utils.setTagDescription(tag, ...escapeInlineTags(tagName)) +\n tag.source[0].number;\n utils.reportJSDoc(\n `Unexpected inline JSDoc tag. Did you mean to use {@${tagName}}, \\\\@${tagName}, or \\`@${tagName}\\`?`,\n {\n line,\n },\n enableFixer ? () => {} : null,\n true,\n );\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Reports use of JSDoc tags in non-tag positions (in the default \"typescript\" mode).',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/escape-inline-tags.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n allowedInlineTags: {\n description: 'A listing of tags you wish to allow unescaped. Defaults to an empty array.',\n items: {\n type: 'string',\n },\n type: 'array',\n },\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `false`.',\n type: 'boolean',\n },\n fixType: {\n description: `How to escape the inline tag.\n\nMay be \"backticks\" to enclose tags in backticks (treating as code segments), or\n\"backslash\" to escape tags with a backslash, i.e., \\`\\\\@\\`\n\nDefaults to \"backslash\".`,\n enum: [\n 'backticks',\n 'backslash',\n ],\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA;AAA8C;AAAA,iCAE/B,IAAAA,qBAAY,EAAC,CAAC;EAC3B,OAAO;EACP,KAAK;EACL,QAAQ;EACR;AACF,CAAC,KAAK;EACJ,MAAM;IACJ;EACF,CAAC,GAAG,QAAQ;EAEZ,IAAI,IAAI,KAAK,YAAY,EAAE;IACzB;EACF;EAEA,MAAM;IACJ,iBAAiB,GAAG,EAAE;IACtB,WAAW,GAAG,KAAK;IACnB,OAAO,GAAG;EACZ,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAM;IACJ;EACF,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;;EAE1B;EACA,MAAM,QAAQ,GAAG,EAAE;;EAEnB;EACA,MAAM,OAAO,GAAG,EAAE;EAElB,MAAM,uBAAuB,GAAG,kBAAkB;EAElD,MAAM,sBAAsB,GAAG,uBAAuB;EAEtD,MAAM,8BAA8B,GAAG,IAAI,GAAG,CAAC,CAC7C,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,CACZ,CAAC;EAEF,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K;MAC3B,UAAU,EAAE;QACV,iBAAiB,EAAE;UACjB,WAAW,EAAE,4EAA4E;UACzF,KAAK,EAAE;YACL,IAAI,EAAE;UACR,CAAC;UACD,IAAI,EAAE;QACR,CAAC;QACD,WAAW,EAAE;UACX,WAAW,EAAE,mDAAmD;UAChE,IAAI,EAAE;QACR,CAAC;QACD,OAAO,EAAE;UACP,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA,yBAAyB;UACb,IAAI,EAAE,CACJ,WAAW,EACX,WAAW,CACZ;UACD,IAAI,EAAE;QACR;MACF,CAAC;MACD,IAAI,EAAE;IACR,CAAC,CACF;IACD,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _iterateJsdoc = _interopRequireDefault(require("../iterateJsdoc.cjs"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const markdownLinkRegex = /(?<!\\)\[([^`\]\r\n]+)\]\(([^`\(\)\s]+)\)/gv;
|
|
10
|
+
const prefixLinkRegex = /(?<!\\)\[([^\]\r\n]+)\]\{@link\s+([^\}\s\|]+)\}/gv;
|
|
11
|
+
const pipeLinkRegex = /\{@link\s+([^\}\s\|]+)\s*\|\s*([^\}\r\n]+)\}/gv;
|
|
12
|
+
const markdownLinkAttemptRegex = /(?<!\\)\[[^\]\r\n]*\]\([^\r\n]*(?:\)|$)/v;
|
|
13
|
+
const prefixLinkAttemptRegex = /(?<!\\)\[[^\]\r\n]*\]\{@link[^\}\r\n]*(?:\}|$)/v;
|
|
14
|
+
const pipeLinkAttemptRegex = /\{@link[^\}\r\n]*\|[^\}\r\n]*(?:\}|$)/v;
|
|
15
|
+
const scopedPackageNameRegex = /^@[\w.\-]+\/[\w.\-]+/v;
|
|
16
|
+
const markdownCodeSpanRegex = /(?<!\\)(`+)(?!`)[\s\S]*?(?<!`)\1(?!`)/gv;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param {'pipe'|'prefix'} canonicalForm
|
|
20
|
+
* @param {string} label
|
|
21
|
+
* @returns {boolean}
|
|
22
|
+
*/
|
|
23
|
+
const cannotSafelyFormatLink = (canonicalForm, label) => {
|
|
24
|
+
if (!label.trim()) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
if (canonicalForm === 'pipe') {
|
|
28
|
+
return label.includes('}');
|
|
29
|
+
}
|
|
30
|
+
return label.includes(']');
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {string} target
|
|
35
|
+
* @returns {string}
|
|
36
|
+
*/
|
|
37
|
+
const encodeLinkTarget = target => {
|
|
38
|
+
return encodeURI(target).replaceAll(/%25(?=[\dA-F]{2})/giv, '%');
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {string} description
|
|
43
|
+
* @param {number} index
|
|
44
|
+
* @returns {boolean}
|
|
45
|
+
*/
|
|
46
|
+
const isInsideMarkdownCodeSpan = (description, index) => {
|
|
47
|
+
for (const match of description.matchAll(markdownCodeSpanRegex)) {
|
|
48
|
+
const delimiterLength = match[1].length;
|
|
49
|
+
const contentStart = match.index + delimiterLength;
|
|
50
|
+
const contentEnd = match.index + match[0].length - delimiterLength;
|
|
51
|
+
if (index >= contentStart && index < contentEnd) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @param {'pipe'|'prefix'} canonicalForm
|
|
60
|
+
* @param {string} label
|
|
61
|
+
* @param {string} target
|
|
62
|
+
* @returns {string}
|
|
63
|
+
*/
|
|
64
|
+
const formatLink = (canonicalForm, label, target) => {
|
|
65
|
+
const encodedTarget = encodeLinkTarget(target);
|
|
66
|
+
return canonicalForm === 'pipe' ? `{@link ${encodedTarget}|${label.trim()}}` : `[${label.trim()}]{@link ${encodedTarget}}`;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param {string} description
|
|
71
|
+
* @param {'pipe'|'prefix'} canonicalForm
|
|
72
|
+
* @returns {string}
|
|
73
|
+
*/
|
|
74
|
+
const normalizeDescription = (description, canonicalForm) => {
|
|
75
|
+
const markdownNormalized = description.replaceAll(new RegExp(markdownLinkRegex, 'gv'), (_match, label, target) => {
|
|
76
|
+
return formatLink(canonicalForm, label, target);
|
|
77
|
+
});
|
|
78
|
+
if (canonicalForm === 'pipe') {
|
|
79
|
+
return markdownNormalized.replaceAll(new RegExp(prefixLinkRegex, 'gv'), (_match, label, target) => {
|
|
80
|
+
return formatLink(canonicalForm, label, target);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return markdownNormalized.replaceAll(new RegExp(pipeLinkRegex, 'gv'), (_match, target, label) => {
|
|
84
|
+
return formatLink(canonicalForm, label, target);
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
88
|
+
context,
|
|
89
|
+
jsdoc,
|
|
90
|
+
utils
|
|
91
|
+
}) => {
|
|
92
|
+
const {
|
|
93
|
+
canonicalForm = 'pipe',
|
|
94
|
+
enableFixer = true
|
|
95
|
+
} = context.options[0] || {};
|
|
96
|
+
const descriptionMatcher = canonicalForm === 'pipe' ? new RegExp(`${markdownLinkRegex.source}|${prefixLinkRegex.source}`, 'v') : new RegExp(`${markdownLinkRegex.source}|${pipeLinkRegex.source}`, 'v');
|
|
97
|
+
|
|
98
|
+
/** @type {import('comment-parser').Spec[]} */
|
|
99
|
+
const fixableTags = [];
|
|
100
|
+
for (const tag of jsdoc.tags) {
|
|
101
|
+
if (tag.tag !== 'see') {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
const firstTokens = tag.source[0].tokens;
|
|
105
|
+
const tagDescription = String(utils.getTagDescription(tag));
|
|
106
|
+
const rawDescription = firstTokens.name ? firstTokens.name + firstTokens.postName + tagDescription : tagDescription;
|
|
107
|
+
let hasAmbiguousLink = false;
|
|
108
|
+
let hasNoncanonicalLink = false;
|
|
109
|
+
for (const match of rawDescription.matchAll(markdownLinkRegex)) {
|
|
110
|
+
const label = match[1];
|
|
111
|
+
const target = match[2];
|
|
112
|
+
if (isInsideMarkdownCodeSpan(rawDescription, match.index) || scopedPackageNameRegex.test(target) || cannotSafelyFormatLink(canonicalForm, label)) {
|
|
113
|
+
hasAmbiguousLink = true;
|
|
114
|
+
} else {
|
|
115
|
+
hasNoncanonicalLink = true;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
for (const inlineTag of tag.inlineTags) {
|
|
119
|
+
if (inlineTag.tag !== 'link' || !inlineTag.text) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (inlineTag.format === 'space') {
|
|
123
|
+
hasAmbiguousLink = true;
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (cannotSafelyFormatLink(canonicalForm, inlineTag.text)) {
|
|
127
|
+
hasAmbiguousLink = true;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (inlineTag.format === canonicalForm) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
const {
|
|
134
|
+
start
|
|
135
|
+
} = /** @type {typeof inlineTag & {start: number}} */inlineTag;
|
|
136
|
+
if (isInsideMarkdownCodeSpan(rawDescription, start) || scopedPackageNameRegex.test(inlineTag.namepathOrURL)) {
|
|
137
|
+
hasAmbiguousLink = true;
|
|
138
|
+
} else {
|
|
139
|
+
hasNoncanonicalLink = true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const unrecognizedLinkText = rawDescription.replaceAll(new RegExp(markdownLinkRegex, 'gv'), '').replaceAll(new RegExp(prefixLinkRegex, 'gv'), '').replaceAll(new RegExp(pipeLinkRegex, 'gv'), '');
|
|
143
|
+
hasAmbiguousLink ||= markdownLinkAttemptRegex.test(unrecognizedLinkText) || prefixLinkAttemptRegex.test(unrecognizedLinkText) || pipeLinkAttemptRegex.test(unrecognizedLinkText);
|
|
144
|
+
if (hasAmbiguousLink) {
|
|
145
|
+
utils.reportJSDoc('@see link cannot be safely normalized.', {
|
|
146
|
+
line: tag.source[0].number
|
|
147
|
+
}, null);
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (!hasNoncanonicalLink) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
fixableTags.push(tag);
|
|
154
|
+
}
|
|
155
|
+
for (const [reportIdx, tag] of fixableTags.entries()) {
|
|
156
|
+
utils.reportJSDoc(`Expected @see link to use the ${canonicalForm} form.`, {
|
|
157
|
+
line: tag.source[0].number
|
|
158
|
+
}, enableFixer && reportIdx === 0 ? () => {
|
|
159
|
+
for (const fixableTag of fixableTags) {
|
|
160
|
+
const firstTokens = fixableTag.source[0].tokens;
|
|
161
|
+
if (firstTokens.name) {
|
|
162
|
+
firstTokens.description = firstTokens.name + firstTokens.postName + firstTokens.description;
|
|
163
|
+
firstTokens.name = '';
|
|
164
|
+
firstTokens.postName = '';
|
|
165
|
+
}
|
|
166
|
+
for (let sourceIdx = 0; sourceIdx < fixableTag.source.length; sourceIdx++) {
|
|
167
|
+
if (!descriptionMatcher.test(fixableTag.source[sourceIdx].tokens.description)) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
utils.setTagDescription(fixableTag, descriptionMatcher, description => {
|
|
171
|
+
return normalizeDescription(description, canonicalForm);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
} : null, true);
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
iterateAllJsdocs: true,
|
|
179
|
+
meta: {
|
|
180
|
+
docs: {
|
|
181
|
+
description: 'Normalizes labeled links in `@see` tags to a canonical `{@link}` form.',
|
|
182
|
+
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/normalize-see-links.md#repos-sticky-header'
|
|
183
|
+
},
|
|
184
|
+
fixable: 'code',
|
|
185
|
+
schema: [{
|
|
186
|
+
additionalProperties: false,
|
|
187
|
+
properties: {
|
|
188
|
+
canonicalForm: {
|
|
189
|
+
description: 'The canonical `{@link}` form: `"pipe"` produces `{@link url|label}`, while `"prefix"` produces `[label]{@link url}`. Defaults to `"pipe"`.',
|
|
190
|
+
enum: ['pipe', 'prefix'],
|
|
191
|
+
type: 'string'
|
|
192
|
+
},
|
|
193
|
+
enableFixer: {
|
|
194
|
+
description: 'Whether to enable the fixer. Defaults to `true`.',
|
|
195
|
+
type: 'boolean'
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
type: 'object'
|
|
199
|
+
}],
|
|
200
|
+
type: 'suggestion'
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
module.exports = exports.default;
|
|
204
|
+
//# sourceMappingURL=normalizeSeeLinks.cjs.map
|