Skip to content

Codefix + specific error for import/export collision error added in 3.7 #33913

@sandersn

Description

@sandersn
import { X } from 'x'
export type X = X
let x: X

Errors with "Import declaration conflicts with local declaration of 'A'."

Expected behavior:
Codefix that adds an alias for X, then renames all occurences in the module:

import { X as XX } from 'x'
export type X = XX
let x: X

Actual behavior:
No codefix, and renaming X incorrectly renames the x.X in addition to the imported identifier. (in Emacs at least -- I think VS Code behaves better)

It's probably possible to codefix this automatically in all cases, but the 3.7-urgent one is one where there is also an export type X = X.

@andrewbranch I'll take this for now but let's compare notes about 3.7-beta load to figure out who does it.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions