@depup/eslint-plugin-jsdoc 65.3.4-depup.0 → 65.3.6-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,7 +13,7 @@ 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) @ 65.3.4 |
16
+ | Original | [eslint-plugin-jsdoc](https://www.npmjs.com/package/eslint-plugin-jsdoc) @ 65.3.6 |
17
17
  | Processed | 2026-10-15 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 2 |
package/changes.json CHANGED
@@ -9,6 +9,6 @@
9
9
  "to": "^8.71.2"
10
10
  }
11
11
  },
12
- "timestamp": "2026-10-15T00:29:27.540Z",
12
+ "timestamp": "2026-10-15T16:11:27.506Z",
13
13
  "totalUpdated": 2
14
14
  }
@@ -15,7 +15,6 @@ export type CreatedNode = {
15
15
  special?: true;
16
16
  globalVars?: CreatedNode;
17
17
  exported?: boolean;
18
- ANONYMOUS_DEFAULT?: import("eslint").Rule.Node;
19
18
  };
20
19
  export type CreateSymbol = (node: import("eslint").Rule.Node | null, globals: CreatedNode, value: import("eslint").Rule.Node | import("@typescript-eslint/types").TSESTree.Node | null, scope?: CreatedNode | undefined, isGlobal?: boolean | SymbolOptions | undefined) => CreatedNode | null;
21
20
  export type SymbolOptions = {
package/package.json CHANGED
@@ -168,7 +168,7 @@
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": "65.3.4-depup.0",
171
+ "version": "65.3.6-depup.0",
172
172
  "depup": {
173
173
  "changes": {
174
174
  "@es-joy/jsdoccomment": {
@@ -182,8 +182,8 @@
182
182
  },
183
183
  "depsUpdated": 2,
184
184
  "originalPackage": "eslint-plugin-jsdoc",
185
- "originalVersion": "65.3.4",
186
- "processedAt": "2026-10-15T00:29:54.759Z",
185
+ "originalVersion": "65.3.6",
186
+ "processedAt": "2026-10-15T16:11:49.178Z",
187
187
  "smokeTest": "passed"
188
188
  }
189
189
  }
@@ -20,8 +20,7 @@ const debug = debugModule('requireExportJsdoc');
20
20
  * },
21
21
  * special?: true,
22
22
  * globalVars?: CreatedNode,
23
- * exported?: boolean,
24
- * ANONYMOUS_DEFAULT?: import('eslint').Rule.Node
23
+ * exported?: boolean
25
24
  * }} CreatedNode
26
25
  */
27
26
 
@@ -519,12 +518,19 @@ const mapVariables = function (node, globals, opt, isExport) {
519
518
  );
520
519
  if (symbol) {
521
520
  symbol.exported = true;
522
- /* c8 ignore next 6 */
523
521
  } else {
524
- // if (!node.id) {
525
- globals.ANONYMOUS_DEFAULT = /** @type {import('eslint').Rule.Node} */ (
526
- node.declaration
522
+ // Anonymous default export, e.g., `export default class {}` or
523
+ // `export default {}`; `default` cannot be a variable name
524
+ const anonymousSymbol = getSymbol(
525
+ /** @type {import('eslint').Rule.Node} */
526
+ (node.declaration),
527
+ globals,
528
+ globals,
527
529
  );
530
+ if (anonymousSymbol) {
531
+ anonymousSymbol.exported = true;
532
+ globals.props.default = anonymousSymbol;
533
+ }
528
534
  }
529
535
 
530
536
  break;
@@ -804,7 +810,11 @@ const findExportedNode = function (block, node, cache) {
804
810
  for (const propval of Object.values(props)) {
805
811
  const pval = /** @type {CreatedNode} */ (propval);
806
812
  blockCache.push(pval);
807
- if (pval.exported && (node === pval.value || findNode(node, pval.value))) {
813
+ if (pval.exported && (
814
+ node === pval.value || findNode(node, pval.value) ||
815
+ // Object literals, e.g., `export const obj = {method () {}}`
816
+ findNode(node, pval)
817
+ )) {
808
818
  return true;
809
819
  }
810
820
 
@@ -77,6 +77,17 @@ export default iterateJsdoc(({
77
77
  */
78
78
  const createImportInserter = (importText) => {
79
79
  return (fixer) => {
80
+ // A hashbang (`#!`) must stay on the first line
81
+ const hashbang = (/^#!.*(?:\r\n|\n)/v).exec(sourceCode.text);
82
+ if (hashbang) {
83
+ return fixer.insertTextAfterRange(
84
+ [
85
+ 0, hashbang[0].length,
86
+ ],
87
+ `${importText}${hashbang[0].endsWith('\r\n') ? '\r\n' : '\n'}`,
88
+ );
89
+ }
90
+
80
91
  const programNode = sourceCode.ast;
81
92
  const commentNodes = sourceCode.getCommentsBefore(programNode);
82
93