Skip to content

fix(module-graph): preserve jsdoc for export declaration clauses#9677

Closed
raashish1601 wants to merge 1 commit intobiomejs:mainfrom
raashish1601:contributor-09/7635-declare-jsdoc
Closed

fix(module-graph): preserve jsdoc for export declaration clauses#9677
raashish1601 wants to merge 1 commit intobiomejs:mainfrom
raashish1601:contributor-09/7635-declare-jsdoc

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

  • preserve JSDoc when module-graph bindings come from export declaration clauses such as export declare const
  • add noDeprecatedImports regression fixtures covering deprecated declaration exports

Testing

  • rustfmt --check crates/biome_module_graph/src/js_module_info/collector.rs
  • target/debug/deps/spec_tests-afb18462c8581224.exe specs::suspicious::no_deprecated_imports --nocapture

Closes #7635.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 29, 2026

⚠️ No Changeset found

Latest commit: c592c67

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 29, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5044cce1-e4a7-408a-af8f-8036d6bd5c90

📥 Commits

Reviewing files that changed from the base of the PR and between c17e08e and c592c67.

⛔ Files ignored due to path filters (2)
  • crates/biome_js_analyze/tests/specs/suspicious/noDeprecatedImports/declare.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/suspicious/noDeprecatedImports/invalidDeclare.ts.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • crates/biome_js_analyze/tests/specs/suspicious/noDeprecatedImports/declare.ts
  • crates/biome_js_analyze/tests/specs/suspicious/noDeprecatedImports/invalidDeclare.ts
  • crates/biome_module_graph/src/js_module_info/collector.rs

Walkthrough

This PR extends the noDeprecatedImports rule to handle deprecated declarations in addition to value exports. It introduces test fixtures for the rule, including a TypeScript declaration file exporting deprecated Grid and GridValid symbols, and a corresponding import test file that should trigger diagnostics. The core fix updates the JSDoc comment finder in the module graph to recognise AnyJsDeclarationClause nodes, enabling proper deprecation detection regardless of import type.

Possibly related PRs

Suggested labels

A-Linter, A-Parser, L-JavaScript, A-Diagnostic

Suggested reviewers

  • ematipico
  • dyc3
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: preserving JSDoc for export declaration clauses in the module-graph system.
Description check ✅ Passed The description clearly relates to the changeset, outlining JSDoc preservation for export declarations and test fixtures for noDeprecatedImports.
Linked Issues check ✅ Passed The PR directly addresses issue #7635 by updating module-graph to preserve JSDoc for declaration exports, enabling noDeprecatedImports to flag deprecated declarations.
Out of Scope Changes check ✅ Passed All changes focus on fixing JSDoc preservation for export declaration clauses and adding test fixtures—both directly related to resolving issue #7635.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 29, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 224 skipped benchmarks1


Comparing raashish1601:contributor-09/7635-declare-jsdoc (c592c67) with main (5bfee36)

Open in CodSpeed

Footnotes

  1. 224 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Conaclos Conaclos added the M-Likely Agent This was likely an automated PR without a human in the loop label Mar 29, 2026
@ematipico ematipico closed this Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages M-Likely Agent This was likely an automated PR without a human in the loop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 New rule for noDeprecatedImports not working with declarations

3 participants