Skip to content
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

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

Closed
sandersn opened this issue Oct 9, 2019 · 3 comments
Closed

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

sandersn opened this issue Oct 9, 2019 · 3 comments
Assignees
Labels
Bug
Milestone

Comments

@sandersn
Copy link
Member

@sandersn 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 label Oct 9, 2019
@sandersn sandersn added this to the TypeScript 3.7.0 milestone Oct 9, 2019
@andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Oct 9, 2019

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

@RyanCavanaugh RyanCavanaugh removed this from the TypeScript 3.7.0 milestone Oct 14, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.7.1 milestone Oct 14, 2019
@sandersn sandersn added this to Not started in Rolling Work Tracking Oct 15, 2019
@sandersn sandersn moved this from Not started to Feature in Rolling Work Tracking Oct 15, 2019
@sandersn sandersn removed this from the TypeScript 3.7.1 milestone Oct 15, 2019
@sandersn sandersn added this to the TypeScript 3.8.0 milestone Oct 15, 2019
@RyanCavanaugh RyanCavanaugh removed this from the TypeScript 3.8.0 milestone Jan 7, 2020
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.8.1 milestone Jan 7, 2020
@sandersn
Copy link
Member Author

@sandersn sandersn commented Jan 10, 2020

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 removed this from the TypeScript 3.8.1 milestone Jan 10, 2020
@sandersn sandersn added this to the Backlog milestone Jan 10, 2020
@andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Jan 10, 2020

👍

@sandersn sandersn closed this Jan 10, 2020
Rolling Work Tracking automation moved this from Feature to Done Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug
Projects
Development

No branches or pull requests

3 participants