Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sandersn opened this issue Oct 9, 2019 · 3 comments
Closed
Assignees
Labels
Bug A bug in TypeScript
Milestone

Comments

@sandersn
Copy link
Member

sandersn commented Oct 9, 2019

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.

@sandersn sandersn self-assigned this Oct 9, 2019
@sandersn sandersn added the Bug A bug in TypeScript label Oct 9, 2019
@sandersn sandersn added this to the TypeScript 3.7.0 milestone Oct 9, 2019
@andrewbranch
Copy link
Member

For cross-referencing purposes: change adding the error was introduced in #31231

@sandersn
Copy link
Member Author

So...

  1. I forgot to do this.
  2. All the existing code I know of, except protractor, is now fixed.
  3. I don't think this codefix would be that useful for new code.

@andrewbranch I'm going to close this unless you think it's worth doing.

@sandersn sandersn modified the milestones: TypeScript 3.8.1, Backlog Jan 10, 2020
@andrewbranch
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants