@depup/eslint-plugin-jsdoc 64.3.5-depup.0 → 64.3.6-depup.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/README.md CHANGED
@@ -13,10 +13,16 @@ 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.3.5 |
17
- | Processed | 2026-09-04 |
16
+ | Original | [eslint-plugin-jsdoc](https://www.npmjs.com/package/eslint-plugin-jsdoc) @ 64.3.6 |
17
+ | Processed | 2026-09-08 |
18
18
  | Smoke test | passed |
19
- | Deps updated | 0 |
19
+ | Deps updated | 1 |
20
+
21
+ ## Dependency Changes
22
+
23
+ | Dependency | From | To |
24
+ |------------|------|-----|
25
+ | @typescript-eslint/utils | ^8.69.0 | ^8.70.0 |
20
26
 
21
27
  ---
22
28
 
package/changes.json CHANGED
@@ -1,5 +1,10 @@
1
1
  {
2
- "bumped": {},
3
- "timestamp": "2026-09-04T00:48:38.238Z",
4
- "totalUpdated": 0
2
+ "bumped": {
3
+ "@typescript-eslint/utils": {
4
+ "from": "^8.69.0",
5
+ "to": "^8.70.0"
6
+ }
7
+ },
8
+ "timestamp": "2026-09-08T00:33:24.758Z",
9
+ "totalUpdated": 1
5
10
  }
package/package.json CHANGED
@@ -5,9 +5,9 @@
5
5
  "url": "http://gajus.com"
6
6
  },
7
7
  "dependencies": {
8
- "@es-joy/jsdoccomment": "~0.96.0",
8
+ "@es-joy/jsdoccomment": "~0.97.0",
9
9
  "@es-joy/resolve.exports": "1.2.0",
10
- "@typescript-eslint/utils": "^8.69.0",
10
+ "@typescript-eslint/utils": "^8.70.0",
11
11
  "are-docs-informative": "^0.1.1",
12
12
  "comment-parser": "1.4.8",
13
13
  "debug": "^4.4.3",
@@ -51,7 +51,7 @@
51
51
  "camelcase": "^9.0.0",
52
52
  "chai": "^6.2.2",
53
53
  "decamelize": "^6.0.1",
54
- "eslint": "10.9.1",
54
+ "eslint": "10.10.0",
55
55
  "eslint-config-canonical": "^47.4.2",
56
56
  "gitdown": "^4.1.1",
57
57
  "glob": "^13.0.6",
@@ -60,10 +60,10 @@
60
60
  "jsdoc-type-pratt-parser": "^9.2.1",
61
61
  "json-schema": "^0.4.0",
62
62
  "json-schema-to-typescript": "^16.0.0",
63
- "lint-staged": "^17.4.1",
63
+ "lint-staged": "^17.5.0",
64
64
  "mocha": "^12.0.0",
65
65
  "open-editor": "^6.0.0",
66
- "playwright": "^1.62.1",
66
+ "playwright": "^1.63.0",
67
67
  "replace": "^1.2.2",
68
68
  "rimraf": "^6.1.3",
69
69
  "semantic-release": "^25.0.9",
@@ -162,13 +162,18 @@
162
162
  "test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
163
163
  "test-index": "pnpm run test-no-cov test/rules/index.js"
164
164
  },
165
- "version": "64.3.5-depup.0",
165
+ "version": "64.3.6-depup.1",
166
166
  "depup": {
167
- "changes": {},
168
- "depsUpdated": 0,
167
+ "changes": {
168
+ "@typescript-eslint/utils": {
169
+ "from": "^8.69.0",
170
+ "to": "^8.70.0"
171
+ }
172
+ },
173
+ "depsUpdated": 1,
169
174
  "originalPackage": "eslint-plugin-jsdoc",
170
- "originalVersion": "64.3.5",
171
- "processedAt": "2026-09-04T00:49:00.194Z",
175
+ "originalVersion": "64.3.6",
176
+ "processedAt": "2026-09-08T00:33:51.285Z",
172
177
  "smokeTest": "passed"
173
178
  }
174
179
  }
@@ -363,6 +363,51 @@ export default iterateJsdoc(({
363
363
  checker.isTupleType(assertedType);
364
364
  };
365
365
 
366
+ /**
367
+ * An array-literal annotation whose element type is a literal (or union of
368
+ * literals) — `type {ViewType[]}` on `['single-panel', 'user']` —
369
+ * narrows the element type that the bare literal would widen (`string[]` ->
370
+ * `ViewType[]`). Like the tuple idiom, the literal takes that element type
371
+ * only *from* the annotation, so the contextually-typed initializer echoes
372
+ * the asserted array straight back and the genuine narrowing looks redundant.
373
+ * @param {any} assertedType `ts.Type`
374
+ * @param {import('@typescript-eslint/utils').TSESTree.Node | null | undefined} operand
375
+ * @returns {boolean}
376
+ */
377
+ const narrowsArrayLiteralElement = (assertedType, operand) => {
378
+ if (operand?.type !== 'ArrayExpression' || !checker.isArrayType(assertedType)) {
379
+ return false;
380
+ }
381
+
382
+ const [
383
+ elementType,
384
+ ] = checker.getTypeArguments(assertedType);
385
+ return isLiteralType(elementType);
386
+ };
387
+
388
+ /**
389
+ * Whether `operand` is an object literal carrying a method or function-valued
390
+ * property. Under a surrounding `@type` object annotation such a function is
391
+ * contextually typed by the annotation — its otherwise-implicit-`any`
392
+ * parameters (and hence its signature) come straight from it — so
393
+ * `getTypeAtLocation` echoes the asserted object shape back and a genuine
394
+ * typing looks redundant. As elsewhere in this rule the uncontaminated type
395
+ * cannot be recovered here, so such literals are left alone (at the cost of
396
+ * missing the rare object annotation that only restates a fully
397
+ * self-evident method signature).
398
+ * @param {import('@typescript-eslint/utils').TSESTree.Node | null | undefined} operand
399
+ * @returns {boolean}
400
+ */
401
+ const hasContextuallyTypedFunctionMember = (operand) => {
402
+ return operand?.type === 'ObjectExpression' &&
403
+ operand.properties.some((property) => {
404
+ return property.type === 'Property' && (
405
+ property.value.type === 'FunctionExpression' ||
406
+ property.value.type === 'ArrowFunctionExpression'
407
+ );
408
+ });
409
+ };
410
+
366
411
  /**
367
412
  * Whether every element of `tupleType` is a literal type, so a `const`
368
413
  * assertion would reproduce the same element types (`['foo', 1]` but not
@@ -445,6 +490,13 @@ export default iterateJsdoc(({
445
490
  return;
446
491
  }
447
492
 
493
+ if (
494
+ narrowsArrayLiteralElement(declAssertedType, decl.init) ||
495
+ hasContextuallyTypedFunctionMember(decl.init)
496
+ ) {
497
+ return;
498
+ }
499
+
448
500
  if (isRedundantAssertion(declInferredType, declAssertedType)) {
449
501
  utils.reportJSDoc(message, types[0], fixer, true, {
450
502
  type: assertedTypeStr,
@@ -522,6 +574,13 @@ export default iterateJsdoc(({
522
574
  return;
523
575
  }
524
576
 
577
+ if (
578
+ narrowsArrayLiteralElement(castAssertedType, node) ||
579
+ hasContextuallyTypedFunctionMember(node)
580
+ ) {
581
+ return;
582
+ }
583
+
525
584
  if (!isRedundantAssertion(castInferredType, castAssertedType)) {
526
585
  return;
527
586
  }
@@ -34,7 +34,6 @@ import {
34
34
  /** @type {import('json-schema').JSONSchema4} */
35
35
  const OPTIONS_SCHEMA = {
36
36
  additionalProperties: false,
37
- description: 'Has the following optional keys.\n',
38
37
  properties: {
39
38
  checkAllFunctionExpressions: {
40
39
  default: false,