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 codefix to make non-reassignable variables reassignable #27593

Closed
wants to merge 5 commits into from

Conversation

muradkhan101
Copy link

@muradkhan101 muradkhan101 commented Oct 7, 2018

Adds a codefix for the scenarios where a user attempts to re-assign a variable that was declared as const or property that was declared readonly. In the former, it changes the initial declaration to type let and in the latter, it removes the readonly modifier.

Added one more diagnostic message as well since, I couldn't find one that fit well enough for the fix all option.

Fixes #22473

@muradkhan101
Copy link
Author

muradkhan101 commented Oct 7, 2018

Hmmm, anyone have a good idea about why the tests would fail on Travis but succeed on my local machine?

Edit: Found out I forgot to include my codefix file in the tsconfig

@muradkhan101
Copy link
Author

@DanielRosenwasser I updated the PR and implemented the changes you recommended. Thanks for the info btw, it really helped to clean up the logic and simplify it a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codefix: convert const to let
2 participants