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

On rename destructuring alias all over the place #29366

Closed
ghost opened this issue Jan 11, 2019 · 2 comments
Closed

On rename destructuring alias all over the place #29366

ghost opened this issue Jan 11, 2019 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@ghost
Copy link

ghost commented Jan 11, 2019

I cannot rename a property without creating destructuring aliases all over my code base, which is madness.

In short I don't know how to refactor this without gimping my code base.

That is why I am reverting to 3.1.6.

The workaround to create an alias manually and renaming the property itsself, like in 3.1, was less work intensive, especially since aliases are more often then not not used.

TypeScript Version: 3.3.0-dev.20190111

Search Terms: property alias rename refactoring destructuring

Code

interface MyObj{
  prop:string;
}

function oneOf100UsagesMethod({prop}:MyObj){
  console.log(prop)
}

Expected behavior:
(after rename)

interface MyObj{
  prop2:string;
}

function oneOf100UsagesMethod({prop2}:MyObj){
  console.log(prop2)
}

Actual behavior:
(after rename)

interface MyObj{
  prop2:string;
}

function oneOf100UsagesMethod({prop2: prop}:MyObj){
  console.log(prop)
}
@weswigham
Copy link
Member

Duplicate of #29238

@weswigham weswigham marked this as a duplicate of #29238 Jan 11, 2019
@weswigham weswigham added the Duplicate An existing issue was already created label Jan 11, 2019
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants