eslint-plugin-jsdoc 63.3.3 → 64.0.1
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/dist/index.d.ts +14 -0
- package/package.json +23 -48
- package/src/index.js +22 -6
- package/dist/WarnSettings.cjs +0 -38
- package/dist/WarnSettings.cjs.map +0 -1
- package/dist/alignTransform.cjs +0 -402
- package/dist/alignTransform.cjs.map +0 -1
- package/dist/buildForbidRuleDefinition.cjs +0 -101
- package/dist/buildForbidRuleDefinition.cjs.map +0 -1
- package/dist/buildRejectOrPreferRuleDefinition.cjs +0 -352
- package/dist/buildRejectOrPreferRuleDefinition.cjs.map +0 -1
- package/dist/cjs/WarnSettings.d.ts +0 -16
- package/dist/cjs/alignTransform.d.ts +0 -33
- package/dist/cjs/buildForbidRuleDefinition.d.ts +0 -14
- package/dist/cjs/buildRejectOrPreferRuleDefinition.d.ts +0 -8
- package/dist/cjs/defaultTagOrder.d.ts +0 -4
- package/dist/cjs/exportParser.d.ts +0 -40
- package/dist/cjs/getDefaultTagStructureForMode.d.ts +0 -10
- package/dist/cjs/getJsdocProcessorPlugin.d.cts +0 -5
- package/dist/cjs/getJsdocProcessorPlugin.d.ts +0 -66
- package/dist/cjs/index-cjs.d.ts +0 -26
- package/dist/cjs/index.cjs.d.cts +0 -2
- package/dist/cjs/iterateJsdoc.d.cts +0 -7
- package/dist/cjs/iterateJsdoc.d.ts +0 -495
- package/dist/cjs/jsdocUtils.d.ts +0 -500
- package/dist/cjs/rules/checkAccess.d.ts +0 -2
- package/dist/cjs/rules/checkAlignment.d.ts +0 -2
- package/dist/cjs/rules/checkExamples.d.ts +0 -3
- package/dist/cjs/rules/checkIndentation.d.ts +0 -2
- package/dist/cjs/rules/checkLineAlignment.d.ts +0 -9
- package/dist/cjs/rules/checkParamNames.d.ts +0 -2
- package/dist/cjs/rules/checkPropertyNames.d.ts +0 -2
- package/dist/cjs/rules/checkSyntax.d.ts +0 -2
- package/dist/cjs/rules/checkTagNames.d.ts +0 -2
- package/dist/cjs/rules/checkTemplateNames.d.ts +0 -2
- package/dist/cjs/rules/checkTypes.d.ts +0 -7
- package/dist/cjs/rules/checkValues.d.ts +0 -2
- package/dist/cjs/rules/convertToJsdocComments.d.ts +0 -266
- package/dist/cjs/rules/emptyTags.d.ts +0 -2
- package/dist/cjs/rules/escapeInlineTags.d.ts +0 -2
- package/dist/cjs/rules/implementsOnClasses.d.ts +0 -2
- package/dist/cjs/rules/importsAsDependencies.d.ts +0 -2
- package/dist/cjs/rules/informativeDocs.d.ts +0 -2
- package/dist/cjs/rules/linesBeforeBlock.d.ts +0 -2
- package/dist/cjs/rules/matchDescription.d.ts +0 -2
- package/dist/cjs/rules/matchName.d.ts +0 -2
- package/dist/cjs/rules/multilineBlocks.d.ts +0 -2
- package/dist/cjs/rules/noBadBlocks.d.ts +0 -2
- package/dist/cjs/rules/noBlankBlockDescriptions.d.ts +0 -2
- package/dist/cjs/rules/noBlankBlocks.d.ts +0 -2
- package/dist/cjs/rules/noDefaults.d.ts +0 -2
- package/dist/cjs/rules/noMissingSyntax.d.ts +0 -9
- package/dist/cjs/rules/noMultiAsterisks.d.ts +0 -2
- package/dist/cjs/rules/noRestrictedSyntax.d.ts +0 -2
- package/dist/cjs/rules/noTypes.d.ts +0 -2
- package/dist/cjs/rules/noUndefinedTypes.d.ts +0 -2
- package/dist/cjs/rules/normalizeSeeLinks.d.ts +0 -2
- package/dist/cjs/rules/preferImportTag.d.ts +0 -2
- package/dist/cjs/rules/requireAsteriskPrefix.d.ts +0 -2
- package/dist/cjs/rules/requireDescription.d.ts +0 -2
- package/dist/cjs/rules/requireDescriptionCompleteSentence.d.ts +0 -2
- package/dist/cjs/rules/requireExample.d.ts +0 -2
- package/dist/cjs/rules/requireFileOverview.d.ts +0 -2
- package/dist/cjs/rules/requireHyphenBeforeParamDescription.d.ts +0 -2
- package/dist/cjs/rules/requireJsdoc.d.ts +0 -24
- package/dist/cjs/rules/requireParam.d.ts +0 -3
- package/dist/cjs/rules/requireParamDescription.d.ts +0 -2
- package/dist/cjs/rules/requireParamName.d.ts +0 -2
- package/dist/cjs/rules/requireParamType.d.ts +0 -2
- package/dist/cjs/rules/requireProperty.d.ts +0 -2
- package/dist/cjs/rules/requirePropertyDescription.d.ts +0 -2
- package/dist/cjs/rules/requirePropertyName.d.ts +0 -2
- package/dist/cjs/rules/requirePropertyType.d.ts +0 -2
- package/dist/cjs/rules/requireRejects.d.ts +0 -2
- package/dist/cjs/rules/requireReturns.d.ts +0 -2
- package/dist/cjs/rules/requireReturnsCheck.d.ts +0 -2
- package/dist/cjs/rules/requireReturnsDescription.d.ts +0 -2
- package/dist/cjs/rules/requireReturnsType.d.ts +0 -2
- package/dist/cjs/rules/requireTags.d.ts +0 -2
- package/dist/cjs/rules/requireTemplate.d.ts +0 -2
- package/dist/cjs/rules/requireThrows.d.ts +0 -2
- package/dist/cjs/rules/requireYields.d.ts +0 -2
- package/dist/cjs/rules/requireYieldsCheck.d.ts +0 -2
- package/dist/cjs/rules/sortTags.d.ts +0 -2
- package/dist/cjs/rules/tagLines.d.ts +0 -2
- package/dist/cjs/rules/textEscaping.d.ts +0 -2
- package/dist/cjs/rules/tsMethodSignatureStyle.d.ts +0 -2
- package/dist/cjs/rules/tsNoEmptyObjectType.d.ts +0 -2
- package/dist/cjs/rules/tsNoUnnecessaryTemplateExpression.d.ts +0 -2
- package/dist/cjs/rules/tsPreferFunctionType.d.ts +0 -2
- package/dist/cjs/rules/typeFormatting.d.ts +0 -2
- package/dist/cjs/rules/validTypes.d.ts +0 -2
- package/dist/cjs/tagNames.d.ts +0 -15
- package/dist/cjs/utils/hasReturnValue.d.ts +0 -19
- package/dist/defaultTagOrder.cjs +0 -46
- package/dist/defaultTagOrder.cjs.map +0 -1
- package/dist/exportParser.cjs +0 -732
- package/dist/exportParser.cjs.map +0 -1
- package/dist/generateDocs.cjs +0 -342
- package/dist/generateDocs.cjs.map +0 -1
- package/dist/generateOptions.cjs +0 -62
- package/dist/generateOptions.cjs.map +0 -1
- package/dist/generateRule.cjs +0 -248
- package/dist/generateRule.cjs.map +0 -1
- package/dist/generateRuleTypes.cjs +0 -24
- package/dist/generateRuleTypes.cjs.map +0 -1
- package/dist/getDefaultTagStructureForMode.cjs +0 -289
- package/dist/getDefaultTagStructureForMode.cjs.map +0 -1
- package/dist/getJsdocProcessorPlugin.cjs +0 -587
- package/dist/getJsdocProcessorPlugin.cjs.map +0 -1
- package/dist/getJsdocProcessorPlugin.cts +0 -5
- package/dist/index-cjs.cjs +0 -600
- package/dist/index-cjs.cjs.map +0 -1
- package/dist/index-cjs.d.ts +0 -27
- package/dist/index-esm.cjs +0 -162
- package/dist/index-esm.cjs.map +0 -1
- package/dist/index-esm.d.ts +0 -72
- package/dist/index.cjs +0 -748
- package/dist/index.cjs.cts +0 -3
- package/dist/index.cjs.map +0 -1
- package/dist/iterateJsdoc.cjs +0 -2150
- package/dist/iterateJsdoc.cjs.map +0 -1
- package/dist/iterateJsdoc.cts +0 -7
- package/dist/jsdocUtils.cjs +0 -1786
- package/dist/jsdocUtils.cjs.map +0 -1
- package/dist/rules/checkAccess.cjs +0 -40
- package/dist/rules/checkAccess.cjs.map +0 -1
- package/dist/rules/checkAlignment.cjs +0 -78
- package/dist/rules/checkAlignment.cjs.map +0 -1
- package/dist/rules/checkExamples.cjs +0 -521
- package/dist/rules/checkExamples.cjs.map +0 -1
- package/dist/rules/checkIndentation.cjs +0 -170
- package/dist/rules/checkIndentation.cjs.map +0 -1
- package/dist/rules/checkLineAlignment.cjs +0 -398
- package/dist/rules/checkLineAlignment.cjs.map +0 -1
- package/dist/rules/checkParamNames.cjs +0 -407
- package/dist/rules/checkParamNames.cjs.map +0 -1
- package/dist/rules/checkPropertyNames.cjs +0 -135
- package/dist/rules/checkPropertyNames.cjs.map +0 -1
- package/dist/rules/checkSyntax.cjs +0 -38
- package/dist/rules/checkSyntax.cjs.map +0 -1
- package/dist/rules/checkTagNames.cjs +0 -312
- package/dist/rules/checkTagNames.cjs.map +0 -1
- package/dist/rules/checkTemplateNames.cjs +0 -192
- package/dist/rules/checkTemplateNames.cjs.map +0 -1
- package/dist/rules/checkTypes.cjs +0 -111
- package/dist/rules/checkTypes.cjs.map +0 -1
- package/dist/rules/checkValues.cjs +0 -166
- package/dist/rules/checkValues.cjs.map +0 -1
- package/dist/rules/convertToJsdocComments.cjs +0 -356
- package/dist/rules/convertToJsdocComments.cjs.map +0 -1
- package/dist/rules/emptyTags.cjs +0 -98
- package/dist/rules/emptyTags.cjs.map +0 -1
- package/dist/rules/escapeInlineTags.cjs +0 -234
- package/dist/rules/escapeInlineTags.cjs.map +0 -1
- package/dist/rules/implementsOnClasses.cjs +0 -74
- package/dist/rules/implementsOnClasses.cjs.map +0 -1
- package/dist/rules/importsAsDependencies.cjs +0 -104
- package/dist/rules/importsAsDependencies.cjs.map +0 -1
- package/dist/rules/informativeDocs.cjs +0 -187
- package/dist/rules/informativeDocs.cjs.map +0 -1
- package/dist/rules/linesBeforeBlock.cjs +0 -120
- package/dist/rules/linesBeforeBlock.cjs.map +0 -1
- package/dist/rules/matchDescription.cjs +0 -356
- package/dist/rules/matchDescription.cjs.map +0 -1
- package/dist/rules/matchName.cjs +0 -160
- package/dist/rules/matchName.cjs.map +0 -1
- package/dist/rules/multilineBlocks.cjs +0 -431
- package/dist/rules/multilineBlocks.cjs.map +0 -1
- package/dist/rules/noBadBlocks.cjs +0 -100
- package/dist/rules/noBadBlocks.cjs.map +0 -1
- package/dist/rules/noBlankBlockDescriptions.cjs +0 -63
- package/dist/rules/noBlankBlockDescriptions.cjs.map +0 -1
- package/dist/rules/noBlankBlocks.cjs +0 -54
- package/dist/rules/noBlankBlocks.cjs.map +0 -1
- package/dist/rules/noDefaults.cjs +0 -102
- package/dist/rules/noDefaults.cjs.map +0 -1
- package/dist/rules/noMissingSyntax.cjs +0 -196
- package/dist/rules/noMissingSyntax.cjs.map +0 -1
- package/dist/rules/noMultiAsterisks.cjs +0 -126
- package/dist/rules/noMultiAsterisks.cjs.map +0 -1
- package/dist/rules/noRestrictedSyntax.cjs +0 -68
- package/dist/rules/noRestrictedSyntax.cjs.map +0 -1
- package/dist/rules/noTypes.cjs +0 -101
- package/dist/rules/noTypes.cjs.map +0 -1
- package/dist/rules/noUndefinedTypes.cjs +0 -616
- package/dist/rules/noUndefinedTypes.cjs.map +0 -1
- package/dist/rules/normalizeSeeLinks.cjs +0 -271
- package/dist/rules/normalizeSeeLinks.cjs.map +0 -1
- package/dist/rules/preferImportTag.cjs +0 -362
- package/dist/rules/preferImportTag.cjs.map +0 -1
- package/dist/rules/requireAsteriskPrefix.cjs +0 -190
- package/dist/rules/requireAsteriskPrefix.cjs.map +0 -1
- package/dist/rules/requireDescription.cjs +0 -164
- package/dist/rules/requireDescription.cjs.map +0 -1
- package/dist/rules/requireDescriptionCompleteSentence.cjs +0 -321
- package/dist/rules/requireDescriptionCompleteSentence.cjs.map +0 -1
- package/dist/rules/requireExample.cjs +0 -136
- package/dist/rules/requireExample.cjs.map +0 -1
- package/dist/rules/requireFileOverview.cjs +0 -194
- package/dist/rules/requireFileOverview.cjs.map +0 -1
- package/dist/rules/requireHyphenBeforeParamDescription.cjs +0 -166
- package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +0 -1
- package/dist/rules/requireJsdoc.cjs +0 -721
- package/dist/rules/requireJsdoc.cjs.map +0 -1
- package/dist/rules/requireParam.cjs +0 -772
- package/dist/rules/requireParam.cjs.map +0 -1
- package/dist/rules/requireParamDescription.cjs +0 -105
- package/dist/rules/requireParamDescription.cjs.map +0 -1
- package/dist/rules/requireParamName.cjs +0 -68
- package/dist/rules/requireParamName.cjs.map +0 -1
- package/dist/rules/requireParamType.cjs +0 -104
- package/dist/rules/requireParamType.cjs.map +0 -1
- package/dist/rules/requireProperty.cjs +0 -63
- package/dist/rules/requireProperty.cjs.map +0 -1
- package/dist/rules/requirePropertyDescription.cjs +0 -29
- package/dist/rules/requirePropertyDescription.cjs.map +0 -1
- package/dist/rules/requirePropertyName.cjs +0 -29
- package/dist/rules/requirePropertyName.cjs.map +0 -1
- package/dist/rules/requirePropertyType.cjs +0 -29
- package/dist/rules/requirePropertyType.cjs.map +0 -1
- package/dist/rules/requireRejects.cjs +0 -226
- package/dist/rules/requireRejects.cjs.map +0 -1
- package/dist/rules/requireReturns.cjs +0 -262
- package/dist/rules/requireReturns.cjs.map +0 -1
- package/dist/rules/requireReturnsCheck.cjs +0 -225
- package/dist/rules/requireReturnsCheck.cjs.map +0 -1
- package/dist/rules/requireReturnsDescription.cjs +0 -72
- package/dist/rules/requireReturnsDescription.cjs.map +0 -1
- package/dist/rules/requireReturnsType.cjs +0 -68
- package/dist/rules/requireReturnsType.cjs.map +0 -1
- package/dist/rules/requireTags.cjs +0 -74
- package/dist/rules/requireTags.cjs.map +0 -1
- package/dist/rules/requireTemplate.cjs +0 -220
- package/dist/rules/requireTemplate.cjs.map +0 -1
- package/dist/rules/requireThrows.cjs +0 -118
- package/dist/rules/requireThrows.cjs.map +0 -1
- package/dist/rules/requireYields.cjs +0 -224
- package/dist/rules/requireYields.cjs.map +0 -1
- package/dist/rules/requireYieldsCheck.cjs +0 -179
- package/dist/rules/requireYieldsCheck.cjs.map +0 -1
- package/dist/rules/sortTags.cjs +0 -656
- package/dist/rules/sortTags.cjs.map +0 -1
- package/dist/rules/tagLines.cjs +0 -374
- package/dist/rules/tagLines.cjs.map +0 -1
- package/dist/rules/textEscaping.cjs +0 -141
- package/dist/rules/textEscaping.cjs.map +0 -1
- package/dist/rules/tsMethodSignatureStyle.cjs +0 -240
- package/dist/rules/tsMethodSignatureStyle.cjs.map +0 -1
- package/dist/rules/tsNoEmptyObjectType.cjs +0 -62
- package/dist/rules/tsNoEmptyObjectType.cjs.map +0 -1
- package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs +0 -104
- package/dist/rules/tsNoUnnecessaryTemplateExpression.cjs.map +0 -1
- package/dist/rules/tsPreferFunctionType.cjs +0 -110
- package/dist/rules/tsPreferFunctionType.cjs.map +0 -1
- package/dist/rules/typeFormatting.cjs +0 -607
- package/dist/rules/typeFormatting.cjs.map +0 -1
- package/dist/rules/validTypes.cjs +0 -324
- package/dist/rules/validTypes.cjs.map +0 -1
- package/dist/tagNames.cjs +0 -244
- package/dist/tagNames.cjs.map +0 -1
- package/dist/to-valid-identifier.cjs +0 -263
- package/dist/utils/hasReturnValue.cjs +0 -495
- package/dist/utils/hasReturnValue.cjs.map +0 -1
- package/rollup.config.js +0 -16
- package/src/getJsdocProcessorPlugin.cts +0 -5
- package/src/index-cjs.js +0 -760
- package/src/index-esm.js +0 -196
- package/src/index.cjs.cts +0 -3
- package/src/iterateJsdoc.cts +0 -7
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultTagStructureForMode.cjs","names":[],"sources":["../src/getDefaultTagStructureForMode.js"],"sourcesContent":["/**\n * @typedef {Map<string, Map<string, (string|boolean)>>} TagStructure\n */\n/**\n * @param {import('./jsdocUtils.js').ParserMode} mode\n * @returns {TagStructure}\n */\nconst getDefaultTagStructureForMode = (mode) => {\n const isJsdoc = mode === 'jsdoc';\n const isClosure = mode === 'closure';\n const isTypescript = mode === 'typescript';\n const isPermissive = mode === 'permissive';\n\n const isJsdocOrPermissive = isJsdoc || isPermissive;\n const isJsdocOrTypescript = isJsdoc || isTypescript;\n const isTypescriptOrClosure = isTypescript || isClosure;\n const isClosureOrPermissive = isClosure || isPermissive;\n const isJsdocTypescriptOrPermissive = isJsdocOrTypescript || isPermissive;\n\n // Properties:\n // `namepathRole` - 'namepath-referencing'|'name-defining'|'namepath-defining'|'namepath-or-url-referencing'|'text'|false\n // `typeAllowed` - boolean\n // `nameRequired` - boolean\n // `typeRequired` - boolean\n // `typeOrNameRequired` - boolean\n\n // All of `typeAllowed` have a signature with \"type\" except for\n // `augments`/`extends` (\"namepath\")\n // `param`/`arg`/`argument` (no signature)\n // `property`/`prop` (no signature)\n // `modifies` (undocumented)\n\n // None of the `namepathRole: 'namepath-defining'` show as having curly\n // brackets for their name/namepath\n\n // Among `namepath-defining` and `namepath-referencing`, these do not seem\n // to allow curly brackets in their doc signature or examples (`modifies`\n // references namepaths within its type brackets)\n\n // Todo: Should support a `tutorialID` type (for `@tutorial` block and\n // inline)\n\n /**\n * @type {TagStructure}\n */\n return new Map([\n [\n 'alias', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'arg', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'argument', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `param`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'augments', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'borrows', new Map(/** @type {[string, string|boolean][]} */ ([\n // `borrows` has a different format, however, so needs special parsing;\n // seems to require both, and as \"namepath\"'s\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'callback', new Map(/** @type {[string, string|boolean][]} */ ([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples); TypeScript does not enforce but seems\n // problematic as not attached so presumably not useable without it\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n ])),\n ],\n\n [\n 'class', new Map(/** @type {[string, string|boolean][]} */ ([\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', true,\n ],\n\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'const', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'constant', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'constructor', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'constructs', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'define', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'typeRequired', isClosure,\n ],\n ])),\n ],\n\n [\n 'emits', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"name\" (of an event) and no counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'enum', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'name-defining',\n ],\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'event', new Map(/** @type {[string, string|boolean][]} */ ([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // The doc signature of `event` seems to require a \"name\"\n [\n 'nameRequired', true,\n ],\n ])),\n ],\n\n [\n 'exception', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n // Closure\n [\n 'export', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'exports', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'extends', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', isJsdoc,\n ],\n\n // Does not show curly brackets in either the signature or examples\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', isTypescriptOrClosure || isPermissive,\n ],\n ])),\n ],\n\n [\n 'external', new Map(/** @type {[string, string|boolean][]} */ ([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"name\" (and a special syntax for the `external` name)\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'fires', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'func', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n ])),\n ],\n [\n 'function', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'host', new Map(/** @type {[string, string|boolean][]} */ ([\n // Appears to require a \"name\" in its signature, albeit somewhat\n // different from other \"name\"'s (including as described\n // at https://jsdoc.app/about-namepaths.html )\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `external`\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'implements', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the doc signature and examples\n // \"typeExpression\"\n [\n 'typeRequired', true,\n ],\n ])),\n ],\n\n [\n 'interface', new Map(/** @type {[string, string|boolean][]} */ ([\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', isClosure,\n ],\n\n // Allows for \"name\" in signature, but indicates as optional\n [\n 'namepathRole',\n isJsdocTypescriptOrPermissive ? 'namepath-defining' : false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'internal', new Map(/** @type {[string, string|boolean][]} */ ([\n // Not in use, but should be this value if using to power `empty-tags`\n [\n 'nameAllowed', false,\n ],\n // https://www.typescriptlang.org/tsconfig/#stripInternal\n [\n 'namepathRole', false,\n ],\n ])),\n ],\n\n [\n 'lends', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'link', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a namepath OR URL and might be checked as such.\n [\n 'namepathRole', 'namepath-or-url-referencing',\n ],\n\n ])),\n ],\n\n [\n 'linkcode', new Map(/** @type {[string, string|boolean][]} */ ([\n // Synonym for \"link\"\n // Signature seems to require a namepath OR URL and might be checked as such.\n [\n 'namepathRole', 'namepath-or-url-referencing',\n ],\n ])),\n ],\n\n [\n 'linkplain', new Map(/** @type {[string, string|boolean][]} */ ([\n // Synonym for \"link\"\n // Signature seems to require a namepath OR URL and might be checked as such.\n [\n 'namepathRole', 'namepath-or-url-referencing',\n ],\n ])),\n ],\n\n [\n 'listens', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"name\" (of an event) and no\n // counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'member', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'memberof!', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n [\n 'memberof', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples),\n // though it allows an incomplete namepath ending with connecting symbol\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'method', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n ])),\n ],\n [\n 'mixes', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"OtherObjectPath\" with no\n // counter-examples\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n // \"OtherObjectPath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'mixin', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n [\n 'nameRequired', false,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'modifies', new Map(/** @type {[string, string|boolean][]} */ ([\n // Has no documentation, but test example has curly brackets, and\n // \"name\" would be suggested rather than \"namepath\" based on example;\n // not sure if name is required\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'module', new Map(/** @type {[string, string|boolean][]} */ ([\n // Optional \"name\" and no curly brackets\n // this block impacts `no-undefined-types` and `valid-types` (search for\n // \"isNameOrNamepathDefiningTag|tagMightHaveNameOrNamepath|tagMightHaveEitherTypeOrNamePosition\")\n [\n 'namepathRole', isJsdoc ? 'namepath-defining' : 'text',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'name', new Map(/** @type {[string, string|boolean][]} */ ([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // \"namepath\"\n [\n 'nameRequired', true,\n ],\n\n // \"namepath\"\n [\n 'typeOrNameRequired', true,\n ],\n ])),\n ],\n\n [\n 'namespace', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Shows the signature with curly brackets but not in the example\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'package', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'param', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Though no signature provided requiring, per\n // https://jsdoc.app/tags-param.html:\n // \"The @param tag requires you to specify the name of the parameter you\n // are documenting.\"\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'private', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'prop', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // See `property`\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'property', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // No docs indicate required, but since parallel to `param`, we treat as\n // such:\n [\n 'nameRequired', true,\n ],\n\n // Has no formal signature in the docs but shows curly brackets\n // in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'protected', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows the signature with curly brackets but not in the example\n // \"typeExpression\"\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'public', new Map(/** @type {[string, string|boolean][]} */ ([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'requires', new Map(/** @type {[string, string|boolean][]} */ ([\n // <someModuleName>\n [\n 'namepathRole', 'namepath-referencing',\n ],\n\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'return', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'returns', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'satisfies', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the doc signature and examples\n [\n 'typeRequired', true,\n ],\n ])),\n ],\n\n [\n 'see', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature allows for \"namepath\" or text, so user must configure to\n // 'namepath-referencing' to enforce checks\n [\n 'namepathRole', 'text',\n ],\n ])),\n ],\n\n [\n 'static', new Map(/** @type {[string, string|boolean][]} */ ([\n // Does not show a signature nor show curly brackets in the example\n [\n 'typeAllowed', isClosureOrPermissive,\n ],\n ])),\n ],\n\n [\n 'suppress', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', !isClosure,\n ],\n [\n 'typeRequired', isClosure,\n ],\n ])),\n ],\n\n [\n 'template', new Map(/** @type {[string, string|boolean][]} */ ([\n [\n 'namepathRole', isJsdoc ? 'text' : 'namepath-referencing',\n ],\n\n [\n 'nameRequired', !isJsdoc,\n ],\n\n // Though defines `namepathRole: 'namepath-defining'` in a sense, it is\n // not parseable in the same way for template (e.g., allowing commas),\n // so not adding\n [\n 'typeAllowed', isTypescriptOrClosure || isPermissive,\n ],\n ])),\n ],\n\n [\n 'this', new Map(/** @type {[string, string|boolean][]} */ ([\n // Signature seems to require a \"namepath\" (and no counter-examples)\n // Not used with namepath in Closure/TypeScript, however\n [\n 'namepathRole', isJsdoc ? 'namepath-referencing' : false,\n ],\n\n // namepath\n [\n 'typeOrNameRequired', isJsdoc,\n ],\n\n [\n 'typeRequired', isTypescriptOrClosure,\n ],\n ])),\n ],\n\n [\n 'throws', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'tutorial', new Map(/** @type {[string, string|boolean][]} */ ([\n // (a tutorial ID)\n [\n 'nameRequired', true,\n ],\n\n [\n 'typeAllowed', false,\n ],\n ])),\n ],\n\n [\n 'type', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the doc signature and examples\n // \"typeName\"\n [\n 'typeRequired', true,\n ],\n ])),\n ],\n\n [\n 'typedef', new Map(/** @type {[string, string|boolean][]} */ ([\n // Seems to require a \"namepath\" in the signature (with no\n // counter-examples)\n [\n 'namepathRole', 'name-defining',\n ],\n\n // TypeScript may allow it to be dropped if followed by @property or @member;\n // also shown as missing in Closure\n // \"namepath\"\n [\n 'nameRequired', isJsdocOrPermissive,\n ],\n\n // Is not `typeRequired` for TypeScript because it gives an error:\n // JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags.\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n\n // TypeScript may allow it to be dropped if followed by @property or @member\n // \"namepath\"\n [\n 'typeOrNameRequired', !isTypescript,\n ],\n ])),\n ],\n\n [\n 'var', new Map(/** @type {[string, string|boolean][]} */ ([\n // Allows for \"name\"'s in signature, but indicated as optional\n [\n 'namepathRole', 'namepath-defining',\n ],\n\n // Has example showing curly brackets but not in doc signature\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n\n [\n 'yield', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n [\n 'yields', new Map(/** @type {[string, string|boolean][]} */ ([\n // Shows curly brackets in the signature and in the examples\n [\n 'typeAllowed', true,\n ],\n ])),\n ],\n ]);\n};\n\nexport default getDefaultTagStructureForMode;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,6BAA6B,GAAI,IAAI,IAAK;EAC9C,MAAM,OAAO,GAAG,IAAI,KAAK,OAAO;EAChC,MAAM,SAAS,GAAG,IAAI,KAAK,SAAS;EACpC,MAAM,YAAY,GAAG,IA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EAAE,CAAC,YAAY,CACpC,CACD,CAAC,CACJ,EAED,CACE,KAAK,EAAE,IAAI,GAAG,CAAC,yCAA2C;EACxD;EACA,CACE,cAAc,EAAE,mBAAmB,CACpC;EAED;EACA,CACE,aAAa,EAAE,IAAI,CACpB,CACD,CAAC,CACJ,EAED,CACE,OAAO,EAAE,IAAI,GAAG,CAAC,yCAA2C;EAC1D;EACA,CACE,aAAa,EAAE,IAAI,CACpB,CACD,CAAC,CACJ,EACD,CACE,QAAQ,EAAE,IAAI,GAAG,CAAC,yCAA2C;EAC3D;EACA,CACE,aAAa,EAAE,IAAI,CACpB,CACD,CAAC,CACJ,CACF,CAAC;AACJ,CAAC;AAAC,iCAEa,6BAA6B;AAAA","ignoreList":[]}
|
|
@@ -1,587 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getJsdocProcessorPlugin = void 0;
|
|
7
|
-
var _jsdocUtils = require("./jsdocUtils.cjs");
|
|
8
|
-
var _jsdoccomment = require("@es-joy/jsdoccomment");
|
|
9
|
-
var espree = _interopRequireWildcard(require("espree"));
|
|
10
|
-
var _htmlEntities = require("html-entities");
|
|
11
|
-
var _nodeFs = require("node:fs");
|
|
12
|
-
var _nodePath = require("node:path");
|
|
13
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
-
/**
|
|
15
|
-
* @import {
|
|
16
|
-
* Integer,
|
|
17
|
-
* JsdocBlockWithInline,
|
|
18
|
-
* } from './iterateJsdoc.js';
|
|
19
|
-
* @import {
|
|
20
|
-
* ESLint,
|
|
21
|
-
* Linter,
|
|
22
|
-
* } from 'eslint';
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
version
|
|
27
|
-
} = JSON.parse((0, _nodeFs.readFileSync)((0, _nodePath.join)(__dirname, '../package.json'), 'utf8'));
|
|
28
|
-
|
|
29
|
-
// const zeroBasedLineIndexAdjust = -1;
|
|
30
|
-
const likelyNestedJSDocIndentSpace = 1;
|
|
31
|
-
const preTagSpaceLength = 1;
|
|
32
|
-
|
|
33
|
-
// If a space is present, we should ignore it
|
|
34
|
-
const firstLinePrefixLength = preTagSpaceLength;
|
|
35
|
-
const hasCaptionRegex = /^\s*<caption>([\s\S]*?)<\/caption>/v;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @param {string} str
|
|
39
|
-
* @returns {string}
|
|
40
|
-
*/
|
|
41
|
-
const escapeStringRegexp = str => {
|
|
42
|
-
return str.replaceAll(/[.*+?^$\{\}\(\)\|\[\]\\]/gv, '\\$&');
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @param {string} str
|
|
47
|
-
* @param {string} ch
|
|
48
|
-
* @returns {Integer}
|
|
49
|
-
*/
|
|
50
|
-
const countChars = (str, ch) => {
|
|
51
|
-
return (str.match(new RegExp(escapeStringRegexp(ch), 'gv')) || []).length;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @param {string} text
|
|
56
|
-
* @returns {[
|
|
57
|
-
* Integer,
|
|
58
|
-
* Integer
|
|
59
|
-
* ]}
|
|
60
|
-
*/
|
|
61
|
-
const getLinesCols = text => {
|
|
62
|
-
const matchLines = countChars(text, '\n');
|
|
63
|
-
const colDelta = matchLines ? text.slice(text.lastIndexOf('\n') + 1).length : text.length;
|
|
64
|
-
return [matchLines, colDelta];
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @typedef {number} Integer
|
|
69
|
-
*/
|
|
70
|
-
/**
|
|
71
|
-
* @typedef {object} JsdocProcessorOptions
|
|
72
|
-
* @property {boolean} [captionRequired] Require captions for example tags
|
|
73
|
-
* @property {Integer} [paddedIndent] See docs
|
|
74
|
-
* @property {boolean} [checkDefaults] See docs
|
|
75
|
-
* @property {boolean} [checkParams] See docs
|
|
76
|
-
* @property {boolean} [checkExamples] See docs
|
|
77
|
-
* @property {boolean} [checkProperties] See docs
|
|
78
|
-
* @property {string} [matchingFileName] See docs
|
|
79
|
-
* @property {string} [matchingFileNameDefaults] See docs
|
|
80
|
-
* @property {string} [matchingFileNameParams] See docs
|
|
81
|
-
* @property {string} [matchingFileNameProperties] See docs
|
|
82
|
-
* @property {string|RegExp} [exampleCodeRegex] See docs
|
|
83
|
-
* @property {string|RegExp} [rejectExampleCodeRegex] See docs
|
|
84
|
-
* @property {string[]} [allowedLanguagesToProcess] See docs
|
|
85
|
-
* @property {"script"|"module"} [sourceType] See docs
|
|
86
|
-
* @property {import('eslint').Linter.ESTreeParser|import('eslint').Linter.NonESTreeParser} [parser] See docs
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* We use a function for the ability of the user to pass in a config, but
|
|
91
|
-
* without requiring all users of the plugin to do so.
|
|
92
|
-
* @param {JsdocProcessorOptions} [options]
|
|
93
|
-
* @returns {ESLint.Plugin}
|
|
94
|
-
*/
|
|
95
|
-
const getJsdocProcessorPlugin = (options = {}) => {
|
|
96
|
-
/**
|
|
97
|
-
* @typedef {{
|
|
98
|
-
* text: string,
|
|
99
|
-
* filename: string|null|undefined
|
|
100
|
-
* }} TextAndFileName
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
const {
|
|
104
|
-
allowedLanguagesToProcess = ['js', 'ts', 'javascript', 'typescript'],
|
|
105
|
-
captionRequired = false,
|
|
106
|
-
checkDefaults = false,
|
|
107
|
-
checkExamples = true,
|
|
108
|
-
checkParams = false,
|
|
109
|
-
checkProperties = false,
|
|
110
|
-
exampleCodeRegex = null,
|
|
111
|
-
matchingFileName = null,
|
|
112
|
-
matchingFileNameDefaults = null,
|
|
113
|
-
matchingFileNameParams = null,
|
|
114
|
-
matchingFileNameProperties = null,
|
|
115
|
-
paddedIndent = 0,
|
|
116
|
-
parser = undefined,
|
|
117
|
-
rejectExampleCodeRegex = null,
|
|
118
|
-
sourceType = 'module'
|
|
119
|
-
} = options;
|
|
120
|
-
|
|
121
|
-
/** @type {RegExp} */
|
|
122
|
-
let exampleCodeRegExp;
|
|
123
|
-
/** @type {RegExp} */
|
|
124
|
-
let rejectExampleCodeRegExp;
|
|
125
|
-
if (exampleCodeRegex) {
|
|
126
|
-
exampleCodeRegExp = typeof exampleCodeRegex === 'string' ? (0, _jsdocUtils.getRegexFromString)(exampleCodeRegex) : exampleCodeRegex;
|
|
127
|
-
}
|
|
128
|
-
if (rejectExampleCodeRegex) {
|
|
129
|
-
rejectExampleCodeRegExp = typeof rejectExampleCodeRegex === 'string' ? (0, _jsdocUtils.getRegexFromString)(rejectExampleCodeRegex) : rejectExampleCodeRegex;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* @type {{
|
|
134
|
-
* targetTagName: string,
|
|
135
|
-
* ext: string,
|
|
136
|
-
* codeStartLine: number,
|
|
137
|
-
* codeStartCol: number,
|
|
138
|
-
* nonJSPrefacingCols: number,
|
|
139
|
-
* commentLineCols: [number, number]
|
|
140
|
-
* }[]}
|
|
141
|
-
*/
|
|
142
|
-
const otherInfo = [];
|
|
143
|
-
|
|
144
|
-
/** @type {import('eslint').Linter.LintMessage[]} */
|
|
145
|
-
let extraMessages = [];
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* @param {JsdocBlockWithInline} jsdoc
|
|
149
|
-
* @param {string} jsFileName
|
|
150
|
-
* @param {[number, number]} commentLineCols
|
|
151
|
-
*/
|
|
152
|
-
const getTextsAndFileNames = (jsdoc, jsFileName, commentLineCols) => {
|
|
153
|
-
/**
|
|
154
|
-
* @type {TextAndFileName[]}
|
|
155
|
-
*/
|
|
156
|
-
const textsAndFileNames = [];
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* @param {{
|
|
160
|
-
* filename: string|null,
|
|
161
|
-
* defaultFileName: string|undefined,
|
|
162
|
-
* source: string,
|
|
163
|
-
* targetTagName: string,
|
|
164
|
-
* rules?: import('eslint').Linter.RulesRecord|undefined,
|
|
165
|
-
* lines?: Integer,
|
|
166
|
-
* cols?: Integer,
|
|
167
|
-
* skipInit?: boolean,
|
|
168
|
-
* ext: string,
|
|
169
|
-
* sources?: {
|
|
170
|
-
* nonJSPrefacingCols: Integer,
|
|
171
|
-
* nonJSPrefacingLines: Integer,
|
|
172
|
-
* string: string,
|
|
173
|
-
* }[],
|
|
174
|
-
* tag?: import('comment-parser').Spec & {
|
|
175
|
-
* line?: Integer,
|
|
176
|
-
* }|{
|
|
177
|
-
* line: Integer,
|
|
178
|
-
* }
|
|
179
|
-
* }} cfg
|
|
180
|
-
*/
|
|
181
|
-
const checkSource = ({
|
|
182
|
-
cols = 0,
|
|
183
|
-
defaultFileName,
|
|
184
|
-
ext,
|
|
185
|
-
filename,
|
|
186
|
-
lines = 0,
|
|
187
|
-
skipInit,
|
|
188
|
-
source,
|
|
189
|
-
sources = [],
|
|
190
|
-
tag = {
|
|
191
|
-
line: 0
|
|
192
|
-
},
|
|
193
|
-
targetTagName
|
|
194
|
-
}) => {
|
|
195
|
-
if (!skipInit) {
|
|
196
|
-
sources.push({
|
|
197
|
-
nonJSPrefacingCols: cols,
|
|
198
|
-
nonJSPrefacingLines: lines,
|
|
199
|
-
string: source
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* @param {{
|
|
205
|
-
* nonJSPrefacingCols: Integer,
|
|
206
|
-
* nonJSPrefacingLines: Integer,
|
|
207
|
-
* string: string
|
|
208
|
-
* }} cfg
|
|
209
|
-
*/
|
|
210
|
-
const addSourceInfo = function ({
|
|
211
|
-
nonJSPrefacingCols,
|
|
212
|
-
nonJSPrefacingLines,
|
|
213
|
-
string
|
|
214
|
-
}) {
|
|
215
|
-
const src = paddedIndent ? string.replaceAll(new RegExp(`(^|\n) {${paddedIndent}}(?!$)`, 'gv'), '\n') : string;
|
|
216
|
-
|
|
217
|
-
// Programmatic ESLint API: https://eslint.org/docs/developer-guide/nodejs-api
|
|
218
|
-
const file = filename || defaultFileName;
|
|
219
|
-
if (!('line' in tag)) {
|
|
220
|
-
tag.line = tag.source[0].number;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// NOTE: `tag.line` can be 0 if of form `/** @tag ... */`
|
|
224
|
-
const codeStartLine =
|
|
225
|
-
/**
|
|
226
|
-
* @type {import('comment-parser').Spec & {
|
|
227
|
-
* line: Integer,
|
|
228
|
-
* }}
|
|
229
|
-
*/
|
|
230
|
-
tag.line + nonJSPrefacingLines;
|
|
231
|
-
const codeStartCol = likelyNestedJSDocIndentSpace;
|
|
232
|
-
textsAndFileNames.push({
|
|
233
|
-
filename: file,
|
|
234
|
-
// See https://github.com/gajus/eslint-plugin-jsdoc/issues/710
|
|
235
|
-
text: src.replaceAll(/(?<=\*)\\(?=\\*\/)/gv, '').replaceAll(/&([^\s;]+);/gv, (_, code) => {
|
|
236
|
-
// Dec
|
|
237
|
-
if (/^#\d+$/v.test(code)) {
|
|
238
|
-
return String.fromCodePoint(Number.parseInt(code.slice(1), 10));
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// Hex
|
|
242
|
-
if (/^#x\d+$/v.test(code)) {
|
|
243
|
-
return String.fromCodePoint(Number.parseInt(code.slice(2), 16));
|
|
244
|
-
}
|
|
245
|
-
return (0, _htmlEntities.decode)(_, {
|
|
246
|
-
level: 'html5'
|
|
247
|
-
});
|
|
248
|
-
})
|
|
249
|
-
});
|
|
250
|
-
otherInfo.push({
|
|
251
|
-
codeStartCol,
|
|
252
|
-
codeStartLine,
|
|
253
|
-
commentLineCols,
|
|
254
|
-
ext,
|
|
255
|
-
nonJSPrefacingCols,
|
|
256
|
-
targetTagName
|
|
257
|
-
});
|
|
258
|
-
};
|
|
259
|
-
for (const targetSource of sources) {
|
|
260
|
-
addSourceInfo(targetSource);
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
*
|
|
266
|
-
* @param {string|null} filename
|
|
267
|
-
* @param {string} [ext] Since `eslint-plugin-markdown` v2, and
|
|
268
|
-
* ESLint 7, this is the default which other JS-fenced rules will used.
|
|
269
|
-
* Formerly "md" was the default.
|
|
270
|
-
* @returns {{
|
|
271
|
-
* defaultFileName: string|undefined,
|
|
272
|
-
* filename: string|null,
|
|
273
|
-
* ext: string
|
|
274
|
-
* }}
|
|
275
|
-
*/
|
|
276
|
-
const getFilenameInfo = (filename, ext = 'md/*.js') => {
|
|
277
|
-
let defaultFileName;
|
|
278
|
-
if (!filename) {
|
|
279
|
-
if (typeof jsFileName === 'string' && jsFileName.includes('.')) {
|
|
280
|
-
defaultFileName = jsFileName.replace(/\.[^.]*$/v, `.${ext}`);
|
|
281
|
-
} else {
|
|
282
|
-
defaultFileName = `dummy.${ext}`;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
return {
|
|
286
|
-
defaultFileName,
|
|
287
|
-
ext,
|
|
288
|
-
filename
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
if (checkDefaults) {
|
|
292
|
-
const filenameInfo = getFilenameInfo(matchingFileNameDefaults, 'jsdoc-defaults');
|
|
293
|
-
(0, _jsdocUtils.forEachPreferredTag)(jsdoc, 'default', (tag, targetTagName) => {
|
|
294
|
-
if (!tag.description.trim()) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
checkSource({
|
|
298
|
-
source: `(${(0, _jsdocUtils.getTagDescription)(tag)})`,
|
|
299
|
-
targetTagName,
|
|
300
|
-
...filenameInfo
|
|
301
|
-
});
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
if (checkParams) {
|
|
305
|
-
const filenameInfo = getFilenameInfo(matchingFileNameParams, 'jsdoc-params');
|
|
306
|
-
(0, _jsdocUtils.forEachPreferredTag)(jsdoc, 'param', (tag, targetTagName) => {
|
|
307
|
-
if (!tag.default || !tag.default.trim()) {
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
checkSource({
|
|
311
|
-
source: `(${tag.default})`,
|
|
312
|
-
targetTagName,
|
|
313
|
-
...filenameInfo
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
if (checkProperties) {
|
|
318
|
-
const filenameInfo = getFilenameInfo(matchingFileNameProperties, 'jsdoc-properties');
|
|
319
|
-
(0, _jsdocUtils.forEachPreferredTag)(jsdoc, 'property', (tag, targetTagName) => {
|
|
320
|
-
if (!tag.default || !tag.default.trim()) {
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
checkSource({
|
|
324
|
-
source: `(${tag.default})`,
|
|
325
|
-
targetTagName,
|
|
326
|
-
...filenameInfo
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
if (!checkExamples) {
|
|
331
|
-
return textsAndFileNames;
|
|
332
|
-
}
|
|
333
|
-
const tagName = /** @type {string} */(0, _jsdocUtils.getPreferredTagName)(jsdoc, {
|
|
334
|
-
tagName: 'example'
|
|
335
|
-
});
|
|
336
|
-
if (!(0, _jsdocUtils.hasTag)(jsdoc, tagName)) {
|
|
337
|
-
return textsAndFileNames;
|
|
338
|
-
}
|
|
339
|
-
const matchingFilenameInfo = getFilenameInfo(matchingFileName);
|
|
340
|
-
(0, _jsdocUtils.forEachPreferredTag)(jsdoc, 'example', (tag, targetTagName) => {
|
|
341
|
-
let source = /** @type {string} */(0, _jsdocUtils.getTagDescription)(tag);
|
|
342
|
-
const match = source.match(hasCaptionRegex);
|
|
343
|
-
if (captionRequired && (!match || !match[1].trim())) {
|
|
344
|
-
extraMessages.push({
|
|
345
|
-
column: commentLineCols[1] + 1,
|
|
346
|
-
line: 1 + commentLineCols[0] + (tag.line ?? tag.source[0].number),
|
|
347
|
-
message: `@${targetTagName} error - Caption is expected for examples.`,
|
|
348
|
-
ruleId: 'jsdoc/example-missing-caption',
|
|
349
|
-
severity: 2
|
|
350
|
-
});
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
source = source.replace(hasCaptionRegex, '');
|
|
354
|
-
const [lines, cols] = match ? getLinesCols(match[0]) : [0, 0];
|
|
355
|
-
if (exampleCodeRegex && !exampleCodeRegExp.test(source) || rejectExampleCodeRegex && rejectExampleCodeRegExp.test(source)) {
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
// If `allowedLanguagesToProcess` is falsy, all languages should be processed.
|
|
360
|
-
if (allowedLanguagesToProcess) {
|
|
361
|
-
const matches = /^\s*```(?<language>\S+)([\s\S]*)```\s*$/v.exec(source);
|
|
362
|
-
if (matches?.groups && !allowedLanguagesToProcess.includes(matches.groups.language.toLowerCase())) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
const sources = [];
|
|
367
|
-
let skipInit = false;
|
|
368
|
-
if (exampleCodeRegex) {
|
|
369
|
-
let nonJSPrefacingCols = 0;
|
|
370
|
-
let nonJSPrefacingLines = 0;
|
|
371
|
-
let startingIndex = 0;
|
|
372
|
-
let lastStringCount = 0;
|
|
373
|
-
let exampleCode;
|
|
374
|
-
exampleCodeRegExp.lastIndex = 0;
|
|
375
|
-
while ((exampleCode = exampleCodeRegExp.exec(source)) !== null) {
|
|
376
|
-
const {
|
|
377
|
-
'0': n0,
|
|
378
|
-
'1': n1,
|
|
379
|
-
index
|
|
380
|
-
} = exampleCode;
|
|
381
|
-
|
|
382
|
-
// Count anything preceding user regex match (can affect line numbering)
|
|
383
|
-
const preMatch = source.slice(startingIndex, index);
|
|
384
|
-
const [preMatchLines, colDelta] = getLinesCols(preMatch);
|
|
385
|
-
let nonJSPreface;
|
|
386
|
-
let nonJSPrefaceLineCount;
|
|
387
|
-
if (n1) {
|
|
388
|
-
const idx = n0.indexOf(n1);
|
|
389
|
-
nonJSPreface = n0.slice(0, idx);
|
|
390
|
-
nonJSPrefaceLineCount = countChars(nonJSPreface, '\n');
|
|
391
|
-
} else {
|
|
392
|
-
nonJSPreface = '';
|
|
393
|
-
nonJSPrefaceLineCount = 0;
|
|
394
|
-
}
|
|
395
|
-
nonJSPrefacingLines += lastStringCount + preMatchLines + nonJSPrefaceLineCount;
|
|
396
|
-
|
|
397
|
-
// Ignore `preMatch` delta if newlines here
|
|
398
|
-
if (nonJSPrefaceLineCount) {
|
|
399
|
-
const charsInLastLine = nonJSPreface.slice(nonJSPreface.lastIndexOf('\n') + 1).length;
|
|
400
|
-
nonJSPrefacingCols += charsInLastLine;
|
|
401
|
-
} else {
|
|
402
|
-
nonJSPrefacingCols += colDelta + nonJSPreface.length;
|
|
403
|
-
}
|
|
404
|
-
const string = n1 || n0;
|
|
405
|
-
sources.push({
|
|
406
|
-
nonJSPrefacingCols,
|
|
407
|
-
nonJSPrefacingLines,
|
|
408
|
-
string
|
|
409
|
-
});
|
|
410
|
-
startingIndex = exampleCodeRegExp.lastIndex;
|
|
411
|
-
lastStringCount = countChars(string, '\n');
|
|
412
|
-
if (!exampleCodeRegExp.global) {
|
|
413
|
-
break;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
skipInit = true;
|
|
417
|
-
}
|
|
418
|
-
checkSource({
|
|
419
|
-
cols,
|
|
420
|
-
lines,
|
|
421
|
-
skipInit,
|
|
422
|
-
source,
|
|
423
|
-
sources,
|
|
424
|
-
tag,
|
|
425
|
-
targetTagName,
|
|
426
|
-
...matchingFilenameInfo
|
|
427
|
-
});
|
|
428
|
-
});
|
|
429
|
-
return textsAndFileNames;
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
// See https://eslint.org/docs/latest/extend/plugins#processors-in-plugins
|
|
433
|
-
// See https://eslint.org/docs/latest/extend/custom-processors
|
|
434
|
-
// From https://github.com/eslint/eslint/issues/14745#issuecomment-869457265
|
|
435
|
-
/*
|
|
436
|
-
{
|
|
437
|
-
"files": ["*.js", "*.ts"],
|
|
438
|
-
"processor": "jsdoc/example" // a pretended value here
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
"files": [
|
|
442
|
-
"*.js/*_jsdoc-example.js",
|
|
443
|
-
"*.ts/*_jsdoc-example.js",
|
|
444
|
-
"*.js/*_jsdoc-example.ts"
|
|
445
|
-
],
|
|
446
|
-
"rules": {
|
|
447
|
-
// specific rules for examples in jsdoc only here
|
|
448
|
-
// And other rules for `.js` and `.ts` will also be enabled for them
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
*/
|
|
452
|
-
return {
|
|
453
|
-
meta: {
|
|
454
|
-
name: 'eslint-plugin-jsdoc/processor',
|
|
455
|
-
version
|
|
456
|
-
},
|
|
457
|
-
processors: {
|
|
458
|
-
examples: {
|
|
459
|
-
meta: {
|
|
460
|
-
name: 'eslint-plugin-jsdoc/preprocessor',
|
|
461
|
-
version
|
|
462
|
-
},
|
|
463
|
-
/**
|
|
464
|
-
* @param {import('eslint').Linter.LintMessage[][]} messages
|
|
465
|
-
* @param {string} filename
|
|
466
|
-
*/
|
|
467
|
-
postprocess([jsMessages, ...messages
|
|
468
|
-
// eslint-disable-next-line no-unused-vars -- Placeholder
|
|
469
|
-
], filename) {
|
|
470
|
-
for (const [idx, message] of messages.entries()) {
|
|
471
|
-
const {
|
|
472
|
-
codeStartCol,
|
|
473
|
-
codeStartLine,
|
|
474
|
-
commentLineCols,
|
|
475
|
-
nonJSPrefacingCols,
|
|
476
|
-
targetTagName
|
|
477
|
-
} = otherInfo[idx];
|
|
478
|
-
for (const msg of message) {
|
|
479
|
-
const {
|
|
480
|
-
column,
|
|
481
|
-
endColumn,
|
|
482
|
-
endLine,
|
|
483
|
-
fatal,
|
|
484
|
-
line,
|
|
485
|
-
message: messageText,
|
|
486
|
-
ruleId,
|
|
487
|
-
severity
|
|
488
|
-
|
|
489
|
-
// Todo: Make fixable
|
|
490
|
-
// fix
|
|
491
|
-
// fix: {range: [number, number], text: string}
|
|
492
|
-
// suggestions: {desc: , messageId:, fix: }[],
|
|
493
|
-
} = msg;
|
|
494
|
-
delete msg.fix;
|
|
495
|
-
const [codeCtxLine, codeCtxColumn] = commentLineCols;
|
|
496
|
-
const startLine = codeCtxLine + codeStartLine + line;
|
|
497
|
-
|
|
498
|
-
// Seems to need one more now
|
|
499
|
-
const startCol = 1 + codeCtxColumn + codeStartCol + (
|
|
500
|
-
// This might not work for line 0, but line 0 is unlikely for examples
|
|
501
|
-
line <= 1 ? nonJSPrefacingCols + firstLinePrefixLength : preTagSpaceLength) + column;
|
|
502
|
-
msg.message = '@' + targetTagName + ' ' + (severity === 2 ? 'error' : 'warning') + (ruleId ? ' (' + ruleId + ')' : '') + ': ' + (fatal ? 'Fatal: ' : '') + messageText;
|
|
503
|
-
msg.line = startLine;
|
|
504
|
-
msg.column = startCol;
|
|
505
|
-
msg.endLine = endLine ? startLine + endLine : startLine;
|
|
506
|
-
// added `- column` to offset what `endColumn` already seemed to include
|
|
507
|
-
msg.endColumn = endColumn ? startCol - column + endColumn : startCol;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
const ret = [...jsMessages].concat(...messages, ...extraMessages);
|
|
511
|
-
extraMessages = [];
|
|
512
|
-
return ret;
|
|
513
|
-
},
|
|
514
|
-
/**
|
|
515
|
-
* @param {string} text
|
|
516
|
-
* @param {string} filename
|
|
517
|
-
* @returns {(string | Linter.ProcessorFile)[]}
|
|
518
|
-
*/
|
|
519
|
-
preprocess(text, filename) {
|
|
520
|
-
try {
|
|
521
|
-
let ast;
|
|
522
|
-
|
|
523
|
-
// May be running a second time so catch and ignore
|
|
524
|
-
try {
|
|
525
|
-
ast = parser ?
|
|
526
|
-
// @ts-expect-error Should be present
|
|
527
|
-
parser.parseForESLint(text, {
|
|
528
|
-
comment: true,
|
|
529
|
-
ecmaVersion: 'latest',
|
|
530
|
-
sourceType
|
|
531
|
-
}).ast : espree.parse(text, {
|
|
532
|
-
comment: true,
|
|
533
|
-
ecmaVersion: 'latest',
|
|
534
|
-
sourceType
|
|
535
|
-
});
|
|
536
|
-
} catch {
|
|
537
|
-
return [text];
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
/** @type {[number, number][]} */
|
|
541
|
-
const commentLineCols = [];
|
|
542
|
-
const jsdocComments = /** @type {import('estree').Comment[]} */(
|
|
543
|
-
/**
|
|
544
|
-
* @type {import('estree').Program & {
|
|
545
|
-
* comments?: import('estree').Comment[]
|
|
546
|
-
* }}
|
|
547
|
-
*/
|
|
548
|
-
ast.comments).filter(comment => {
|
|
549
|
-
return /^\*\s/v.test(comment.value);
|
|
550
|
-
}).map(comment => {
|
|
551
|
-
const [start
|
|
552
|
-
/* c8 ignore next -- Unsupporting processors only? */] = comment.range ?? [];
|
|
553
|
-
const textToStart = text.slice(0, start);
|
|
554
|
-
const [lines, cols] = getLinesCols(textToStart);
|
|
555
|
-
|
|
556
|
-
// const lines = [...textToStart.matchAll(/\n/gv)].length
|
|
557
|
-
// const lastLinePos = textToStart.lastIndexOf('\n');
|
|
558
|
-
// const cols = lastLinePos === -1
|
|
559
|
-
// ? 0
|
|
560
|
-
// : textToStart.slice(lastLinePos).length;
|
|
561
|
-
commentLineCols.push([lines, cols]);
|
|
562
|
-
return (0, _jsdoccomment.parseComment)(comment);
|
|
563
|
-
});
|
|
564
|
-
return [text, ...jsdocComments.flatMap((jsdoc, idx) => {
|
|
565
|
-
return getTextsAndFileNames(jsdoc, filename, commentLineCols[idx]);
|
|
566
|
-
}).filter(
|
|
567
|
-
/**
|
|
568
|
-
* @param {TextAndFileName} file
|
|
569
|
-
* @returns {file is Linter.ProcessorFile}
|
|
570
|
-
*/
|
|
571
|
-
file => {
|
|
572
|
-
return file !== null && file !== undefined;
|
|
573
|
-
})];
|
|
574
|
-
/* c8 ignore next 6 */
|
|
575
|
-
} catch (error) {
|
|
576
|
-
// eslint-disable-next-line no-console -- Debugging
|
|
577
|
-
console.log('err', filename, error);
|
|
578
|
-
}
|
|
579
|
-
return [];
|
|
580
|
-
},
|
|
581
|
-
supportsAutofix: true
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
};
|
|
585
|
-
};
|
|
586
|
-
exports.getJsdocProcessorPlugin = getJsdocProcessorPlugin;
|
|
587
|
-
//# sourceMappingURL=getJsdocProcessorPlugin.cjs.map
|