Report duplicate declarations for import bindings kept in TypeScript output#31240
Merged
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
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
Loading