@depup/eslint-plugin-jsdoc 63.3.3-depup.0 → 64.0.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -11
- package/changes.json +3 -16
- package/package.json +25 -63
- package/src/index.js +3 -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
package/README.md
CHANGED
|
@@ -13,18 +13,10 @@ npm install @depup/eslint-plugin-jsdoc
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [eslint-plugin-jsdoc](https://www.npmjs.com/package/eslint-plugin-jsdoc) @
|
|
17
|
-
| Processed | 2026-08-
|
|
16
|
+
| Original | [eslint-plugin-jsdoc](https://www.npmjs.com/package/eslint-plugin-jsdoc) @ 64.0.0 |
|
|
17
|
+
| Processed | 2026-08-08 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
|
-
| Deps updated |
|
|
20
|
-
|
|
21
|
-
## Dependency Changes
|
|
22
|
-
|
|
23
|
-
| Dependency | From | To |
|
|
24
|
-
|------------|------|-----|
|
|
25
|
-
| @es-joy/jsdoccomment | ~0.91.0 | ^0.92.0 |
|
|
26
|
-
| are-docs-informative | ^0.0.2 | ^0.1.1 |
|
|
27
|
-
| escape-string-regexp | ^4.0.0 | ^5.0.0 |
|
|
19
|
+
| Deps updated | 0 |
|
|
28
20
|
|
|
29
21
|
---
|
|
30
22
|
|
package/changes.json
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bumped": {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"to": "^0.92.0"
|
|
6
|
-
},
|
|
7
|
-
"are-docs-informative": {
|
|
8
|
-
"from": "^0.0.2",
|
|
9
|
-
"to": "^0.1.1"
|
|
10
|
-
},
|
|
11
|
-
"escape-string-regexp": {
|
|
12
|
-
"from": "^4.0.0",
|
|
13
|
-
"to": "^5.0.0"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"timestamp": "2026-08-03T00:39:22.206Z",
|
|
17
|
-
"totalUpdated": 3
|
|
2
|
+
"bumped": {},
|
|
3
|
+
"timestamp": "2026-08-08T00:23:04.685Z",
|
|
4
|
+
"totalUpdated": 0
|
|
18
5
|
}
|
package/package.json
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"url": "http://gajus.com"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@es-joy/jsdoccomment": "
|
|
8
|
+
"@es-joy/jsdoccomment": "~0.93.1",
|
|
9
9
|
"@es-joy/resolve.exports": "1.2.0",
|
|
10
10
|
"are-docs-informative": "^0.1.1",
|
|
11
|
-
"comment-parser": "1.4.
|
|
11
|
+
"comment-parser": "1.4.8",
|
|
12
12
|
"debug": "^4.4.3",
|
|
13
13
|
"escape-string-regexp": "^5.0.0",
|
|
14
14
|
"espree": "^11.2.0",
|
|
@@ -23,16 +23,14 @@
|
|
|
23
23
|
"description": "JSDoc linting rules for ESLint. (with updated dependencies)",
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
26
|
-
"@babel/cli": "8.0.4",
|
|
27
26
|
"@babel/core": "8.0.1",
|
|
28
27
|
"@babel/eslint-parser": "8.0.1",
|
|
29
28
|
"@babel/plugin-transform-flow-strip-types": "8.0.1",
|
|
30
29
|
"@babel/preset-env": "8.0.2",
|
|
31
30
|
"@es-joy/escodegen": "^4.2.0",
|
|
32
|
-
"@es-joy/jsdoc-eslint-parser": "^0.
|
|
31
|
+
"@es-joy/jsdoc-eslint-parser": "^0.28.0",
|
|
33
32
|
"@eslint/core": "^1.2.1",
|
|
34
33
|
"@hkdobrev/run-if-changed": "^0.9.0",
|
|
35
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
36
34
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
37
35
|
"@semantic-release/github": "^12.0.9",
|
|
38
36
|
"@semantic-release/npm": "^13.1.5",
|
|
@@ -42,41 +40,39 @@
|
|
|
42
40
|
"@types/estree": "^1.0.9",
|
|
43
41
|
"@types/json-schema": "^7.0.15",
|
|
44
42
|
"@types/mocha": "^10.0.10",
|
|
45
|
-
"@types/node": "^26.
|
|
43
|
+
"@types/node": "^26.2.0",
|
|
46
44
|
"@types/semver": "^7.8.0",
|
|
47
45
|
"@types/spdx-expression-parse": "^4.0.0",
|
|
48
|
-
"@typescript-eslint/types": "8.
|
|
46
|
+
"@typescript-eslint/types": "8.66.0",
|
|
49
47
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
50
|
-
"babel-plugin-istanbul": "^8.0.0",
|
|
51
48
|
"babel-plugin-transform-import-meta": "^3.0.0",
|
|
52
49
|
"c8": "^12.0.0",
|
|
53
50
|
"camelcase": "^9.0.0",
|
|
54
51
|
"chai": "^6.2.2",
|
|
55
52
|
"decamelize": "^6.0.1",
|
|
56
|
-
"eslint": "10.8.
|
|
53
|
+
"eslint": "10.8.1",
|
|
57
54
|
"eslint-config-canonical": "^47.4.2",
|
|
58
55
|
"gitdown": "^4.1.1",
|
|
59
56
|
"glob": "^13.0.6",
|
|
60
57
|
"globals": "^17.9.0",
|
|
61
58
|
"husky": "^9.1.7",
|
|
62
|
-
"jsdoc-type-pratt-parser": "^
|
|
59
|
+
"jsdoc-type-pratt-parser": "^9.0.0",
|
|
63
60
|
"json-schema": "^0.4.0",
|
|
64
61
|
"json-schema-to-typescript": "^15.0.4",
|
|
65
62
|
"lint-staged": "^17.3.0",
|
|
66
|
-
"mocha": "^11.
|
|
63
|
+
"mocha": "^11.8.0",
|
|
67
64
|
"open-editor": "^6.0.0",
|
|
68
65
|
"playwright": "^1.62.1",
|
|
69
66
|
"replace": "^1.2.2",
|
|
70
67
|
"rimraf": "^6.1.3",
|
|
71
|
-
"
|
|
72
|
-
"semantic-release": "^25.0.8",
|
|
68
|
+
"semantic-release": "^25.0.9",
|
|
73
69
|
"sinon": "^22.1.0",
|
|
74
70
|
"ts-api-utils": "^2.5.0",
|
|
75
71
|
"typescript": "5.9.3",
|
|
76
|
-
"typescript-eslint": "8.
|
|
72
|
+
"typescript-eslint": "8.66.0"
|
|
77
73
|
},
|
|
78
74
|
"engines": {
|
|
79
|
-
"node": "^22.
|
|
75
|
+
"node": "^22.22.2 || >=24.15.0"
|
|
80
76
|
},
|
|
81
77
|
"keywords": [
|
|
82
78
|
"eslint-plugin-jsdoc",
|
|
@@ -94,38 +90,19 @@
|
|
|
94
90
|
"*.js": "eslint --fix"
|
|
95
91
|
},
|
|
96
92
|
"type": "module",
|
|
97
|
-
"main": "./dist/index.cjs",
|
|
98
93
|
"types": "./dist/index.d.ts",
|
|
99
94
|
"exports": {
|
|
100
95
|
".": {
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
"default": "./src/index.js"
|
|
104
|
-
},
|
|
105
|
-
"require": {
|
|
106
|
-
"types": "./dist/cjs/index.cjs.d.cts",
|
|
107
|
-
"default": "./dist/index-cjs.cjs"
|
|
108
|
-
}
|
|
96
|
+
"types": "./dist/index.d.ts",
|
|
97
|
+
"default": "./src/index.js"
|
|
109
98
|
},
|
|
110
99
|
"./getJsdocProcessorPlugin.js": {
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
"default": "./src/getJsdocProcessorPlugin.js"
|
|
114
|
-
},
|
|
115
|
-
"require": {
|
|
116
|
-
"types": "./dist/cjs/getJsdocProcessorPlugin.d.cts",
|
|
117
|
-
"default": "./dist/getJsdocProcessorPlugin.cjs"
|
|
118
|
-
}
|
|
100
|
+
"types": "./dist/getJsdocProcessorPlugin.d.ts",
|
|
101
|
+
"default": "./src/getJsdocProcessorPlugin.js"
|
|
119
102
|
},
|
|
120
103
|
"./iterateJsdoc.js": {
|
|
121
|
-
"
|
|
122
|
-
|
|
123
|
-
"default": "./src/iterateJsdoc.js"
|
|
124
|
-
},
|
|
125
|
-
"require": {
|
|
126
|
-
"types": "./dist/cjs/iterateJsdoc.d.cts",
|
|
127
|
-
"default": "./dist/iterateJsdoc.cjs"
|
|
128
|
-
}
|
|
104
|
+
"types": "./dist/iterateJsdoc.d.ts",
|
|
105
|
+
"default": "./src/iterateJsdoc.js"
|
|
129
106
|
}
|
|
130
107
|
},
|
|
131
108
|
"name": "@depup/eslint-plugin-jsdoc",
|
|
@@ -168,10 +145,8 @@
|
|
|
168
145
|
"ruleTypes": "node ./src/bin/generateRuleTypes.js",
|
|
169
146
|
"tsc": "tsc",
|
|
170
147
|
"tsc-build": "tsc -p tsconfig-prod.json",
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"build": "node ./src/bin/buildEntryFileForTS.js && rimraf ./dist && mkdir dist && pnpm rollup && NODE_ENV=production babel ./src --out-file-extension .cjs --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored && replace 'to-valid-identifier' '../to-valid-identifier.cjs' 'dist' -r --include=\"*.cjs\" && replace 'require\\(\"\\.(.*?)\\.[^.]*?\"\\)' 'require(\".$1.cjs\")' 'dist' -r --include=\"*.cjs\" && pnpm tsc-build && pnpm tsc-cjs",
|
|
174
|
-
"attw": "attw --pack .",
|
|
148
|
+
"build": "rimraf ./dist && mkdir dist && pnpm tsc-build && cp src/rules.d.ts dist/rules.d.ts",
|
|
149
|
+
"attw": "attw --profile esm-only --pack .",
|
|
175
150
|
"check-docs": "node ./src/bin/generateDocs.js --check",
|
|
176
151
|
"create-docs": "pnpm run create-options && node ./src/bin/generateDocs.js && pnpm ruleTypes",
|
|
177
152
|
"create-rule": "node ./src/bin/generateRule.js",
|
|
@@ -180,31 +155,18 @@
|
|
|
180
155
|
"inspect-config": "eslint --inspect-config",
|
|
181
156
|
"lint": "eslint",
|
|
182
157
|
"lint-fix": "eslint --fix",
|
|
183
|
-
"test-no-cov": "
|
|
158
|
+
"test-no-cov": "mocha",
|
|
184
159
|
"test": "c8 pnpm run test-no-cov",
|
|
185
160
|
"test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
|
|
186
161
|
"test-index": "pnpm run test-no-cov test/rules/index.js"
|
|
187
162
|
},
|
|
188
|
-
"version": "
|
|
163
|
+
"version": "64.0.0-depup.0",
|
|
189
164
|
"depup": {
|
|
190
|
-
"changes": {
|
|
191
|
-
|
|
192
|
-
"from": "~0.91.0",
|
|
193
|
-
"to": "^0.92.0"
|
|
194
|
-
},
|
|
195
|
-
"are-docs-informative": {
|
|
196
|
-
"from": "^0.0.2",
|
|
197
|
-
"to": "^0.1.1"
|
|
198
|
-
},
|
|
199
|
-
"escape-string-regexp": {
|
|
200
|
-
"from": "^4.0.0",
|
|
201
|
-
"to": "^5.0.0"
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
"depsUpdated": 3,
|
|
165
|
+
"changes": {},
|
|
166
|
+
"depsUpdated": 0,
|
|
205
167
|
"originalPackage": "eslint-plugin-jsdoc",
|
|
206
|
-
"originalVersion": "
|
|
207
|
-
"processedAt": "2026-08-
|
|
168
|
+
"originalVersion": "64.0.0",
|
|
169
|
+
"processedAt": "2026-08-08T00:23:21.527Z",
|
|
208
170
|
"smokeTest": "passed"
|
|
209
171
|
}
|
|
210
172
|
}
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/* AUTO-GENERATED BY build SCRIPT */
|
|
2
|
-
/* eslint-disable perfectionist/sort-imports -- For auto-generate; Do not remove */
|
|
3
|
-
import {
|
|
4
|
-
merge,
|
|
5
|
-
} from 'object-deep-merge';
|
|
6
|
-
|
|
7
1
|
import {
|
|
8
2
|
buildForbidRuleDefinition,
|
|
9
3
|
} from './buildForbidRuleDefinition.js';
|
|
@@ -83,6 +77,9 @@ import validTypes from './rules/validTypes.js';
|
|
|
83
77
|
import {
|
|
84
78
|
ESLint,
|
|
85
79
|
} from 'eslint';
|
|
80
|
+
import {
|
|
81
|
+
merge,
|
|
82
|
+
} from 'object-deep-merge';
|
|
86
83
|
import semver from 'semver';
|
|
87
84
|
|
|
88
85
|
/**
|
package/dist/WarnSettings.cjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
const WarnSettings = function () {
|
|
8
|
-
/** @type {WeakMap<object, Set<string>>} */
|
|
9
|
-
const warnedSettings = new WeakMap();
|
|
10
|
-
return {
|
|
11
|
-
/**
|
|
12
|
-
* Warn only once for each context and setting
|
|
13
|
-
* @param {import('eslint').Rule.RuleContext} context
|
|
14
|
-
* @param {string} setting
|
|
15
|
-
* @returns {boolean}
|
|
16
|
-
*/
|
|
17
|
-
hasBeenWarned(context, setting) {
|
|
18
|
-
return warnedSettings.has(context) && /** @type {Set<string>} */warnedSettings.get(context).has(setting);
|
|
19
|
-
},
|
|
20
|
-
/**
|
|
21
|
-
* @param {import('eslint').Rule.RuleContext} context
|
|
22
|
-
* @param {string} setting
|
|
23
|
-
* @returns {void}
|
|
24
|
-
*/
|
|
25
|
-
markSettingAsWarned(context, setting) {
|
|
26
|
-
// c8 ignore else
|
|
27
|
-
if (!warnedSettings.has(context)) {
|
|
28
|
-
warnedSettings.set(context, new Set());
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** @type {Set<string>} */
|
|
32
|
-
warnedSettings.get(context).add(setting);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
var _default = exports.default = WarnSettings;
|
|
37
|
-
module.exports = exports.default;
|
|
38
|
-
//# sourceMappingURL=WarnSettings.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WarnSettings.cjs","names":[],"sources":["../src/WarnSettings.js"],"sourcesContent":["const WarnSettings = function () {\n /** @type {WeakMap<object, Set<string>>} */\n const warnedSettings = new WeakMap();\n\n return {\n /**\n * Warn only once for each context and setting\n * @param {import('eslint').Rule.RuleContext} context\n * @param {string} setting\n * @returns {boolean}\n */\n hasBeenWarned (context, setting) {\n return warnedSettings.has(context) && /** @type {Set<string>} */ (\n warnedSettings.get(context)\n ).has(setting);\n },\n\n /**\n * @param {import('eslint').Rule.RuleContext} context\n * @param {string} setting\n * @returns {void}\n */\n markSettingAsWarned (context, setting) {\n // c8 ignore else\n if (!warnedSettings.has(context)) {\n warnedSettings.set(context, new Set());\n }\n\n /** @type {Set<string>} */ (warnedSettings.get(context)).add(setting);\n },\n };\n};\n\nexport default WarnSettings;\n"],"mappings":";;;;;;AAAA,MAAM,YAAY,GAAG,YAAY;EAC/B;EACA,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,CAAC;EAEpC,OAAO;IACL;AACJ;AACA;AACA;AACA;AACA;IACI,aAAa,CAAE,OAAO,EAAE,OAAO,EAAE;MAC/B,OAAO,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,0BACpC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAC3B,GAAG,CAAC,OAAO,CAAC;IAChB,CAAC;IAED;AACJ;AACA;AACA;AACA;IACI,mBAAmB,CAAE,OAAO,EAAE,OAAO,EAAE;MACrC;MACA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAChC,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC;MACxC;;MAEA;MAA4B,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAE,GAAG,CAAC,OAAO,CAAC;IACvE;EACF,CAAC;AACH,CAAC;AAAC,iCAEa,YAAY;AAAA","ignoreList":[]}
|
package/dist/alignTransform.cjs
DELETED
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _commentParser = require("comment-parser");
|
|
8
|
-
/**
|
|
9
|
-
* Transform based on https://github.com/syavorsky/comment-parser/blob/master/src/transforms/align.ts
|
|
10
|
-
*
|
|
11
|
-
* It contains some customizations to align based on the tags, and some custom options.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Detects if a line starts with a markdown list marker
|
|
16
|
-
* Supports: -, *, numbered lists (1., 2., etc.)
|
|
17
|
-
* This explicitly excludes hyphens that are part of JSDoc tag syntax
|
|
18
|
-
* @param {string} text - The text to check
|
|
19
|
-
* @param {boolean} isFirstLineOfTag - True if this is the first line (tag line)
|
|
20
|
-
* @returns {boolean} - True if the text starts with a list marker
|
|
21
|
-
*/
|
|
22
|
-
const startsWithListMarker = (text, isFirstLineOfTag = false) => {
|
|
23
|
-
// On the first line of a tag, the hyphen is typically the JSDoc separator,
|
|
24
|
-
// not a list marker
|
|
25
|
-
if (isFirstLineOfTag) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Match lines that start with optional whitespace, then a list marker
|
|
30
|
-
// - or * followed by a space
|
|
31
|
-
// or a number followed by . or ) and a space
|
|
32
|
-
return /^\s*(?:[\-*]|\d+(?:\.|\)))\s+/v.test(text);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @typedef {{
|
|
37
|
-
* hasNoTypes: boolean,
|
|
38
|
-
* maxNamedTagLength: import('./iterateJsdoc.js').Integer,
|
|
39
|
-
* maxUnnamedTagLength: import('./iterateJsdoc.js').Integer
|
|
40
|
-
* }} TypelessInfo
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
const {
|
|
44
|
-
rewireSource
|
|
45
|
-
} = _commentParser.util;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @typedef {{
|
|
49
|
-
* name: import('./iterateJsdoc.js').Integer,
|
|
50
|
-
* start: import('./iterateJsdoc.js').Integer,
|
|
51
|
-
* tag: import('./iterateJsdoc.js').Integer,
|
|
52
|
-
* type: import('./iterateJsdoc.js').Integer
|
|
53
|
-
* }} Width
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
/** @type {Width} */
|
|
57
|
-
const zeroWidth = {
|
|
58
|
-
name: 0,
|
|
59
|
-
start: 0,
|
|
60
|
-
tag: 0,
|
|
61
|
-
type: 0
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* @param {string[]} tags
|
|
66
|
-
* @param {import('./iterateJsdoc.js').Integer} index
|
|
67
|
-
* @param {import('comment-parser').Line[]} source
|
|
68
|
-
* @returns {boolean}
|
|
69
|
-
*/
|
|
70
|
-
const shouldAlign = (tags, index, source) => {
|
|
71
|
-
const tag = source[index].tokens.tag.replace('@', '');
|
|
72
|
-
const includesTag = tags.includes(tag);
|
|
73
|
-
if (includesTag) {
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
if (tag !== '') {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
for (let iterator = index; iterator >= 0; iterator--) {
|
|
80
|
-
const previousTag = source[iterator].tokens.tag.replace('@', '');
|
|
81
|
-
if (previousTag !== '') {
|
|
82
|
-
if (tags.includes(previousTag)) {
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return true;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @param {string[]} tags
|
|
93
|
-
* @returns {(
|
|
94
|
-
* width: Width,
|
|
95
|
-
* line: {
|
|
96
|
-
* tokens: import('comment-parser').Tokens
|
|
97
|
-
* },
|
|
98
|
-
* index: import('./iterateJsdoc.js').Integer,
|
|
99
|
-
* source: import('comment-parser').Line[]
|
|
100
|
-
* ) => Width}
|
|
101
|
-
*/
|
|
102
|
-
const getWidth = tags => {
|
|
103
|
-
return (width, {
|
|
104
|
-
tokens
|
|
105
|
-
}, index, source) => {
|
|
106
|
-
if (!shouldAlign(tags, index, source)) {
|
|
107
|
-
return width;
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
name: Math.max(width.name, tokens.name.length),
|
|
111
|
-
start: tokens.delimiter === '/**' ? tokens.start.length : width.start,
|
|
112
|
-
tag: Math.max(width.tag, tokens.tag.length),
|
|
113
|
-
type: Math.max(width.type, tokens.type.length)
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* @param {{
|
|
120
|
-
* description: string;
|
|
121
|
-
* tags: import('comment-parser').Spec[];
|
|
122
|
-
* problems: import('comment-parser').Problem[];
|
|
123
|
-
* }} fields
|
|
124
|
-
* @returns {TypelessInfo}
|
|
125
|
-
*/
|
|
126
|
-
const getTypelessInfo = fields => {
|
|
127
|
-
const hasNoTypes = fields.tags.every(({
|
|
128
|
-
type
|
|
129
|
-
}) => {
|
|
130
|
-
return !type;
|
|
131
|
-
});
|
|
132
|
-
const maxNamedTagLength = Math.max(...fields.tags.map(({
|
|
133
|
-
name,
|
|
134
|
-
tag
|
|
135
|
-
}) => {
|
|
136
|
-
return name.length === 0 ? -1 : tag.length;
|
|
137
|
-
}).filter(length => {
|
|
138
|
-
return length !== -1;
|
|
139
|
-
})) + 1;
|
|
140
|
-
const maxUnnamedTagLength = Math.max(...fields.tags.map(({
|
|
141
|
-
name,
|
|
142
|
-
tag
|
|
143
|
-
}) => {
|
|
144
|
-
return name.length === 0 ? tag.length : -1;
|
|
145
|
-
}).filter(length => {
|
|
146
|
-
return length !== -1;
|
|
147
|
-
})) + 1;
|
|
148
|
-
return {
|
|
149
|
-
hasNoTypes,
|
|
150
|
-
maxNamedTagLength,
|
|
151
|
-
maxUnnamedTagLength
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* @param {import('./iterateJsdoc.js').Integer} len
|
|
157
|
-
* @returns {string}
|
|
158
|
-
*/
|
|
159
|
-
const space = len => {
|
|
160
|
-
return ''.padStart(len, ' ');
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Check if a tag or any of its lines contain list markers
|
|
165
|
-
* @param {import('./iterateJsdoc.js').Integer} index - Current line index
|
|
166
|
-
* @param {import('comment-parser').Line[]} source - All source lines
|
|
167
|
-
* @returns {{hasListMarker: boolean, tagStartIndex: import('./iterateJsdoc.js').Integer}}
|
|
168
|
-
*/
|
|
169
|
-
const checkForListMarkers = (index, source) => {
|
|
170
|
-
let hasListMarker = false;
|
|
171
|
-
let tagStartIndex = index;
|
|
172
|
-
while (tagStartIndex > 0 && source[tagStartIndex].tokens.tag === '') {
|
|
173
|
-
tagStartIndex--;
|
|
174
|
-
}
|
|
175
|
-
for (let idx = tagStartIndex; idx <= index; idx++) {
|
|
176
|
-
const isFirstLine = idx === tagStartIndex;
|
|
177
|
-
if (source[idx]?.tokens?.description && startsWithListMarker(source[idx].tokens.description, isFirstLine)) {
|
|
178
|
-
hasListMarker = true;
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
return {
|
|
183
|
-
hasListMarker,
|
|
184
|
-
tagStartIndex
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Calculate extra indentation for list items relative to the first continuation line
|
|
190
|
-
* @param {import('./iterateJsdoc.js').Integer} index - Current line index
|
|
191
|
-
* @param {import('./iterateJsdoc.js').Integer} tagStartIndex - Index of the tag line
|
|
192
|
-
* @param {import('comment-parser').Line[]} source - All source lines
|
|
193
|
-
* @returns {string} - Extra indentation spaces
|
|
194
|
-
*/
|
|
195
|
-
const calculateListExtraIndent = (index, tagStartIndex, source) => {
|
|
196
|
-
// Find the first continuation line to use as baseline
|
|
197
|
-
let firstContinuationIndent = null;
|
|
198
|
-
for (let idx = tagStartIndex + 1; idx < source.length; idx++) {
|
|
199
|
-
if (source[idx].tokens.description && !source[idx].tokens.tag) {
|
|
200
|
-
firstContinuationIndent = source[idx].tokens.postDelimiter.length;
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Calculate the extra indentation of current line relative to the first continuation line
|
|
206
|
-
const currentOriginalIndent = source[index].tokens.postDelimiter.length;
|
|
207
|
-
const extraIndent = firstContinuationIndent !== null && currentOriginalIndent > firstContinuationIndent ? ' '.repeat(currentOriginalIndent - firstContinuationIndent) : '';
|
|
208
|
-
return extraIndent;
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* @param {{
|
|
213
|
-
* customSpacings: import('../src/rules/checkLineAlignment.js').CustomSpacings,
|
|
214
|
-
* tags: string[],
|
|
215
|
-
* indent: string,
|
|
216
|
-
* preserveMainDescriptionPostDelimiter: boolean,
|
|
217
|
-
* wrapIndent: string,
|
|
218
|
-
* disableWrapIndent: boolean,
|
|
219
|
-
* }} cfg
|
|
220
|
-
* @returns {(
|
|
221
|
-
* block: import('comment-parser').Block
|
|
222
|
-
* ) => import('comment-parser').Block}
|
|
223
|
-
*/
|
|
224
|
-
const alignTransform = ({
|
|
225
|
-
customSpacings,
|
|
226
|
-
disableWrapIndent,
|
|
227
|
-
indent,
|
|
228
|
-
preserveMainDescriptionPostDelimiter,
|
|
229
|
-
tags,
|
|
230
|
-
wrapIndent
|
|
231
|
-
}) => {
|
|
232
|
-
let intoTags = false;
|
|
233
|
-
/** @type {Width} */
|
|
234
|
-
let width;
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* @param {import('comment-parser').Tokens} tokens
|
|
238
|
-
* @param {TypelessInfo} typelessInfo
|
|
239
|
-
* @returns {import('comment-parser').Tokens}
|
|
240
|
-
*/
|
|
241
|
-
const alignTokens = (tokens, typelessInfo) => {
|
|
242
|
-
const nothingAfter = {
|
|
243
|
-
delim: false,
|
|
244
|
-
name: false,
|
|
245
|
-
tag: false,
|
|
246
|
-
type: false
|
|
247
|
-
};
|
|
248
|
-
if (tokens.description === '') {
|
|
249
|
-
nothingAfter.name = true;
|
|
250
|
-
tokens.postName = '';
|
|
251
|
-
if (tokens.name === '') {
|
|
252
|
-
nothingAfter.type = true;
|
|
253
|
-
tokens.postType = '';
|
|
254
|
-
if (tokens.type === '') {
|
|
255
|
-
nothingAfter.tag = true;
|
|
256
|
-
tokens.postTag = '';
|
|
257
|
-
|
|
258
|
-
/* c8 ignore next: Never happens because the !intoTags return. But it's here for consistency with the original align transform */
|
|
259
|
-
if (tokens.tag === '') {
|
|
260
|
-
nothingAfter.delim = true;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
let untypedNameAdjustment = 0;
|
|
266
|
-
let untypedTypeAdjustment = 0;
|
|
267
|
-
if (typelessInfo.hasNoTypes) {
|
|
268
|
-
nothingAfter.tag = true;
|
|
269
|
-
tokens.postTag = '';
|
|
270
|
-
if (tokens.name === '') {
|
|
271
|
-
untypedNameAdjustment = typelessInfo.maxNamedTagLength - tokens.tag.length;
|
|
272
|
-
} else {
|
|
273
|
-
untypedNameAdjustment = typelessInfo.maxNamedTagLength > typelessInfo.maxUnnamedTagLength ? 0 : Math.max(0, typelessInfo.maxUnnamedTagLength - (tokens.tag.length + tokens.name.length + 1));
|
|
274
|
-
untypedTypeAdjustment = typelessInfo.maxNamedTagLength - tokens.tag.length;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// Todo: Avoid fixing alignment of blocks with multiline wrapping of type
|
|
279
|
-
if (tokens.tag === '' && tokens.type) {
|
|
280
|
-
return tokens;
|
|
281
|
-
}
|
|
282
|
-
const spacings = {
|
|
283
|
-
postDelimiter: customSpacings?.postDelimiter || 1,
|
|
284
|
-
postName: customSpacings?.postName || 1,
|
|
285
|
-
postTag: customSpacings?.postTag || 1,
|
|
286
|
-
postType: customSpacings?.postType || 1
|
|
287
|
-
};
|
|
288
|
-
tokens.postDelimiter = nothingAfter.delim ? '' : space(spacings.postDelimiter);
|
|
289
|
-
if (!nothingAfter.tag) {
|
|
290
|
-
tokens.postTag = space(width.tag - tokens.tag.length + spacings.postTag);
|
|
291
|
-
}
|
|
292
|
-
if (!nothingAfter.type) {
|
|
293
|
-
tokens.postType = space(width.type - tokens.type.length + spacings.postType + untypedTypeAdjustment);
|
|
294
|
-
}
|
|
295
|
-
if (!nothingAfter.name) {
|
|
296
|
-
// If post name is empty for all lines (name width 0), don't add post name spacing.
|
|
297
|
-
tokens.postName = width.name === 0 ? '' : space(width.name - tokens.name.length + spacings.postName + untypedNameAdjustment);
|
|
298
|
-
}
|
|
299
|
-
return tokens;
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* @param {import('comment-parser').Line} line
|
|
304
|
-
* @param {import('./iterateJsdoc.js').Integer} index
|
|
305
|
-
* @param {import('comment-parser').Line[]} source
|
|
306
|
-
* @param {TypelessInfo} typelessInfo
|
|
307
|
-
* @param {string|false} indentTag
|
|
308
|
-
* @returns {import('comment-parser').Line}
|
|
309
|
-
*/
|
|
310
|
-
const update = (line, index, source, typelessInfo, indentTag) => {
|
|
311
|
-
/** @type {import('comment-parser').Tokens} */
|
|
312
|
-
const tokens = {
|
|
313
|
-
...line.tokens
|
|
314
|
-
};
|
|
315
|
-
if (tokens.tag !== '') {
|
|
316
|
-
intoTags = true;
|
|
317
|
-
}
|
|
318
|
-
const isEmpty = tokens.tag === '' && tokens.name === '' && tokens.type === '' && tokens.description === '';
|
|
319
|
-
|
|
320
|
-
// dangling '*/'
|
|
321
|
-
if (tokens.end === '*/' && isEmpty) {
|
|
322
|
-
tokens.start = indent + ' ';
|
|
323
|
-
return {
|
|
324
|
-
...line,
|
|
325
|
-
tokens
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
switch (tokens.delimiter) {
|
|
329
|
-
case '*':
|
|
330
|
-
tokens.start = indent + ' ';
|
|
331
|
-
break;
|
|
332
|
-
case '/**':
|
|
333
|
-
tokens.start = indent;
|
|
334
|
-
break;
|
|
335
|
-
default:
|
|
336
|
-
tokens.delimiter = '';
|
|
337
|
-
|
|
338
|
-
// compensate delimiter
|
|
339
|
-
tokens.start = indent + ' ';
|
|
340
|
-
}
|
|
341
|
-
if (!intoTags) {
|
|
342
|
-
if (tokens.description === '') {
|
|
343
|
-
tokens.postDelimiter = '';
|
|
344
|
-
} else if (!preserveMainDescriptionPostDelimiter) {
|
|
345
|
-
tokens.postDelimiter = ' ';
|
|
346
|
-
}
|
|
347
|
-
return {
|
|
348
|
-
...line,
|
|
349
|
-
tokens
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
const postHyphenSpacing = customSpacings?.postHyphen ?? 1;
|
|
353
|
-
const hyphenSpacing = /^\s*-\s+/v;
|
|
354
|
-
tokens.description = tokens.description.replace(hyphenSpacing, '-' + ''.padStart(postHyphenSpacing, ' '));
|
|
355
|
-
|
|
356
|
-
// Not align.
|
|
357
|
-
if (shouldAlign(tags, index, source)) {
|
|
358
|
-
alignTokens(tokens, typelessInfo);
|
|
359
|
-
if (!disableWrapIndent && indentTag) {
|
|
360
|
-
const {
|
|
361
|
-
hasListMarker,
|
|
362
|
-
tagStartIndex
|
|
363
|
-
} = checkForListMarkers(index, source);
|
|
364
|
-
if (hasListMarker && index > tagStartIndex) {
|
|
365
|
-
const extraIndent = calculateListExtraIndent(index, tagStartIndex, source);
|
|
366
|
-
tokens.postDelimiter += wrapIndent + extraIndent;
|
|
367
|
-
} else {
|
|
368
|
-
// Normal case: add wrapIndent after the aligned delimiter
|
|
369
|
-
tokens.postDelimiter += wrapIndent;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
return {
|
|
374
|
-
...line,
|
|
375
|
-
tokens
|
|
376
|
-
};
|
|
377
|
-
};
|
|
378
|
-
return ({
|
|
379
|
-
source,
|
|
380
|
-
...fields
|
|
381
|
-
}) => {
|
|
382
|
-
width = source.reduce(getWidth(tags), {
|
|
383
|
-
...zeroWidth
|
|
384
|
-
});
|
|
385
|
-
const typelessInfo = getTypelessInfo(fields);
|
|
386
|
-
let tagIndentMode = false;
|
|
387
|
-
return rewireSource({
|
|
388
|
-
...fields,
|
|
389
|
-
source: source.map((line, index) => {
|
|
390
|
-
const indentTag = !disableWrapIndent && tagIndentMode && !line.tokens.tag && line.tokens.description;
|
|
391
|
-
const ret = update(line, index, source, typelessInfo, indentTag);
|
|
392
|
-
if (!disableWrapIndent && line.tokens.tag) {
|
|
393
|
-
tagIndentMode = true;
|
|
394
|
-
}
|
|
395
|
-
return ret;
|
|
396
|
-
})
|
|
397
|
-
});
|
|
398
|
-
};
|
|
399
|
-
};
|
|
400
|
-
var _default = exports.default = alignTransform;
|
|
401
|
-
module.exports = exports.default;
|
|
402
|
-
//# sourceMappingURL=alignTransform.cjs.map
|