@depup/eslint-plugin-jsdoc 64.5.2-depup.0 → 64.5.4-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 -10
- package/changes.json +3 -12
- package/package.json +16 -25
- package/src/rules/noUndefinedTypes.js +14 -6
- package/src/rules/noUnnecessaryTypeAssertion.js +24 -16
package/README.md
CHANGED
|
@@ -13,17 +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) @ 64.5.
|
|
17
|
-
| Processed | 2026-09-
|
|
16
|
+
| Original | [eslint-plugin-jsdoc](https://www.npmjs.com/package/eslint-plugin-jsdoc) @ 64.5.4 |
|
|
17
|
+
| Processed | 2026-09-19 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
|
-
| Deps updated |
|
|
20
|
-
|
|
21
|
-
## Dependency Changes
|
|
22
|
-
|
|
23
|
-
| Dependency | From | To |
|
|
24
|
-
|------------|------|-----|
|
|
25
|
-
| @typescript-eslint/utils | ^8.69.0 | ^8.70.0 |
|
|
26
|
-
| comment-parser | 1.4.8 | ^1.4.9 |
|
|
19
|
+
| Deps updated | 0 |
|
|
27
20
|
|
|
28
21
|
---
|
|
29
22
|
|
package/changes.json
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bumped": {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"to": "^8.70.0"
|
|
6
|
-
},
|
|
7
|
-
"comment-parser": {
|
|
8
|
-
"from": "1.4.8",
|
|
9
|
-
"to": "^1.4.9"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"timestamp": "2026-09-16T16:10:50.319Z",
|
|
13
|
-
"totalUpdated": 2
|
|
2
|
+
"bumped": {},
|
|
3
|
+
"timestamp": "2026-09-19T08:10:37.860Z",
|
|
4
|
+
"totalUpdated": 0
|
|
14
5
|
}
|
package/package.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"url": "http://gajus.com"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@es-joy/jsdoccomment": "~0.
|
|
8
|
+
"@es-joy/jsdoccomment": "~0.98.0",
|
|
9
9
|
"@es-joy/resolve.exports": "1.2.0",
|
|
10
10
|
"@typescript-eslint/utils": "^8.70.0",
|
|
11
11
|
"are-docs-informative": "^0.1.1",
|
|
12
|
-
"comment-parser": "
|
|
12
|
+
"comment-parser": "1.4.9",
|
|
13
13
|
"debug": "^4.4.3",
|
|
14
14
|
"escape-string-regexp": "^5.0.0",
|
|
15
15
|
"espree": "^11.2.0",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"description": "JSDoc linting rules for ESLint. (with updated dependencies)",
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
27
|
-
"@babel/core": "8.0.
|
|
28
|
-
"@babel/eslint-parser": "8.0.
|
|
27
|
+
"@babel/core": "8.0.5",
|
|
28
|
+
"@babel/eslint-parser": "8.0.5",
|
|
29
29
|
"@babel/plugin-transform-flow-strip-types": "8.0.1",
|
|
30
|
-
"@babel/preset-env": "8.0.
|
|
30
|
+
"@babel/preset-env": "8.0.5",
|
|
31
31
|
"@es-joy/escodegen": "^4.2.0",
|
|
32
32
|
"@es-joy/jsdoc-eslint-parser": "^0.29.0",
|
|
33
33
|
"@eslint/core": "^1.2.1",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"@types/estree": "^1.0.9",
|
|
42
42
|
"@types/json-schema": "^7.0.15",
|
|
43
43
|
"@types/mocha": "^10.0.10",
|
|
44
|
-
"@types/node": "^26.
|
|
44
|
+
"@types/node": "^26.6.1",
|
|
45
45
|
"@types/semver": "^7.8.0",
|
|
46
46
|
"@types/spdx-expression-parse": "^4.0.0",
|
|
47
|
-
"@typescript-eslint/types": "8.
|
|
47
|
+
"@typescript-eslint/types": "8.70.0",
|
|
48
48
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
49
49
|
"babel-plugin-transform-import-meta": "^3.0.0",
|
|
50
50
|
"c8": "^12.0.0",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"glob": "^13.0.6",
|
|
58
58
|
"globals": "^17.12.0",
|
|
59
59
|
"husky": "^9.1.7",
|
|
60
|
-
"jsdoc-type-pratt-parser": "^9.2.
|
|
60
|
+
"jsdoc-type-pratt-parser": "^9.2.2",
|
|
61
61
|
"json-schema": "^0.4.0",
|
|
62
62
|
"json-schema-to-typescript": "^16.0.0",
|
|
63
|
-
"lint-staged": "^17.5.
|
|
64
|
-
"mocha": "^12.0.
|
|
63
|
+
"lint-staged": "^17.5.1",
|
|
64
|
+
"mocha": "^12.0.2",
|
|
65
65
|
"open-editor": "^6.0.0",
|
|
66
66
|
"playwright": "^1.63.0",
|
|
67
67
|
"replace": "^1.2.2",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"sinon": "^22.1.0",
|
|
71
71
|
"ts-api-utils": "^2.5.0",
|
|
72
72
|
"typescript": "6.0.3",
|
|
73
|
-
"typescript-eslint": "8.
|
|
73
|
+
"typescript-eslint": "8.70.0"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": "^22.22.2 || >=24.15.0"
|
|
@@ -168,22 +168,13 @@
|
|
|
168
168
|
"test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
|
|
169
169
|
"test-index": "pnpm run test-no-cov test/rules/index.js"
|
|
170
170
|
},
|
|
171
|
-
"version": "64.5.
|
|
171
|
+
"version": "64.5.4-depup.0",
|
|
172
172
|
"depup": {
|
|
173
|
-
"changes": {
|
|
174
|
-
|
|
175
|
-
"from": "^8.69.0",
|
|
176
|
-
"to": "^8.70.0"
|
|
177
|
-
},
|
|
178
|
-
"comment-parser": {
|
|
179
|
-
"from": "1.4.8",
|
|
180
|
-
"to": "^1.4.9"
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
"depsUpdated": 2,
|
|
173
|
+
"changes": {},
|
|
174
|
+
"depsUpdated": 0,
|
|
184
175
|
"originalPackage": "eslint-plugin-jsdoc",
|
|
185
|
-
"originalVersion": "64.5.
|
|
186
|
-
"processedAt": "2026-09-
|
|
176
|
+
"originalVersion": "64.5.4",
|
|
177
|
+
"processedAt": "2026-09-19T08:10:58.054Z",
|
|
187
178
|
"smokeTest": "passed"
|
|
188
179
|
}
|
|
189
180
|
}
|
|
@@ -482,6 +482,14 @@ export default iterateJsdoc(({
|
|
|
482
482
|
.concat(tsModuleVariables)
|
|
483
483
|
.concat(/** @type {string[]} */ (definedPreferredTypes))
|
|
484
484
|
.concat((() => {
|
|
485
|
+
let nodeToCheck = node;
|
|
486
|
+
if (node?.type === 'ExportNamedDeclaration' || node?.type === 'ExportDefaultDeclaration') {
|
|
487
|
+
nodeToCheck = /** @type {import('estree').ClassDeclaration & import('eslint').Rule.NodeParentExtension} */ (
|
|
488
|
+
/** @type {import('estree').ExportNamedDeclaration & import('eslint').Rule.NodeParentExtension} */
|
|
489
|
+
(nodeToCheck)?.declaration
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
|
|
485
493
|
// Other class members are not in scope, but we need them (e.g., for a
|
|
486
494
|
// sibling property or method referenced by `{@link}`, or a member
|
|
487
495
|
// referenced by `{@link}` from the class's own JSDoc block), and we
|
|
@@ -490,14 +498,14 @@ export default iterateJsdoc(({
|
|
|
490
498
|
let classBody;
|
|
491
499
|
/** @type {string|undefined} */
|
|
492
500
|
let className;
|
|
493
|
-
if (
|
|
494
|
-
classBody = /** @type {import('estree').ClassBody} */ (
|
|
501
|
+
if (nodeToCheck?.type === 'MethodDefinition' || nodeToCheck?.type === 'PropertyDefinition') {
|
|
502
|
+
classBody = /** @type {import('estree').ClassBody} */ (nodeToCheck.parent);
|
|
495
503
|
className = /** @type {import('estree').ClassDeclaration} */ (
|
|
496
|
-
|
|
504
|
+
nodeToCheck.parent?.parent
|
|
497
505
|
)?.id?.name;
|
|
498
|
-
} else if (
|
|
499
|
-
classBody =
|
|
500
|
-
className =
|
|
506
|
+
} else if (nodeToCheck?.type === 'ClassDeclaration' || nodeToCheck?.type === 'ClassExpression') {
|
|
507
|
+
classBody = nodeToCheck.body;
|
|
508
|
+
className = nodeToCheck.id?.name;
|
|
501
509
|
}
|
|
502
510
|
|
|
503
511
|
if (classBody) {
|
|
@@ -10,24 +10,11 @@ let warned = false;
|
|
|
10
10
|
/** @type {any} */
|
|
11
11
|
let ts;
|
|
12
12
|
|
|
13
|
+
let tsAttempted = false;
|
|
14
|
+
|
|
13
15
|
// 1. Create a require function bound to the current file's URL
|
|
14
16
|
const require = createRequire(import.meta.url);
|
|
15
17
|
|
|
16
|
-
try {
|
|
17
|
-
// 2. Attempt to import the package synchronously
|
|
18
|
-
ts = require('typescript');
|
|
19
|
-
/* c8 ignore next 10 -- Guard */
|
|
20
|
-
} catch (error) {
|
|
21
|
-
// 3. Fall back gracefully if it is not installed
|
|
22
|
-
if (/** @type {{code?: string}} */ (error).code !== 'MODULE_NOT_FOUND') {
|
|
23
|
-
// Re-throw if it's a different error (e.g., syntax error inside the package)
|
|
24
|
-
throw error;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// eslint-disable-next-line no-console -- Warning user
|
|
28
|
-
console.warn('⚠️ typescript is not installed. `jsdoc/no-unnecessary-type-assertion` will not work. To disable this warning, you must disable the rule.');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
18
|
// Helper to check for standard literals and boolean/enum/template literals
|
|
32
19
|
/**
|
|
33
20
|
* @param {any} type The type is `ts.Type`
|
|
@@ -70,9 +57,30 @@ export default iterateJsdoc(({
|
|
|
70
57
|
utils,
|
|
71
58
|
// eslint-disable-next-line complexity -- Numerous type/option permutations
|
|
72
59
|
}) => {
|
|
73
|
-
/* c8 ignore next 4 -- Guard */
|
|
74
60
|
// Already handled
|
|
75
61
|
if (!ts) {
|
|
62
|
+
/* c8 ignore next 3 -- Guard (only reachable if `typescript` failed to load on a prior call) */
|
|
63
|
+
if (tsAttempted) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
try {
|
|
68
|
+
// 2. Attempt to import the package synchronously
|
|
69
|
+
ts = require('typescript');
|
|
70
|
+
/* c8 ignore next 10 -- Guard */
|
|
71
|
+
} catch (error) {
|
|
72
|
+
// 3. Fall back gracefully if it is not installed
|
|
73
|
+
if (/** @type {{code?: string}} */ (error).code !== 'MODULE_NOT_FOUND') {
|
|
74
|
+
// Re-throw if it's a different error (e.g., syntax error inside the package)
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// eslint-disable-next-line no-console -- Warning user
|
|
79
|
+
console.warn('⚠️ typescript is not installed. `jsdoc/no-unnecessary-type-assertion` will not work. To disable this warning, you must disable the rule.');
|
|
80
|
+
} finally {
|
|
81
|
+
tsAttempted = true;
|
|
82
|
+
}
|
|
83
|
+
|
|
76
84
|
return;
|
|
77
85
|
}
|
|
78
86
|
|