Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
RFC: Convert var to let/const. #6097
Talked to @zpao about sending a PR for this. We prefer the React team have a discussion first whether they want to merge this.
We ran this transform quite successfully internally at Facebook and I figured it is time to convert React as well. I'm doing a talk in Tokyo (right now!) and figured it is a good time to do it live. Why the hell not?
All the tests are passing. I'm assuming the code in the React repo isn't clowny so eslint and the conservative codemod should handle all cases correctly. This is an RFC. I'm fine with any decision the React team is making with regards to the code style they want to enforce in this repo – feel free to either merge or close this. To people following along I will ask them to not start a bikeshedding discussion please but instead recommend running the codemod on your own projects yourself. If you do, please report any issues you find!