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

Add refactoring option to convert string concatenation to template literals #18267

Closed
alex-kinokon opened this issue Sep 6, 2017 · 7 comments · Fixed by #30565
Closed

Add refactoring option to convert string concatenation to template literals #18267

alex-kinokon opened this issue Sep 6, 2017 · 7 comments · Fixed by #30565
Labels
Committed The team has roadmapped this issue 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 Update Docs on Next Release Indicates that this PR affects docs

Comments

@alex-kinokon
Copy link

Consider adding the refactoring option to turn a string concatenation

console.log("My name is " + firstName + " " + lastName + ".");

to ES2015 template literals:

console.log(`My name is ${firstName} ${lastName}.`);
@DanielRosenwasser DanielRosenwasser added Domain: Refactorings e.g. extract to constant or function, rename symbol Suggestion An idea for TypeScript labels Sep 6, 2017
@alex-kinokon
Copy link
Author

Would you welcome a pull request for this?

@mhegazy
Copy link
Contributor

mhegazy commented May 7, 2018

Yes.

@alex-kinokon
Copy link
Author

I definitely need some help on this one...

@mhegazy
Copy link
Contributor

mhegazy commented Jun 6, 2018

I would look at https://github.com/Microsoft/TypeScript/blob/master/src/services/refactors/generateGetAccessorAndSetAccessor.ts for a reference

@bigaru
Copy link
Contributor

bigaru commented Nov 28, 2018

@glixlur is it okay for you?
If I would provide a PR for this issue

@alex-kinokon
Copy link
Author

@bigaru Yes!

@DanielRosenwasser
Copy link
Member

Thanks @bigaru!

@DanielRosenwasser DanielRosenwasser added the Update Docs on Next Release Indicates that this PR affects docs label Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Committed The team has roadmapped this issue 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 Update Docs on Next Release Indicates that this PR affects docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants