Skip to content

Common import/export refactorings are missing #19260

@bterlson

Description

@bterlson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: LS: Refactoringse.g. extract to constant or function, rename symbolFixedA PR has been merged for this issueSuggestionAn idea for 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