eslint-plugin-jsdoc 52.0.4 → 53.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/WarnSettings.cjs +18 -35
- package/dist/WarnSettings.cjs.map +1 -1
- package/dist/WarnSettings.js +20 -0
- package/dist/WarnSettings.js.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +32 -0
- package/dist/_virtual/rolldown_runtime.js +11 -0
- package/dist/alignTransform.cjs +224 -305
- package/dist/alignTransform.cjs.map +1 -1
- package/dist/alignTransform.js +241 -0
- package/dist/alignTransform.js.map +1 -0
- package/dist/defaultTagOrder.cjs +132 -43
- package/dist/defaultTagOrder.cjs.map +1 -1
- package/dist/defaultTagOrder.js +134 -0
- package/dist/defaultTagOrder.js.map +1 -0
- package/dist/exportParser.cjs +478 -696
- package/dist/exportParser.cjs.map +1 -1
- package/dist/exportParser.js +518 -0
- package/dist/exportParser.js.map +1 -0
- package/dist/getDefaultTagStructureForMode.cjs +184 -288
- package/dist/getDefaultTagStructureForMode.cjs.map +1 -1
- package/dist/getDefaultTagStructureForMode.js +188 -0
- package/dist/getDefaultTagStructureForMode.js.map +1 -0
- package/dist/getJsdocProcessorPlugin.cjs +364 -550
- package/dist/getJsdocProcessorPlugin.cjs.map +1 -1
- package/dist/getJsdocProcessorPlugin.d.cts +70 -0
- package/dist/getJsdocProcessorPlugin.d.cts.map +1 -0
- package/dist/getJsdocProcessorPlugin.d.ts +68 -65
- package/dist/getJsdocProcessorPlugin.d.ts.map +1 -1
- package/dist/getJsdocProcessorPlugin.js +383 -0
- package/dist/getJsdocProcessorPlugin.js.map +1 -0
- package/dist/index.cjs +2 -410
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -17
- package/dist/index.js +3 -0
- package/dist/iterateJsdoc.cjs +1539 -1988
- package/dist/iterateJsdoc.cjs.map +1 -1
- package/dist/iterateJsdoc.d.cts +472 -0
- package/dist/iterateJsdoc.d.cts.map +1 -0
- package/dist/iterateJsdoc.d.ts +359 -349
- package/dist/iterateJsdoc.d.ts.map +1 -1
- package/dist/iterateJsdoc.js +1628 -0
- package/dist/iterateJsdoc.js.map +1 -0
- package/dist/jsdocUtils.cjs +1009 -1376
- package/dist/jsdocUtils.cjs.map +1 -1
- package/dist/jsdocUtils.js +1123 -0
- package/dist/jsdocUtils.js.map +1 -0
- package/dist/plugin.cjs +427 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.js +427 -0
- package/dist/plugin.js.map +1 -0
- package/dist/rules/checkAccess.cjs +29 -36
- package/dist/rules/checkAccess.cjs.map +1 -1
- package/dist/rules/checkAccess.js +33 -0
- package/dist/rules/checkAccess.js.map +1 -0
- package/dist/rules/checkAlignment.cjs +41 -54
- package/dist/rules/checkAlignment.cjs.map +1 -1
- package/dist/rules/checkAlignment.js +47 -0
- package/dist/rules/checkAlignment.js.map +1 -0
- package/dist/rules/checkExamples.cjs +327 -484
- package/dist/rules/checkExamples.cjs.map +1 -1
- package/dist/rules/checkExamples.js +348 -0
- package/dist/rules/checkExamples.js.map +1 -0
- package/dist/rules/checkIndentation.cjs +50 -65
- package/dist/rules/checkIndentation.cjs.map +1 -1
- package/dist/rules/checkIndentation.js +59 -0
- package/dist/rules/checkIndentation.js.map +1 -0
- package/dist/rules/checkLineAlignment.cjs +220 -311
- package/dist/rules/checkLineAlignment.cjs.map +1 -1
- package/dist/rules/checkLineAlignment.js +229 -0
- package/dist/rules/checkLineAlignment.js.map +1 -0
- package/dist/rules/checkParamNames.cjs +227 -335
- package/dist/rules/checkParamNames.cjs.map +1 -1
- package/dist/rules/checkParamNames.js +237 -0
- package/dist/rules/checkParamNames.js.map +1 -0
- package/dist/rules/checkPropertyNames.cjs +78 -106
- package/dist/rules/checkPropertyNames.cjs.map +1 -1
- package/dist/rules/checkPropertyNames.js +88 -0
- package/dist/rules/checkPropertyNames.js.map +1 -0
- package/dist/rules/checkSyntax.cjs +21 -34
- package/dist/rules/checkSyntax.cjs.map +1 -1
- package/dist/rules/checkSyntax.js +25 -0
- package/dist/rules/checkSyntax.js.map +1 -0
- package/dist/rules/checkTagNames.cjs +188 -210
- package/dist/rules/checkTagNames.cjs.map +1 -1
- package/dist/rules/checkTagNames.js +191 -0
- package/dist/rules/checkTagNames.js.map +1 -0
- package/dist/rules/checkTemplateNames.cjs +121 -178
- package/dist/rules/checkTemplateNames.cjs.map +1 -1
- package/dist/rules/checkTemplateNames.js +124 -0
- package/dist/rules/checkTemplateNames.js.map +1 -0
- package/dist/rules/checkTypes.cjs +291 -385
- package/dist/rules/checkTypes.cjs.map +1 -1
- package/dist/rules/checkTypes.js +299 -0
- package/dist/rules/checkTypes.js.map +1 -0
- package/dist/rules/checkValues.cjs +100 -146
- package/dist/rules/checkValues.cjs.map +1 -1
- package/dist/rules/checkValues.js +103 -0
- package/dist/rules/checkValues.js.map +1 -0
- package/dist/rules/convertToJsdocComments.cjs +228 -306
- package/dist/rules/convertToJsdocComments.cjs.map +1 -1
- package/dist/rules/convertToJsdocComments.js +231 -0
- package/dist/rules/convertToJsdocComments.js.map +1 -0
- package/dist/rules/emptyTags.cjs +62 -72
- package/dist/rules/emptyTags.cjs.map +1 -1
- package/dist/rules/emptyTags.js +67 -0
- package/dist/rules/emptyTags.js.map +1 -0
- package/dist/rules/implementsOnClasses.cjs +36 -56
- package/dist/rules/implementsOnClasses.cjs.map +1 -1
- package/dist/rules/implementsOnClasses.js +40 -0
- package/dist/rules/implementsOnClasses.js.map +1 -0
- package/dist/rules/importsAsDependencies.cjs +62 -99
- package/dist/rules/importsAsDependencies.cjs.map +1 -1
- package/dist/rules/importsAsDependencies.js +68 -0
- package/dist/rules/importsAsDependencies.js.map +1 -0
- package/dist/rules/informativeDocs.cjs +105 -142
- package/dist/rules/informativeDocs.cjs.map +1 -1
- package/dist/rules/informativeDocs.js +110 -0
- package/dist/rules/informativeDocs.js.map +1 -0
- package/dist/rules/linesBeforeBlock.cjs +70 -105
- package/dist/rules/linesBeforeBlock.cjs.map +1 -1
- package/dist/rules/linesBeforeBlock.js +75 -0
- package/dist/rules/linesBeforeBlock.js.map +1 -0
- package/dist/rules/matchDescription.cjs +160 -222
- package/dist/rules/matchDescription.cjs.map +1 -1
- package/dist/rules/matchDescription.js +167 -0
- package/dist/rules/matchDescription.js.map +1 -0
- package/dist/rules/matchName.cjs +73 -128
- package/dist/rules/matchName.cjs.map +1 -1
- package/dist/rules/matchName.js +77 -0
- package/dist/rules/matchName.js.map +1 -0
- package/dist/rules/multilineBlocks.cjs +235 -352
- package/dist/rules/multilineBlocks.cjs.map +1 -1
- package/dist/rules/multilineBlocks.js +245 -0
- package/dist/rules/multilineBlocks.js.map +1 -0
- package/dist/rules/noBadBlocks.cjs +63 -86
- package/dist/rules/noBadBlocks.cjs.map +1 -1
- package/dist/rules/noBadBlocks.js +68 -0
- package/dist/rules/noBadBlocks.js.map +1 -0
- package/dist/rules/noBlankBlockDescriptions.cjs +35 -57
- package/dist/rules/noBlankBlockDescriptions.cjs.map +1 -1
- package/dist/rules/noBlankBlockDescriptions.js +41 -0
- package/dist/rules/noBlankBlockDescriptions.js.map +1 -0
- package/dist/rules/noBlankBlocks.cjs +26 -48
- package/dist/rules/noBlankBlocks.cjs.map +1 -1
- package/dist/rules/noBlankBlocks.js +30 -0
- package/dist/rules/noBlankBlocks.js.map +1 -0
- package/dist/rules/noDefaults.cjs +52 -79
- package/dist/rules/noDefaults.cjs.map +1 -1
- package/dist/rules/noDefaults.js +56 -0
- package/dist/rules/noDefaults.js.map +1 -0
- package/dist/rules/noMissingSyntax.cjs +115 -165
- package/dist/rules/noMissingSyntax.cjs.map +1 -1
- package/dist/rules/noMissingSyntax.js +126 -0
- package/dist/rules/noMissingSyntax.js.map +1 -0
- package/dist/rules/noMultiAsterisks.cjs +48 -89
- package/dist/rules/noMultiAsterisks.cjs.map +1 -1
- package/dist/rules/noMultiAsterisks.js +58 -0
- package/dist/rules/noMultiAsterisks.js.map +1 -0
- package/dist/rules/noRestrictedSyntax.cjs +45 -79
- package/dist/rules/noRestrictedSyntax.cjs.map +1 -1
- package/dist/rules/noRestrictedSyntax.js +49 -0
- package/dist/rules/noRestrictedSyntax.js.map +1 -0
- package/dist/rules/noTypes.cjs +59 -80
- package/dist/rules/noTypes.cjs.map +1 -1
- package/dist/rules/noTypes.js +65 -0
- package/dist/rules/noTypes.js.map +1 -0
- package/dist/rules/noUndefinedTypes.cjs +297 -388
- package/dist/rules/noUndefinedTypes.cjs.map +1 -1
- package/dist/rules/noUndefinedTypes.js +303 -0
- package/dist/rules/noUndefinedTypes.js.map +1 -0
- package/dist/rules/requireAsteriskPrefix.cjs +108 -159
- package/dist/rules/requireAsteriskPrefix.cjs.map +1 -1
- package/dist/rules/requireAsteriskPrefix.js +112 -0
- package/dist/rules/requireAsteriskPrefix.js.map +1 -0
- package/dist/rules/requireDescription.cjs +89 -129
- package/dist/rules/requireDescription.cjs.map +1 -1
- package/dist/rules/requireDescription.js +95 -0
- package/dist/rules/requireDescription.js.map +1 -0
- package/dist/rules/requireDescriptionCompleteSentence.cjs +201 -262
- package/dist/rules/requireDescriptionCompleteSentence.cjs.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.js +220 -0
- package/dist/rules/requireDescriptionCompleteSentence.js.map +1 -0
- package/dist/rules/requireExample.cjs +73 -104
- package/dist/rules/requireExample.cjs.map +1 -1
- package/dist/rules/requireExample.js +77 -0
- package/dist/rules/requireExample.js.map +1 -0
- package/dist/rules/requireFileOverview.cjs +75 -129
- package/dist/rules/requireFileOverview.cjs.map +1 -1
- package/dist/rules/requireFileOverview.js +81 -0
- package/dist/rules/requireFileOverview.js.map +1 -0
- package/dist/rules/requireHyphenBeforeParamDescription.cjs +85 -133
- package/dist/rules/requireHyphenBeforeParamDescription.cjs.map +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.js +89 -0
- package/dist/rules/requireHyphenBeforeParamDescription.js.map +1 -0
- package/dist/rules/requireJsdoc.cjs +384 -557
- package/dist/rules/requireJsdoc.cjs.map +1 -1
- package/dist/rules/requireJsdoc.js +404 -0
- package/dist/rules/requireJsdoc.js.map +1 -0
- package/dist/rules/requireParam.cjs +336 -526
- package/dist/rules/requireParam.cjs.map +1 -1
- package/dist/rules/requireParam.js +344 -0
- package/dist/rules/requireParam.js.map +1 -0
- package/dist/rules/requireParamDescription.cjs +55 -80
- package/dist/rules/requireParamDescription.cjs.map +1 -1
- package/dist/rules/requireParamDescription.js +59 -0
- package/dist/rules/requireParamDescription.js.map +1 -0
- package/dist/rules/requireParamName.cjs +32 -50
- package/dist/rules/requireParamName.cjs.map +1 -1
- package/dist/rules/requireParamName.js +36 -0
- package/dist/rules/requireParamName.js.map +1 -0
- package/dist/rules/requireParamType.cjs +55 -80
- package/dist/rules/requireParamType.cjs.map +1 -1
- package/dist/rules/requireParamType.js +59 -0
- package/dist/rules/requireParamType.js.map +1 -0
- package/dist/rules/requireProperty.cjs +31 -42
- package/dist/rules/requireProperty.cjs.map +1 -1
- package/dist/rules/requireProperty.js +35 -0
- package/dist/rules/requireProperty.js.map +1 -0
- package/dist/rules/requirePropertyDescription.cjs +17 -25
- package/dist/rules/requirePropertyDescription.cjs.map +1 -1
- package/dist/rules/requirePropertyDescription.js +21 -0
- package/dist/rules/requirePropertyDescription.js.map +1 -0
- package/dist/rules/requirePropertyName.cjs +17 -25
- package/dist/rules/requirePropertyName.cjs.map +1 -1
- package/dist/rules/requirePropertyName.js +21 -0
- package/dist/rules/requirePropertyName.js.map +1 -0
- package/dist/rules/requirePropertyType.cjs +17 -25
- package/dist/rules/requirePropertyType.cjs.map +1 -1
- package/dist/rules/requirePropertyType.js +21 -0
- package/dist/rules/requirePropertyType.js.map +1 -0
- package/dist/rules/requireReturns.cjs +125 -203
- package/dist/rules/requireReturns.cjs.map +1 -1
- package/dist/rules/requireReturns.js +131 -0
- package/dist/rules/requireReturns.js.map +1 -0
- package/dist/rules/requireReturnsCheck.cjs +60 -103
- package/dist/rules/requireReturnsCheck.cjs.map +1 -1
- package/dist/rules/requireReturnsCheck.js +66 -0
- package/dist/rules/requireReturnsCheck.js.map +1 -0
- package/dist/rules/requireReturnsDescription.cjs +39 -54
- package/dist/rules/requireReturnsDescription.cjs.map +1 -1
- package/dist/rules/requireReturnsDescription.js +43 -0
- package/dist/rules/requireReturnsDescription.js.map +1 -0
- package/dist/rules/requireReturnsType.cjs +32 -50
- package/dist/rules/requireReturnsType.cjs.map +1 -1
- package/dist/rules/requireReturnsType.js +36 -0
- package/dist/rules/requireReturnsType.js.map +1 -0
- package/dist/rules/requireTemplate.cjs +119 -178
- package/dist/rules/requireTemplate.cjs.map +1 -1
- package/dist/rules/requireTemplate.js +122 -0
- package/dist/rules/requireTemplate.js.map +1 -0
- package/dist/rules/requireThrows.cjs +61 -95
- package/dist/rules/requireThrows.cjs.map +1 -1
- package/dist/rules/requireThrows.js +67 -0
- package/dist/rules/requireThrows.js.map +1 -0
- package/dist/rules/requireYields.cjs +106 -166
- package/dist/rules/requireYields.cjs.map +1 -1
- package/dist/rules/requireYields.js +115 -0
- package/dist/rules/requireYields.js.map +1 -0
- package/dist/rules/requireYieldsCheck.cjs +96 -152
- package/dist/rules/requireYieldsCheck.cjs.map +1 -1
- package/dist/rules/requireYieldsCheck.js +105 -0
- package/dist/rules/requireYieldsCheck.js.map +1 -0
- package/dist/rules/sortTags.cjs +258 -444
- package/dist/rules/sortTags.cjs.map +1 -1
- package/dist/rules/sortTags.js +262 -0
- package/dist/rules/sortTags.js.map +1 -0
- package/dist/rules/tagLines.cjs +179 -266
- package/dist/rules/tagLines.cjs.map +1 -1
- package/dist/rules/tagLines.js +183 -0
- package/dist/rules/tagLines.js.map +1 -0
- package/dist/rules/textEscaping.cjs +92 -127
- package/dist/rules/textEscaping.cjs.map +1 -1
- package/dist/rules/textEscaping.js +102 -0
- package/dist/rules/textEscaping.js.map +1 -0
- package/dist/rules/validTypes.cjs +252 -265
- package/dist/rules/validTypes.cjs.map +1 -1
- package/dist/rules/validTypes.js +259 -0
- package/dist/rules/validTypes.js.map +1 -0
- package/dist/tagNames.cjs +134 -170
- package/dist/tagNames.cjs.map +1 -1
- package/dist/tagNames.js +144 -0
- package/dist/tagNames.js.map +1 -0
- package/dist/utils/hasReturnValue.cjs +246 -474
- package/dist/utils/hasReturnValue.cjs.map +1 -1
- package/dist/utils/hasReturnValue.js +265 -0
- package/dist/utils/hasReturnValue.js.map +1 -0
- package/package.json +40 -24
- package/dist/generateRule.cjs +0 -242
- package/dist/generateRule.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/src/WarnSettings.js +0 -34
- package/src/alignTransform.js +0 -358
- package/src/defaultTagOrder.js +0 -169
- package/src/exportParser.js +0 -978
- package/src/getDefaultTagStructureForMode.js +0 -969
- package/src/getJsdocProcessorPlugin.js +0 -672
- package/src/index.js +0 -530
- package/src/iterateJsdoc.js +0 -2518
- package/src/jsdocUtils.js +0 -1896
- package/src/rules/checkAccess.js +0 -45
- package/src/rules/checkAlignment.js +0 -63
- package/src/rules/checkExamples.js +0 -589
- package/src/rules/checkIndentation.js +0 -75
- package/src/rules/checkLineAlignment.js +0 -372
- package/src/rules/checkParamNames.js +0 -474
- package/src/rules/checkPropertyNames.js +0 -152
- package/src/rules/checkSyntax.js +0 -30
- package/src/rules/checkTagNames.js +0 -314
- package/src/rules/checkTemplateNames.js +0 -204
- package/src/rules/checkTypes.js +0 -535
- package/src/rules/checkValues.js +0 -248
- package/src/rules/convertToJsdocComments.js +0 -398
- package/src/rules/emptyTags.js +0 -98
- package/src/rules/implementsOnClasses.js +0 -64
- package/src/rules/importsAsDependencies.js +0 -133
- package/src/rules/informativeDocs.js +0 -189
- package/src/rules/linesBeforeBlock.js +0 -134
- package/src/rules/matchDescription.js +0 -286
- package/src/rules/matchName.js +0 -151
- package/src/rules/multilineBlocks.js +0 -493
- package/src/rules/noBadBlocks.js +0 -119
- package/src/rules/noBlankBlockDescriptions.js +0 -69
- package/src/rules/noBlankBlocks.js +0 -53
- package/src/rules/noDefaults.js +0 -85
- package/src/rules/noMissingSyntax.js +0 -195
- package/src/rules/noMultiAsterisks.js +0 -134
- package/src/rules/noRestrictedSyntax.js +0 -91
- package/src/rules/noTypes.js +0 -93
- package/src/rules/noUndefinedTypes.js +0 -543
- package/src/rules/requireAsteriskPrefix.js +0 -190
- package/src/rules/requireDescription.js +0 -161
- package/src/rules/requireDescriptionCompleteSentence.js +0 -335
- package/src/rules/requireExample.js +0 -118
- package/src/rules/requireFileOverview.js +0 -154
- package/src/rules/requireHyphenBeforeParamDescription.js +0 -176
- package/src/rules/requireJsdoc.js +0 -743
- package/src/rules/requireParam.js +0 -602
- package/src/rules/requireParamDescription.js +0 -89
- package/src/rules/requireParamName.js +0 -55
- package/src/rules/requireParamType.js +0 -89
- package/src/rules/requireProperty.js +0 -48
- package/src/rules/requirePropertyDescription.js +0 -25
- package/src/rules/requirePropertyName.js +0 -25
- package/src/rules/requirePropertyType.js +0 -25
- package/src/rules/requireReturns.js +0 -238
- package/src/rules/requireReturnsCheck.js +0 -145
- package/src/rules/requireReturnsDescription.js +0 -59
- package/src/rules/requireReturnsType.js +0 -51
- package/src/rules/requireTemplate.js +0 -201
- package/src/rules/requireThrows.js +0 -111
- package/src/rules/requireYields.js +0 -216
- package/src/rules/requireYieldsCheck.js +0 -208
- package/src/rules/sortTags.js +0 -558
- package/src/rules/tagLines.js +0 -359
- package/src/rules/textEscaping.js +0 -154
- package/src/rules/validTypes.js +0 -401
- package/src/tagNames.js +0 -238
- package/src/utils/hasReturnValue.js +0 -572
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { forEachPreferredTag, getPreferredTagName, getRegexFromString, getTagDescription, hasTag } from "./jsdocUtils.js";
|
|
2
|
+
import { parseComment } from "@es-joy/jsdoccomment";
|
|
3
|
+
import * as espree from "espree";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
|
|
7
|
+
//#region src/getJsdocProcessorPlugin.js
|
|
8
|
+
/**
|
|
9
|
+
* @import {
|
|
10
|
+
* Integer,
|
|
11
|
+
* JsdocBlockWithInline,
|
|
12
|
+
* } from './iterateJsdoc.js';
|
|
13
|
+
* @import {
|
|
14
|
+
* ESLint,
|
|
15
|
+
* Linter,
|
|
16
|
+
* } from 'eslint';
|
|
17
|
+
*/
|
|
18
|
+
const { version } = JSON.parse(readFileSync(join(import.meta.dirname, "../package.json")));
|
|
19
|
+
const likelyNestedJSDocIndentSpace = 1;
|
|
20
|
+
const preTagSpaceLength = 1;
|
|
21
|
+
const firstLinePrefixLength = preTagSpaceLength;
|
|
22
|
+
const hasCaptionRegex = /^\s*<caption>([\s\S]*?)<\/caption>/v;
|
|
23
|
+
/**
|
|
24
|
+
* @param {string} str
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
const escapeStringRegexp = (str) => {
|
|
28
|
+
return str.replaceAll(/[.*+?^$\{\}\(\)\|\[\]\\]/gv, "\\$&");
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @param {string} str
|
|
32
|
+
* @param {string} ch
|
|
33
|
+
* @returns {Integer}
|
|
34
|
+
*/
|
|
35
|
+
const countChars = (str, ch) => {
|
|
36
|
+
return (str.match(new RegExp(escapeStringRegexp(ch), "gv")) || []).length;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @param {string} text
|
|
40
|
+
* @returns {[
|
|
41
|
+
* Integer,
|
|
42
|
+
* Integer
|
|
43
|
+
* ]}
|
|
44
|
+
*/
|
|
45
|
+
const getLinesCols = (text) => {
|
|
46
|
+
const matchLines = countChars(text, "\n");
|
|
47
|
+
const colDelta = matchLines ? text.slice(text.lastIndexOf("\n") + 1).length : text.length;
|
|
48
|
+
return [matchLines, colDelta];
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @typedef {number} Integer
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* @typedef {object} JsdocProcessorOptions
|
|
55
|
+
* @property {boolean} [captionRequired] Require captions for example tags
|
|
56
|
+
* @property {Integer} [paddedIndent] See docs
|
|
57
|
+
* @property {boolean} [checkDefaults] See docs
|
|
58
|
+
* @property {boolean} [checkParams] See docs
|
|
59
|
+
* @property {boolean} [checkExamples] See docs
|
|
60
|
+
* @property {boolean} [checkProperties] See docs
|
|
61
|
+
* @property {string} [matchingFileName] See docs
|
|
62
|
+
* @property {string} [matchingFileNameDefaults] See docs
|
|
63
|
+
* @property {string} [matchingFileNameParams] See docs
|
|
64
|
+
* @property {string} [matchingFileNameProperties] See docs
|
|
65
|
+
* @property {string|RegExp} [exampleCodeRegex] See docs
|
|
66
|
+
* @property {string|RegExp} [rejectExampleCodeRegex] See docs
|
|
67
|
+
* @property {string[]} [allowedLanguagesToProcess] See docs
|
|
68
|
+
* @property {"script"|"module"} [sourceType] See docs
|
|
69
|
+
* @property {import('eslint').Linter.ESTreeParser|import('eslint').Linter.NonESTreeParser} [parser] See docs
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* We use a function for the ability of the user to pass in a config, but
|
|
73
|
+
* without requiring all users of the plugin to do so.
|
|
74
|
+
* @param {JsdocProcessorOptions} [options]
|
|
75
|
+
* @returns {ESLint.Plugin}
|
|
76
|
+
*/
|
|
77
|
+
const getJsdocProcessorPlugin = (options = {}) => {
|
|
78
|
+
const { allowedLanguagesToProcess = [
|
|
79
|
+
"js",
|
|
80
|
+
"ts",
|
|
81
|
+
"javascript",
|
|
82
|
+
"typescript"
|
|
83
|
+
], captionRequired = false, checkDefaults = false, checkExamples = true, checkParams = false, checkProperties = false, exampleCodeRegex = null, matchingFileName = null, matchingFileNameDefaults = null, matchingFileNameParams = null, matchingFileNameProperties = null, paddedIndent = 0, parser = void 0, rejectExampleCodeRegex = null, sourceType = "module" } = options;
|
|
84
|
+
/** @type {RegExp} */
|
|
85
|
+
let exampleCodeRegExp;
|
|
86
|
+
/** @type {RegExp} */
|
|
87
|
+
let rejectExampleCodeRegExp;
|
|
88
|
+
if (exampleCodeRegex) exampleCodeRegExp = typeof exampleCodeRegex === "string" ? getRegexFromString(exampleCodeRegex) : exampleCodeRegex;
|
|
89
|
+
if (rejectExampleCodeRegex) rejectExampleCodeRegExp = typeof rejectExampleCodeRegex === "string" ? getRegexFromString(rejectExampleCodeRegex) : rejectExampleCodeRegex;
|
|
90
|
+
/**
|
|
91
|
+
* @type {{
|
|
92
|
+
* targetTagName: string,
|
|
93
|
+
* ext: string,
|
|
94
|
+
* codeStartLine: number,
|
|
95
|
+
* codeStartCol: number,
|
|
96
|
+
* nonJSPrefacingCols: number,
|
|
97
|
+
* commentLineCols: [number, number]
|
|
98
|
+
* }[]}
|
|
99
|
+
*/
|
|
100
|
+
const otherInfo = [];
|
|
101
|
+
/** @type {import('eslint').Linter.LintMessage[]} */
|
|
102
|
+
let extraMessages = [];
|
|
103
|
+
/**
|
|
104
|
+
* @param {JsdocBlockWithInline} jsdoc
|
|
105
|
+
* @param {string} jsFileName
|
|
106
|
+
* @param {[number, number]} commentLineCols
|
|
107
|
+
*/
|
|
108
|
+
const getTextsAndFileNames = (jsdoc, jsFileName, commentLineCols) => {
|
|
109
|
+
/**
|
|
110
|
+
* @type {{
|
|
111
|
+
* text: string,
|
|
112
|
+
* filename: string|null|undefined
|
|
113
|
+
* }[]}
|
|
114
|
+
*/
|
|
115
|
+
const textsAndFileNames = [];
|
|
116
|
+
/**
|
|
117
|
+
* @param {{
|
|
118
|
+
* filename: string|null,
|
|
119
|
+
* defaultFileName: string|undefined,
|
|
120
|
+
* source: string,
|
|
121
|
+
* targetTagName: string,
|
|
122
|
+
* rules?: import('eslint').Linter.RulesRecord|undefined,
|
|
123
|
+
* lines?: Integer,
|
|
124
|
+
* cols?: Integer,
|
|
125
|
+
* skipInit?: boolean,
|
|
126
|
+
* ext: string,
|
|
127
|
+
* sources?: {
|
|
128
|
+
* nonJSPrefacingCols: Integer,
|
|
129
|
+
* nonJSPrefacingLines: Integer,
|
|
130
|
+
* string: string,
|
|
131
|
+
* }[],
|
|
132
|
+
* tag?: import('comment-parser').Spec & {
|
|
133
|
+
* line?: Integer,
|
|
134
|
+
* }|{
|
|
135
|
+
* line: Integer,
|
|
136
|
+
* }
|
|
137
|
+
* }} cfg
|
|
138
|
+
*/
|
|
139
|
+
const checkSource = ({ cols = 0, defaultFileName, ext, filename, lines = 0, skipInit, source, sources = [], tag = { line: 0 }, targetTagName }) => {
|
|
140
|
+
if (!skipInit) sources.push({
|
|
141
|
+
nonJSPrefacingCols: cols,
|
|
142
|
+
nonJSPrefacingLines: lines,
|
|
143
|
+
string: source
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* @param {{
|
|
147
|
+
* nonJSPrefacingCols: Integer,
|
|
148
|
+
* nonJSPrefacingLines: Integer,
|
|
149
|
+
* string: string
|
|
150
|
+
* }} cfg
|
|
151
|
+
*/
|
|
152
|
+
const addSourceInfo = function({ nonJSPrefacingCols, nonJSPrefacingLines, string }) {
|
|
153
|
+
const src = paddedIndent ? string.replaceAll(new RegExp(`(^|\n) {${paddedIndent}}(?!$)`, "gv"), "\n") : string;
|
|
154
|
+
const file = filename || defaultFileName;
|
|
155
|
+
if (!("line" in tag)) tag.line = tag.source[0].number;
|
|
156
|
+
const codeStartLine = tag.line + nonJSPrefacingLines;
|
|
157
|
+
const codeStartCol = likelyNestedJSDocIndentSpace;
|
|
158
|
+
textsAndFileNames.push({
|
|
159
|
+
filename: file,
|
|
160
|
+
text: src
|
|
161
|
+
});
|
|
162
|
+
otherInfo.push({
|
|
163
|
+
codeStartCol,
|
|
164
|
+
codeStartLine,
|
|
165
|
+
commentLineCols,
|
|
166
|
+
ext,
|
|
167
|
+
nonJSPrefacingCols,
|
|
168
|
+
targetTagName
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
for (const targetSource of sources) addSourceInfo(targetSource);
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
*
|
|
175
|
+
* @param {string|null} filename
|
|
176
|
+
* @param {string} [ext] Since `eslint-plugin-markdown` v2, and
|
|
177
|
+
* ESLint 7, this is the default which other JS-fenced rules will used.
|
|
178
|
+
* Formerly "md" was the default.
|
|
179
|
+
* @returns {{
|
|
180
|
+
* defaultFileName: string|undefined,
|
|
181
|
+
* filename: string|null,
|
|
182
|
+
* ext: string
|
|
183
|
+
* }}
|
|
184
|
+
*/
|
|
185
|
+
const getFilenameInfo = (filename, ext = "md/*.js") => {
|
|
186
|
+
let defaultFileName;
|
|
187
|
+
if (!filename) if (typeof jsFileName === "string" && jsFileName.includes(".")) defaultFileName = jsFileName.replace(/\.[^.]*$/v, `.${ext}`);
|
|
188
|
+
else defaultFileName = `dummy.${ext}`;
|
|
189
|
+
return {
|
|
190
|
+
defaultFileName,
|
|
191
|
+
ext,
|
|
192
|
+
filename
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
if (checkDefaults) {
|
|
196
|
+
const filenameInfo = getFilenameInfo(matchingFileNameDefaults, "jsdoc-defaults");
|
|
197
|
+
forEachPreferredTag(jsdoc, "default", (tag, targetTagName) => {
|
|
198
|
+
if (!tag.description.trim()) return;
|
|
199
|
+
checkSource({
|
|
200
|
+
source: `(${getTagDescription(tag)})`,
|
|
201
|
+
targetTagName,
|
|
202
|
+
...filenameInfo
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (checkParams) {
|
|
207
|
+
const filenameInfo = getFilenameInfo(matchingFileNameParams, "jsdoc-params");
|
|
208
|
+
forEachPreferredTag(jsdoc, "param", (tag, targetTagName) => {
|
|
209
|
+
if (!tag.default || !tag.default.trim()) return;
|
|
210
|
+
checkSource({
|
|
211
|
+
source: `(${tag.default})`,
|
|
212
|
+
targetTagName,
|
|
213
|
+
...filenameInfo
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
if (checkProperties) {
|
|
218
|
+
const filenameInfo = getFilenameInfo(matchingFileNameProperties, "jsdoc-properties");
|
|
219
|
+
forEachPreferredTag(jsdoc, "property", (tag, targetTagName) => {
|
|
220
|
+
if (!tag.default || !tag.default.trim()) return;
|
|
221
|
+
checkSource({
|
|
222
|
+
source: `(${tag.default})`,
|
|
223
|
+
targetTagName,
|
|
224
|
+
...filenameInfo
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
if (!checkExamples) return textsAndFileNames;
|
|
229
|
+
const tagName = getPreferredTagName(jsdoc, { tagName: "example" });
|
|
230
|
+
if (!hasTag(jsdoc, tagName)) return textsAndFileNames;
|
|
231
|
+
const matchingFilenameInfo = getFilenameInfo(matchingFileName);
|
|
232
|
+
forEachPreferredTag(jsdoc, "example", (tag, targetTagName) => {
|
|
233
|
+
let source = getTagDescription(tag);
|
|
234
|
+
const match = source.match(hasCaptionRegex);
|
|
235
|
+
if (captionRequired && (!match || !match[1].trim())) {
|
|
236
|
+
extraMessages.push({
|
|
237
|
+
column: commentLineCols[1] + 1,
|
|
238
|
+
line: 1 + commentLineCols[0] + (tag.line ?? tag.source[0].number),
|
|
239
|
+
message: `@${targetTagName} error - Caption is expected for examples.`,
|
|
240
|
+
ruleId: "jsdoc/example-missing-caption",
|
|
241
|
+
severity: 2
|
|
242
|
+
});
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
source = source.replace(hasCaptionRegex, "");
|
|
246
|
+
const [lines, cols] = match ? getLinesCols(match[0]) : [0, 0];
|
|
247
|
+
if (exampleCodeRegex && !exampleCodeRegExp.test(source) || rejectExampleCodeRegex && rejectExampleCodeRegExp.test(source)) return;
|
|
248
|
+
if (allowedLanguagesToProcess) {
|
|
249
|
+
const matches = /^\s*```(?<language>\S+)([\s\S]*)```\s*$/v.exec(source);
|
|
250
|
+
if (matches?.groups && !allowedLanguagesToProcess.includes(matches.groups.language.toLowerCase())) return;
|
|
251
|
+
}
|
|
252
|
+
const sources = [];
|
|
253
|
+
let skipInit = false;
|
|
254
|
+
if (exampleCodeRegex) {
|
|
255
|
+
let nonJSPrefacingCols = 0;
|
|
256
|
+
let nonJSPrefacingLines = 0;
|
|
257
|
+
let startingIndex = 0;
|
|
258
|
+
let lastStringCount = 0;
|
|
259
|
+
let exampleCode;
|
|
260
|
+
exampleCodeRegExp.lastIndex = 0;
|
|
261
|
+
while ((exampleCode = exampleCodeRegExp.exec(source)) !== null) {
|
|
262
|
+
const { "0": n0, "1": n1, index } = exampleCode;
|
|
263
|
+
const preMatch = source.slice(startingIndex, index);
|
|
264
|
+
const [preMatchLines, colDelta] = getLinesCols(preMatch);
|
|
265
|
+
let nonJSPreface;
|
|
266
|
+
let nonJSPrefaceLineCount;
|
|
267
|
+
if (n1) {
|
|
268
|
+
const idx = n0.indexOf(n1);
|
|
269
|
+
nonJSPreface = n0.slice(0, idx);
|
|
270
|
+
nonJSPrefaceLineCount = countChars(nonJSPreface, "\n");
|
|
271
|
+
} else {
|
|
272
|
+
nonJSPreface = "";
|
|
273
|
+
nonJSPrefaceLineCount = 0;
|
|
274
|
+
}
|
|
275
|
+
nonJSPrefacingLines += lastStringCount + preMatchLines + nonJSPrefaceLineCount;
|
|
276
|
+
if (nonJSPrefaceLineCount) {
|
|
277
|
+
const charsInLastLine = nonJSPreface.slice(nonJSPreface.lastIndexOf("\n") + 1).length;
|
|
278
|
+
nonJSPrefacingCols += charsInLastLine;
|
|
279
|
+
} else nonJSPrefacingCols += colDelta + nonJSPreface.length;
|
|
280
|
+
const string = n1 || n0;
|
|
281
|
+
sources.push({
|
|
282
|
+
nonJSPrefacingCols,
|
|
283
|
+
nonJSPrefacingLines,
|
|
284
|
+
string
|
|
285
|
+
});
|
|
286
|
+
startingIndex = exampleCodeRegExp.lastIndex;
|
|
287
|
+
lastStringCount = countChars(string, "\n");
|
|
288
|
+
if (!exampleCodeRegExp.global) break;
|
|
289
|
+
}
|
|
290
|
+
skipInit = true;
|
|
291
|
+
}
|
|
292
|
+
checkSource({
|
|
293
|
+
cols,
|
|
294
|
+
lines,
|
|
295
|
+
skipInit,
|
|
296
|
+
source,
|
|
297
|
+
sources,
|
|
298
|
+
tag,
|
|
299
|
+
targetTagName,
|
|
300
|
+
...matchingFilenameInfo
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
return textsAndFileNames;
|
|
304
|
+
};
|
|
305
|
+
return {
|
|
306
|
+
meta: {
|
|
307
|
+
name: "eslint-plugin-jsdoc/processor",
|
|
308
|
+
version
|
|
309
|
+
},
|
|
310
|
+
processors: { examples: {
|
|
311
|
+
meta: {
|
|
312
|
+
name: "eslint-plugin-jsdoc/preprocessor",
|
|
313
|
+
version
|
|
314
|
+
},
|
|
315
|
+
postprocess([jsMessages, ...messages], filename) {
|
|
316
|
+
for (const [idx, message] of messages.entries()) {
|
|
317
|
+
const { codeStartCol, codeStartLine, commentLineCols, nonJSPrefacingCols, targetTagName } = otherInfo[idx];
|
|
318
|
+
for (const msg of message) {
|
|
319
|
+
const { column, endColumn, endLine, fatal, line, message: messageText, ruleId, severity } = msg;
|
|
320
|
+
const [codeCtxLine, codeCtxColumn] = commentLineCols;
|
|
321
|
+
const startLine = codeCtxLine + codeStartLine + line;
|
|
322
|
+
const startCol = 1 + codeCtxColumn + codeStartCol + (line <= 1 ? nonJSPrefacingCols + firstLinePrefixLength : preTagSpaceLength) + column;
|
|
323
|
+
msg.message = "@" + targetTagName + " " + (severity === 2 ? "error" : "warning") + (ruleId ? " (" + ruleId + ")" : "") + ": " + (fatal ? "Fatal: " : "") + messageText;
|
|
324
|
+
msg.line = startLine;
|
|
325
|
+
msg.column = startCol;
|
|
326
|
+
msg.endLine = endLine ? startLine + endLine : startLine;
|
|
327
|
+
msg.endColumn = endColumn ? startCol - column + endColumn : startCol;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
const ret = [...jsMessages].concat(...messages, ...extraMessages);
|
|
331
|
+
extraMessages = [];
|
|
332
|
+
return ret;
|
|
333
|
+
},
|
|
334
|
+
preprocess(text, filename) {
|
|
335
|
+
try {
|
|
336
|
+
let ast;
|
|
337
|
+
try {
|
|
338
|
+
ast = parser ? parser.parseForESLint(text, {
|
|
339
|
+
comment: true,
|
|
340
|
+
ecmaVersion: "latest",
|
|
341
|
+
sourceType
|
|
342
|
+
}).ast : espree.parse(text, {
|
|
343
|
+
comment: true,
|
|
344
|
+
ecmaVersion: "latest",
|
|
345
|
+
sourceType
|
|
346
|
+
});
|
|
347
|
+
} catch {
|
|
348
|
+
return [text];
|
|
349
|
+
}
|
|
350
|
+
/** @type {[number, number][]} */
|
|
351
|
+
const commentLineCols = [];
|
|
352
|
+
const jsdocComments = ast.comments.filter((comment) => {
|
|
353
|
+
return /^\*\s/v.test(comment.value);
|
|
354
|
+
}).map((comment) => {
|
|
355
|
+
const [start] = comment.range ?? [];
|
|
356
|
+
const textToStart = text.slice(0, start);
|
|
357
|
+
const [lines, cols] = getLinesCols(textToStart);
|
|
358
|
+
commentLineCols.push([lines, cols]);
|
|
359
|
+
return parseComment(comment);
|
|
360
|
+
});
|
|
361
|
+
return [text, ...jsdocComments.flatMap((jsdoc, idx) => {
|
|
362
|
+
return getTextsAndFileNames(jsdoc, filename, commentLineCols[idx]);
|
|
363
|
+
}).filter(
|
|
364
|
+
/**
|
|
365
|
+
* @returns {file is Linter.ProcessorFile}
|
|
366
|
+
*/
|
|
367
|
+
(file) => {
|
|
368
|
+
return file !== null && file !== void 0;
|
|
369
|
+
}
|
|
370
|
+
)];
|
|
371
|
+
} catch (error) {
|
|
372
|
+
console.log("err", filename, error);
|
|
373
|
+
}
|
|
374
|
+
return [];
|
|
375
|
+
},
|
|
376
|
+
supportsAutofix: false
|
|
377
|
+
} }
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
//#endregion
|
|
382
|
+
export { getJsdocProcessorPlugin };
|
|
383
|
+
//# sourceMappingURL=getJsdocProcessorPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getJsdocProcessorPlugin.js","names":[],"sources":["../src/getJsdocProcessorPlugin.js"],"sourcesContent":["import {\n forEachPreferredTag,\n getPreferredTagName,\n getRegexFromString,\n getTagDescription,\n hasTag,\n} from './jsdocUtils.js';\nimport {\n parseComment,\n} from '@es-joy/jsdoccomment';\nimport * as espree from 'espree';\nimport {\n readFileSync,\n} from 'node:fs';\nimport {\n join,\n} from 'node:path';\n\n/**\n * @import {\n * Integer,\n * JsdocBlockWithInline,\n * } from './iterateJsdoc.js';\n * @import {\n * ESLint,\n * Linter,\n * } from 'eslint';\n */\n\nconst {\n version,\n} = JSON.parse(\n // @ts-expect-error `Buffer` is ok for `JSON.parse`\n readFileSync(join(import.meta.dirname, '../package.json')),\n);\n\n// const zeroBasedLineIndexAdjust = -1;\nconst likelyNestedJSDocIndentSpace = 1;\nconst preTagSpaceLength = 1;\n\n// If a space is present, we should ignore it\nconst firstLinePrefixLength = preTagSpaceLength;\n\nconst hasCaptionRegex = /^\\s*<caption>([\\s\\S]*?)<\\/caption>/v;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nconst escapeStringRegexp = (str) => {\n return str.replaceAll(/[.*+?^$\\{\\}\\(\\)\\|\\[\\]\\\\]/gv, '\\\\$&');\n};\n\n/**\n * @param {string} str\n * @param {string} ch\n * @returns {Integer}\n */\nconst countChars = (str, ch) => {\n return (str.match(new RegExp(escapeStringRegexp(ch), 'gv')) || []).length;\n};\n\n/**\n * @param {string} text\n * @returns {[\n * Integer,\n * Integer\n * ]}\n */\nconst getLinesCols = (text) => {\n const matchLines = countChars(text, '\\n');\n\n const colDelta = matchLines ?\n text.slice(text.lastIndexOf('\\n') + 1).length :\n text.length;\n\n return [\n matchLines, colDelta,\n ];\n};\n\n/**\n * @typedef {number} Integer\n */\n\n/**\n * @typedef {object} JsdocProcessorOptions\n * @property {boolean} [captionRequired] Require captions for example tags\n * @property {Integer} [paddedIndent] See docs\n * @property {boolean} [checkDefaults] See docs\n * @property {boolean} [checkParams] See docs\n * @property {boolean} [checkExamples] See docs\n * @property {boolean} [checkProperties] See docs\n * @property {string} [matchingFileName] See docs\n * @property {string} [matchingFileNameDefaults] See docs\n * @property {string} [matchingFileNameParams] See docs\n * @property {string} [matchingFileNameProperties] See docs\n * @property {string|RegExp} [exampleCodeRegex] See docs\n * @property {string|RegExp} [rejectExampleCodeRegex] See docs\n * @property {string[]} [allowedLanguagesToProcess] See docs\n * @property {\"script\"|\"module\"} [sourceType] See docs\n * @property {import('eslint').Linter.ESTreeParser|import('eslint').Linter.NonESTreeParser} [parser] See docs\n */\n\n/**\n * We use a function for the ability of the user to pass in a config, but\n * without requiring all users of the plugin to do so.\n * @param {JsdocProcessorOptions} [options]\n * @returns {ESLint.Plugin}\n */\nexport const getJsdocProcessorPlugin = (options = {}) => {\n const {\n allowedLanguagesToProcess = [\n 'js', 'ts', 'javascript', 'typescript',\n ],\n captionRequired = false,\n checkDefaults = false,\n checkExamples = true,\n checkParams = false,\n checkProperties = false,\n exampleCodeRegex = null,\n matchingFileName = null,\n matchingFileNameDefaults = null,\n matchingFileNameParams = null,\n matchingFileNameProperties = null,\n paddedIndent = 0,\n parser = undefined,\n rejectExampleCodeRegex = null,\n sourceType = 'module',\n } = options;\n\n /** @type {RegExp} */\n let exampleCodeRegExp;\n /** @type {RegExp} */\n let rejectExampleCodeRegExp;\n\n if (exampleCodeRegex) {\n exampleCodeRegExp = typeof exampleCodeRegex === 'string' ?\n getRegexFromString(exampleCodeRegex) :\n exampleCodeRegex;\n }\n\n if (rejectExampleCodeRegex) {\n rejectExampleCodeRegExp = typeof rejectExampleCodeRegex === 'string' ?\n getRegexFromString(rejectExampleCodeRegex) :\n rejectExampleCodeRegex;\n }\n\n /**\n * @type {{\n * targetTagName: string,\n * ext: string,\n * codeStartLine: number,\n * codeStartCol: number,\n * nonJSPrefacingCols: number,\n * commentLineCols: [number, number]\n * }[]}\n */\n const otherInfo = [];\n\n /** @type {import('eslint').Linter.LintMessage[]} */\n let extraMessages = [];\n\n /**\n * @param {JsdocBlockWithInline} jsdoc\n * @param {string} jsFileName\n * @param {[number, number]} commentLineCols\n */\n const getTextsAndFileNames = (jsdoc, jsFileName, commentLineCols) => {\n /**\n * @type {{\n * text: string,\n * filename: string|null|undefined\n * }[]}\n */\n const textsAndFileNames = [];\n\n /**\n * @param {{\n * filename: string|null,\n * defaultFileName: string|undefined,\n * source: string,\n * targetTagName: string,\n * rules?: import('eslint').Linter.RulesRecord|undefined,\n * lines?: Integer,\n * cols?: Integer,\n * skipInit?: boolean,\n * ext: string,\n * sources?: {\n * nonJSPrefacingCols: Integer,\n * nonJSPrefacingLines: Integer,\n * string: string,\n * }[],\n * tag?: import('comment-parser').Spec & {\n * line?: Integer,\n * }|{\n * line: Integer,\n * }\n * }} cfg\n */\n const checkSource = ({\n cols = 0,\n defaultFileName,\n ext,\n filename,\n lines = 0,\n skipInit,\n source,\n sources = [],\n tag = {\n line: 0,\n },\n targetTagName,\n }) => {\n if (!skipInit) {\n sources.push({\n nonJSPrefacingCols: cols,\n nonJSPrefacingLines: lines,\n string: source,\n });\n }\n\n /**\n * @param {{\n * nonJSPrefacingCols: Integer,\n * nonJSPrefacingLines: Integer,\n * string: string\n * }} cfg\n */\n const addSourceInfo = function ({\n nonJSPrefacingCols,\n nonJSPrefacingLines,\n string,\n }) {\n const src = paddedIndent ?\n string.replaceAll(new RegExp(`(^|\\n) {${paddedIndent}}(?!$)`, 'gv'), '\\n') :\n string;\n\n // Programmatic ESLint API: https://eslint.org/docs/developer-guide/nodejs-api\n const file = filename || defaultFileName;\n\n if (!('line' in tag)) {\n tag.line = tag.source[0].number;\n }\n\n // NOTE: `tag.line` can be 0 if of form `/** @tag ... */`\n const codeStartLine = /**\n * @type {import('comment-parser').Spec & {\n * line: Integer,\n * }}\n */ (tag).line + nonJSPrefacingLines;\n const codeStartCol = likelyNestedJSDocIndentSpace;\n\n textsAndFileNames.push({\n filename: file,\n text: src,\n });\n otherInfo.push({\n codeStartCol,\n codeStartLine,\n commentLineCols,\n ext,\n nonJSPrefacingCols,\n targetTagName,\n });\n };\n\n for (const targetSource of sources) {\n addSourceInfo(targetSource);\n }\n };\n\n /**\n *\n * @param {string|null} filename\n * @param {string} [ext] Since `eslint-plugin-markdown` v2, and\n * ESLint 7, this is the default which other JS-fenced rules will used.\n * Formerly \"md\" was the default.\n * @returns {{\n * defaultFileName: string|undefined,\n * filename: string|null,\n * ext: string\n * }}\n */\n const getFilenameInfo = (filename, ext = 'md/*.js') => {\n let defaultFileName;\n if (!filename) {\n if (typeof jsFileName === 'string' && jsFileName.includes('.')) {\n defaultFileName = jsFileName.replace(/\\.[^.]*$/v, `.${ext}`);\n } else {\n defaultFileName = `dummy.${ext}`;\n }\n }\n\n return {\n defaultFileName,\n ext,\n filename,\n };\n };\n\n if (checkDefaults) {\n const filenameInfo = getFilenameInfo(matchingFileNameDefaults, 'jsdoc-defaults');\n forEachPreferredTag(jsdoc, 'default', (tag, targetTagName) => {\n if (!tag.description.trim()) {\n return;\n }\n\n checkSource({\n source: `(${getTagDescription(tag)})`,\n targetTagName,\n ...filenameInfo,\n });\n });\n }\n\n if (checkParams) {\n const filenameInfo = getFilenameInfo(matchingFileNameParams, 'jsdoc-params');\n forEachPreferredTag(jsdoc, 'param', (tag, targetTagName) => {\n if (!tag.default || !tag.default.trim()) {\n return;\n }\n\n checkSource({\n source: `(${tag.default})`,\n targetTagName,\n ...filenameInfo,\n });\n });\n }\n\n if (checkProperties) {\n const filenameInfo = getFilenameInfo(matchingFileNameProperties, 'jsdoc-properties');\n forEachPreferredTag(jsdoc, 'property', (tag, targetTagName) => {\n if (!tag.default || !tag.default.trim()) {\n return;\n }\n\n checkSource({\n source: `(${tag.default})`,\n targetTagName,\n ...filenameInfo,\n });\n });\n }\n\n if (!checkExamples) {\n return textsAndFileNames;\n }\n\n const tagName = /** @type {string} */ (getPreferredTagName(jsdoc, {\n tagName: 'example',\n }));\n if (!hasTag(jsdoc, tagName)) {\n return textsAndFileNames;\n }\n\n const matchingFilenameInfo = getFilenameInfo(matchingFileName);\n\n forEachPreferredTag(jsdoc, 'example', (tag, targetTagName) => {\n let source = /** @type {string} */ (getTagDescription(tag));\n const match = source.match(hasCaptionRegex);\n\n if (captionRequired && (!match || !match[1].trim())) {\n extraMessages.push({\n column: commentLineCols[1] + 1,\n line: 1 + commentLineCols[0] + (tag.line ?? tag.source[0].number),\n message: `@${targetTagName} error - Caption is expected for examples.`,\n ruleId: 'jsdoc/example-missing-caption',\n severity: 2,\n });\n return;\n }\n\n source = source.replace(hasCaptionRegex, '');\n const [\n lines,\n cols,\n ] = match ? getLinesCols(match[0]) : [\n 0, 0,\n ];\n\n if (exampleCodeRegex && !exampleCodeRegExp.test(source) ||\n rejectExampleCodeRegex && rejectExampleCodeRegExp.test(source)\n ) {\n return;\n }\n\n // If `allowedLanguagesToProcess` is falsy, all languages should be processed.\n if (allowedLanguagesToProcess) {\n const matches = (/^\\s*```(?<language>\\S+)([\\s\\S]*)```\\s*$/v).exec(source);\n if (matches?.groups && !allowedLanguagesToProcess.includes(\n matches.groups.language.toLowerCase(),\n )) {\n return;\n }\n }\n\n const sources = [];\n let skipInit = false;\n if (exampleCodeRegex) {\n let nonJSPrefacingCols = 0;\n let nonJSPrefacingLines = 0;\n\n let startingIndex = 0;\n let lastStringCount = 0;\n\n let exampleCode;\n exampleCodeRegExp.lastIndex = 0;\n while ((exampleCode = exampleCodeRegExp.exec(source)) !== null) {\n const {\n '0': n0,\n '1': n1,\n index,\n } = exampleCode;\n\n // Count anything preceding user regex match (can affect line numbering)\n const preMatch = source.slice(startingIndex, index);\n\n const [\n preMatchLines,\n colDelta,\n ] = getLinesCols(preMatch);\n\n let nonJSPreface;\n let nonJSPrefaceLineCount;\n if (n1) {\n const idx = n0.indexOf(n1);\n nonJSPreface = n0.slice(0, idx);\n nonJSPrefaceLineCount = countChars(nonJSPreface, '\\n');\n } else {\n nonJSPreface = '';\n nonJSPrefaceLineCount = 0;\n }\n\n nonJSPrefacingLines += lastStringCount + preMatchLines + nonJSPrefaceLineCount;\n\n // Ignore `preMatch` delta if newlines here\n if (nonJSPrefaceLineCount) {\n const charsInLastLine = nonJSPreface.slice(nonJSPreface.lastIndexOf('\\n') + 1).length;\n\n nonJSPrefacingCols += charsInLastLine;\n } else {\n nonJSPrefacingCols += colDelta + nonJSPreface.length;\n }\n\n const string = n1 || n0;\n sources.push({\n nonJSPrefacingCols,\n nonJSPrefacingLines,\n string,\n });\n startingIndex = exampleCodeRegExp.lastIndex;\n lastStringCount = countChars(string, '\\n');\n if (!exampleCodeRegExp.global) {\n break;\n }\n }\n\n skipInit = true;\n }\n\n checkSource({\n cols,\n lines,\n skipInit,\n source,\n sources,\n tag,\n targetTagName,\n ...matchingFilenameInfo,\n });\n });\n\n return textsAndFileNames;\n };\n\n // See https://eslint.org/docs/latest/extend/plugins#processors-in-plugins\n // See https://eslint.org/docs/latest/extend/custom-processors\n // From https://github.com/eslint/eslint/issues/14745#issuecomment-869457265\n /*\n {\n \"files\": [\"*.js\", \"*.ts\"],\n \"processor\": \"jsdoc/example\" // a pretended value here\n },\n {\n \"files\": [\n \"*.js/*_jsdoc-example.js\",\n \"*.ts/*_jsdoc-example.js\",\n \"*.js/*_jsdoc-example.ts\"\n ],\n \"rules\": {\n // specific rules for examples in jsdoc only here\n // And other rules for `.js` and `.ts` will also be enabled for them\n }\n }\n */\n return {\n meta: {\n name: 'eslint-plugin-jsdoc/processor',\n version,\n },\n processors: {\n examples: {\n meta: {\n name: 'eslint-plugin-jsdoc/preprocessor',\n version,\n },\n /**\n * @param {import('eslint').Linter.LintMessage[][]} messages\n * @param {string} filename\n */\n postprocess ([\n jsMessages,\n ...messages\n // eslint-disable-next-line no-unused-vars -- Placeholder\n ], filename) {\n for (const [\n idx,\n message,\n ] of messages.entries()) {\n const {\n codeStartCol,\n codeStartLine,\n commentLineCols,\n nonJSPrefacingCols,\n targetTagName,\n } = otherInfo[idx];\n\n for (const msg of message) {\n const {\n column,\n endColumn,\n endLine,\n fatal,\n line,\n message: messageText,\n ruleId,\n severity,\n\n // Todo: Make fixable\n // fix\n // fix: {range: [number, number], text: string}\n // suggestions: {desc: , messageId:, fix: }[],\n } = msg;\n\n const [\n codeCtxLine,\n codeCtxColumn,\n ] = commentLineCols;\n const startLine = codeCtxLine + codeStartLine + line;\n\n // Seems to need one more now\n const startCol = 1 +\n codeCtxColumn + codeStartCol + (\n // This might not work for line 0, but line 0 is unlikely for examples\n line <= 1 ? nonJSPrefacingCols + firstLinePrefixLength : preTagSpaceLength\n ) + column;\n\n msg.message = '@' + targetTagName + ' ' + (severity === 2 ? 'error' : 'warning') +\n (ruleId ? ' (' + ruleId + ')' : '') + ': ' +\n (fatal ? 'Fatal: ' : '') +\n messageText;\n msg.line = startLine;\n msg.column = startCol;\n msg.endLine = endLine ? startLine + endLine : startLine;\n // added `- column` to offset what `endColumn` already seemed to include\n msg.endColumn = endColumn ? startCol - column + endColumn : startCol;\n }\n }\n\n const ret = [\n ...jsMessages,\n ].concat(...messages, ...extraMessages);\n extraMessages = [];\n return ret;\n },\n\n /**\n * @param {string} text\n * @param {string} filename\n * @returns {(string | Linter.ProcessorFile)[]}\n */\n preprocess (text, filename) {\n try {\n let ast;\n\n // May be running a second time so catch and ignore\n try {\n ast = parser ?\n // @ts-expect-error Should be present\n parser.parseForESLint(text, {\n comment: true,\n ecmaVersion: 'latest',\n sourceType,\n }).ast :\n espree.parse(text, {\n comment: true,\n ecmaVersion: 'latest',\n sourceType,\n });\n } catch {\n return [\n text,\n ];\n }\n\n /** @type {[number, number][]} */\n const commentLineCols = [];\n const jsdocComments = /** @type {import('estree').Comment[]} */ (\n /**\n * @type {import('estree').Program & {\n * comments?: import('estree').Comment[]\n * }}\n */\n (ast).comments\n ).filter((comment) => {\n return (/^\\*\\s/v).test(comment.value);\n }).map((comment) => {\n const [\n start,\n /* c8 ignore next -- Unsupporting processors only? */\n ] = comment.range ?? [];\n const textToStart = text.slice(0, start);\n\n const [\n lines,\n cols,\n ] = getLinesCols(textToStart);\n\n // const lines = [...textToStart.matchAll(/\\n/gv)].length\n // const lastLinePos = textToStart.lastIndexOf('\\n');\n // const cols = lastLinePos === -1\n // ? 0\n // : textToStart.slice(lastLinePos).length;\n commentLineCols.push([\n lines, cols,\n ]);\n return parseComment(comment);\n });\n\n return [\n text,\n ...jsdocComments.flatMap((jsdoc, idx) => {\n return getTextsAndFileNames(\n jsdoc,\n filename,\n commentLineCols[idx],\n );\n }).filter(\n /**\n * @returns {file is Linter.ProcessorFile}\n */\n (file) => {\n return file !== null && file !== undefined;\n },\n ),\n ];\n /* c8 ignore next 6 */\n } catch (error) {\n // eslint-disable-next-line no-console -- Debugging\n console.log('err', filename, error);\n }\n\n return [];\n },\n // Todo: Reenable\n supportsAutofix: false,\n },\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA6BA,MAAM,EACJ,SACD,GAAG,KAAK,MAEP,aAAa,KAAK,OAAO,KAAK,SAAS,kBAAkB,CAAC,CAC3D;AAGD,MAAM,+BAA+B;AACrC,MAAM,oBAAoB;AAG1B,MAAM,wBAAwB;AAE9B,MAAM,kBAAkB;;;;;AAMxB,MAAM,qBAAqB,CAAC,QAAQ;AAClC,QAAO,IAAI,WAAW,8BAA8B,OAAO;AAC5D;;;;;;AAOD,MAAM,aAAa,CAAC,KAAK,OAAO;AAC9B,SAAQ,IAAI,MAAM,IAAI,OAAO,mBAAmB,GAAG,EAAE,MAAM,IAAI,CAAE,GAAE;AACpE;;;;;;;;AASD,MAAM,eAAe,CAAC,SAAS;CAC7B,MAAM,aAAa,WAAW,MAAM,KAAK;CAEzC,MAAM,WAAW,aACf,KAAK,MAAM,KAAK,YAAY,KAAK,GAAG,EAAE,CAAC,SACvC,KAAK;AAEP,QAAO,CACL,YAAY,QACb;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BD,MAAa,0BAA0B,CAAC,UAAU,CAAE,MAAK;CACvD,MAAM,EACJ,4BAA4B;EAC1B;EAAM;EAAM;EAAc;CAC3B,GACD,kBAAkB,OAClB,gBAAgB,OAChB,gBAAgB,MAChB,cAAc,OACd,kBAAkB,OAClB,m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