Repository navigation
Codefix: convert const to let #22473
Description
Activity
- addedSuggestionAn idea for TypeScriptAn idea for TypeScriptHelp WantedYou can do thisYou can do thisGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightDomain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.
on Mar 30, 2018 Can I take this one?
DanielRosenwasser commented
on Apr 3, 2018 MemberMore actionsGo for it!
Chris Weaver (@MagWeaver) any news from this?
Daniel Rosenwasser (@DanielRosenwasser) Can I please take over if it's possible?
ThanksGo for it.
Mohamed Hegazy (@mhegazy) Can I please get some help getting started? Which files should I be looking at?
ThanksQuick fixes are attached to diagnostics. in this case
TS Error 2540: Cannot assign to 'x' because it is a constant or a read-only property.You can take a look at https://github.com/Microsoft/TypeScript/blob/master/src/services/codefixes/fixAwaitInSyncFunction.ts and https://github.com/Microsoft/TypeScript/blob/master/src/services/codefixes/fixSpelling.ts for a guide to how a quick fix can be implemented.
Also you will need to add handling for the
readonlyproperty case, where thereadonlymodifier would be removed.Singh Sandhu (@Fatehsandhu) Still working on this? If not I'd like to take a shot at it :)
Hey Mohamed Hegazy (@mhegazy), I have a potential fix for this here , but I couldn't find solid diagnostic messages to use and haven't figured out the readonly case yet though. Just wanted to check in with you to get some info about creating diagnostic messages and see if I'm on the right track here, thanks!
suhailsinghbains commented
on Oct 5, 2018 More actionsHi,
I'm new to open-source, can I please solve this issue?
ThanksSuhail Singh Bains (@suhailsinghbains) I'm currently working on this one and am close to completing so your time may be better spent on another one. I'll let you know if anything changes however.
suhailsinghbains commented
on Oct 5, 2018 More actionsSure M (@muradkhan101)
TypeScript Version: 2.8.0-dev.20180308
Search Terms:
const let codefix
Code
Expected behavior:
Error with codefix offered at 1 to convert the declaration from
consttoletActual behavior:
Just an error, no codefix
Related Issues:
The exact opposite of #13133