Skip to content

Suggestion: refactor to "renamed" named import #28367

@OliverJAsh

Description

@OliverJAsh

Search Terms

Suggestion

import { foo } from 'bob';

foo();

I want to rename the named import but only within this module.

This is possible via "renamed named imports".

A refactoring could update the import along with any internal references:

import { foo as mySpecialFoo } from 'bob';

mySpecialFoo();

I'm happy to help implementing this if other people are interested and someone can guide me. 😄

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: LS: Refactoringse.g. extract to constant or function, rename symbolIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions