@depup/eslint-plugin-jsdoc 64.5.3-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 +2 -2
- package/changes.json +1 -1
- package/package.json +3 -3
- package/src/rules/noUnnecessaryTypeAssertion.js +24 -16
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ 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
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/package.json
CHANGED
|
@@ -168,13 +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
173
|
"changes": {},
|
|
174
174
|
"depsUpdated": 0,
|
|
175
175
|
"originalPackage": "eslint-plugin-jsdoc",
|
|
176
|
-
"originalVersion": "64.5.
|
|
177
|
-
"processedAt": "2026-09-
|
|
176
|
+
"originalVersion": "64.5.4",
|
|
177
|
+
"processedAt": "2026-09-19T08:10:58.054Z",
|
|
178
178
|
"smokeTest": "passed"
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -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
|
|