Skip to content

Rename Symbol is messing up object literal shorthand #673

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

Closed
lordnox opened this issue Aug 30, 2018 · 1 comment
Closed

Rename Symbol is messing up object literal shorthand #673

lordnox opened this issue Aug 30, 2018 · 1 comment

Comments

@lordnox
Copy link

lordnox commented Aug 30, 2018

Example Code:

interface ITest {
  x: number
}
const createTest = (): ITest => {
  const x = Math.random()
  return {
    x,
  }
}

When trying to rename const x to const rnd the code will become:

interface ITest {
  x: number
}
const createTest = (): ITest => {
  const rnd = Math.random()
  return {
    rnd,
  }
}

This does kind of do the right thing, but changes the return type of the function and should actually become:

interface ITest {
  x: number
}
const createTest = (): ITest => {
  const rnd = Math.random()
  return {
    x: rnd,
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants