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

Common import/export refactorings are missing #19260

Closed
bterlson opened this issue Oct 17, 2017 · 2 comments
Closed

Common import/export refactorings are missing #19260

bterlson opened this issue Oct 17, 2017 · 2 comments
Labels
Domain: Refactorings e.g. extract to constant or function, rename symbol Fixed A PR has been merged for this issue Suggestion An idea for TypeScript

Comments

@bterlson
Copy link
Member

bterlson commented Oct 17, 2017

There are two scenarios that come up for me all the time that presently don't have refactoring support:

  1. Refactoring a named export into the default export and vice versa
  2. Refactoring a bunch of explicit named imports into a namespace import and vice versa

Commentary:

I think both of these refactorings would be helpful and be used frequently. 1 is important to me because I can't decide on the shape of a module's exports until its export surface area is complete, and I switch between the two frequently during development.

2 is important to me when a module's named exports grow and grow and on the import side and I finally reach a point where I would like to move to a namespace import to avoid having to name every single import. This transformation is very painful to do by hand.

@amcasey
Copy link
Member

amcasey commented Jan 11, 2018

@andy-ms I remember you implementing some import conversion refactorings. Have some of these points already been addressed?

@ghost
Copy link

ghost commented Jan 11, 2018

I haven't done either of the refactorings listed above. I did do a PR that converts from commonJS to ES6 modules (#19916), but the suggested refactorings would work entirely within ES6 modules already, so it's unrelated.

@mhegazy mhegazy modified the milestones: TypeScript 2.8, TypeScript 2.9 Mar 9, 2018
@mhegazy mhegazy removed this from the TypeScript 2.9 milestone Apr 26, 2018
@mhegazy mhegazy assigned ghost and unassigned amcasey Apr 26, 2018
@mhegazy mhegazy added this to the TypeScript 3.0 milestone Apr 26, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Jun 11, 2018
@ghost ghost closed this as completed in #24878 Jun 25, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Refactorings e.g. extract to constant or function, rename symbol Fixed A PR has been merged for this issue Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants