Skip to content

Report duplicate declarations for import bindings kept in TypeScript output#31240

Merged
Jarred-Sumner merged 11 commits into
mainfrom
farm/300bb1c9/ts-import-duplicate-binding
May 23, 2026
Merged

Report duplicate declarations for import bindings kept in TypeScript output#31240
Jarred-Sumner merged 11 commits into
mainfrom
farm/300bb1c9/ts-import-duplicate-binding

[autofix.ci] apply automated fixes

24dd355
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 23, 2026 in 25m 23s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/js_parser/scan/scan_imports.rs:343-363 False positive when redeclaring import-equals is itself elided

Annotations

Check warning on line 363 in src/js_parser/scan/scan_imports.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

False positive when redeclaring import-equals is itself elided

This check fires for `import { Foo } from './x'; import Foo = Bar.Baz;` (Foo unused, `trimUnusedImports: false`) even though the import-equals is later dropped by the `SLocal` arm — so the previous output (`import { Foo } from "./x";`) was already valid, contradicting the "error fires exactly when we previously printed invalid output" invariant. tsc rejects this input (TS2440) so the stricter behavior is defensible, but it's worth either documenting as intentional tsc-alignment or skipping the r