@depup/eslint-plugin-jsdoc 64.3.6-depup.1 → 64.3.9-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 CHANGED
@@ -13,16 +13,17 @@ 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.6 |
17
- | Processed | 2026-09-08 |
16
+ | Original | [eslint-plugin-jsdoc](https://www.npmjs.com/package/eslint-plugin-jsdoc) @ 64.3.9 |
17
+ | Processed | 2026-09-10 |
18
18
  | Smoke test | passed |
19
- | Deps updated | 1 |
19
+ | Deps updated | 2 |
20
20
 
21
21
  ## Dependency Changes
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
25
  | @typescript-eslint/utils | ^8.69.0 | ^8.70.0 |
26
+ | comment-parser | 1.4.8 | ^1.4.9 |
26
27
 
27
28
  ---
28
29
 
package/changes.json CHANGED
@@ -3,8 +3,12 @@
3
3
  "@typescript-eslint/utils": {
4
4
  "from": "^8.69.0",
5
5
  "to": "^8.70.0"
6
+ },
7
+ "comment-parser": {
8
+ "from": "1.4.8",
9
+ "to": "^1.4.9"
6
10
  }
7
11
  },
8
- "timestamp": "2026-09-08T00:33:24.758Z",
9
- "totalUpdated": 1
12
+ "timestamp": "2026-09-10T16:09:48.569Z",
13
+ "totalUpdated": 2
10
14
  }
package/package.json CHANGED
@@ -9,7 +9,7 @@
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": "1.4.8",
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",
@@ -162,18 +162,22 @@
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.6-depup.1",
165
+ "version": "64.3.9-depup.0",
166
166
  "depup": {
167
167
  "changes": {
168
168
  "@typescript-eslint/utils": {
169
169
  "from": "^8.69.0",
170
170
  "to": "^8.70.0"
171
+ },
172
+ "comment-parser": {
173
+ "from": "1.4.8",
174
+ "to": "^1.4.9"
171
175
  }
172
176
  },
173
- "depsUpdated": 1,
177
+ "depsUpdated": 2,
174
178
  "originalPackage": "eslint-plugin-jsdoc",
175
- "originalVersion": "64.3.6",
176
- "processedAt": "2026-09-08T00:33:51.285Z",
179
+ "originalVersion": "64.3.9",
180
+ "processedAt": "2026-09-10T16:10:23.622Z",
177
181
  "smokeTest": "passed"
178
182
  }
179
183
  }
@@ -151,16 +151,22 @@ export const getJsdocProcessorPlugin = (options = {}) => {
151
151
  }
152
152
 
153
153
  /**
154
- * @type {{
154
+ * @typedef {{
155
155
  * targetTagName: string,
156
156
  * ext: string,
157
157
  * codeStartLine: number,
158
158
  * codeStartCol: number,
159
159
  * nonJSPrefacingCols: number,
160
160
  * commentLineCols: [number, number]
161
- * }[]}
161
+ * }} OtherInfo
162
+ */
163
+
164
+ /**
165
+ * Keyed by filename, as the same plugin instance preprocesses many files
166
+ * (including the example files it produces) before postprocessing them.
167
+ * @type {Map<string, OtherInfo[]>}
162
168
  */
163
- const otherInfo = [];
169
+ const otherInfoByFilename = new Map();
164
170
 
165
171
  /** @type {import('eslint').Linter.LintMessage[]} */
166
172
  let extraMessages = [];
@@ -169,8 +175,9 @@ export const getJsdocProcessorPlugin = (options = {}) => {
169
175
  * @param {JsdocBlockWithInline} jsdoc
170
176
  * @param {string} jsFileName
171
177
  * @param {[number, number]} commentLineCols
178
+ * @param {OtherInfo[]} otherInfo
172
179
  */
173
- const getTextsAndFileNames = (jsdoc, jsFileName, commentLineCols) => {
180
+ const getTextsAndFileNames = (jsdoc, jsFileName, commentLineCols, otherInfo) => {
174
181
  /**
175
182
  * @type {TextAndFileName[]}
176
183
  */
@@ -529,8 +536,12 @@ export const getJsdocProcessorPlugin = (options = {}) => {
529
536
  postprocess ([
530
537
  jsMessages,
531
538
  ...messages
532
- // eslint-disable-next-line no-unused-vars -- Placeholder
533
539
  ], filename) {
540
+ const otherInfo = /** @type {OtherInfo[]} */ (
541
+ otherInfoByFilename.get(filename)
542
+ );
543
+ otherInfoByFilename.delete(filename);
544
+
534
545
  for (const [
535
546
  idx,
536
547
  message,
@@ -559,7 +570,11 @@ export const getJsdocProcessorPlugin = (options = {}) => {
559
570
  // fix: {range: [number, number], text: string}
560
571
  // suggestions: {desc: , messageId:, fix: }[],
561
572
  } = msg;
573
+
574
+ // Ranges are relative to the example file, so drop them rather
575
+ // than let them be applied to the parent file
562
576
  delete msg.fix;
577
+ delete msg.suggestions;
563
578
 
564
579
  const [
565
580
  codeCtxLine,
@@ -600,6 +615,10 @@ export const getJsdocProcessorPlugin = (options = {}) => {
600
615
  */
601
616
  preprocess (text, filename) {
602
617
  try {
618
+ /** @type {OtherInfo[]} */
619
+ const otherInfo = [];
620
+ otherInfoByFilename.set(filename, otherInfo);
621
+
603
622
  let ast;
604
623
 
605
624
  // May be running a second time so catch and ignore
@@ -663,6 +682,7 @@ export const getJsdocProcessorPlugin = (options = {}) => {
663
682
  jsdoc,
664
683
  filename,
665
684
  commentLineCols[idx],
685
+ otherInfo,
666
686
  );
667
687
  }).filter(
668
688
  /**
@@ -482,31 +482,35 @@ export default iterateJsdoc(({
482
482
  .concat(tsModuleVariables)
483
483
  .concat(/** @type {string[]} */ (definedPreferredTypes))
484
484
  .concat((() => {
485
- // Other methods are not in scope, but we need them, and we grab them here
486
- if (node?.type === 'MethodDefinition') {
487
- return /** @type {import('estree').ClassBody} */ (node.parent).body.flatMap((methodOrProp) => {
488
- if (methodOrProp.type === 'MethodDefinition') {
489
- // eslint-disable-next-line unicorn/no-lonely-if -- Pattern
490
- if (methodOrProp.key.type === 'Identifier') {
491
- return [
492
- methodOrProp.key.name,
493
- `${/** @type {import('estree').ClassDeclaration} */ (
494
- node.parent?.parent
495
- )?.id?.name}.${methodOrProp.key.name}`,
496
- ];
497
- }
498
- }
485
+ // Other class members are not in scope, but we need them (e.g., for a
486
+ // sibling property or method referenced by `{@link}`, or a member
487
+ // referenced by `{@link}` from the class's own JSDoc block), and we
488
+ // grab them here
489
+ /** @type {import('estree').ClassBody|undefined} */
490
+ let classBody;
491
+ /** @type {string|undefined} */
492
+ let className;
493
+ if (node?.type === 'MethodDefinition' || node?.type === 'PropertyDefinition') {
494
+ classBody = /** @type {import('estree').ClassBody} */ (node.parent);
495
+ className = /** @type {import('estree').ClassDeclaration} */ (
496
+ node.parent?.parent
497
+ )?.id?.name;
498
+ } else if (node?.type === 'ClassDeclaration' || node?.type === 'ClassExpression') {
499
+ classBody = node.body;
500
+ className = node.id?.name;
501
+ }
499
502
 
500
- if (methodOrProp.type === 'PropertyDefinition') {
501
- // eslint-disable-next-line unicorn/no-lonely-if -- Pattern
502
- if (methodOrProp.key.type === 'Identifier') {
503
- return [
504
- methodOrProp.key.name,
505
- `${/** @type {import('estree').ClassDeclaration} */ (
506
- node.parent?.parent
507
- )?.id?.name}.${methodOrProp.key.name}`,
508
- ];
509
- }
503
+ if (classBody) {
504
+ return classBody.body.flatMap((methodOrProp) => {
505
+ if (
506
+ (methodOrProp.type === 'MethodDefinition' ||
507
+ methodOrProp.type === 'PropertyDefinition') &&
508
+ methodOrProp.key.type === 'Identifier'
509
+ ) {
510
+ return [
511
+ methodOrProp.key.name,
512
+ `${className}.${methodOrProp.key.name}`,
513
+ ];
510
514
  }
511
515
  /* c8 ignore next 2 -- Not yet built */
512
516