cordova
cordova copied to clipboard
Use const whenever possible
I think @raphinesse and others have already put a major effort into this. I am raising this is an explicit issue in response to https://github.com/apache/cordova-osx/pull/61#issuecomment-421391594.
Yup, I've been doing that as I go. I just haven't felt it was important enough to be tackled just for the sake of it. Consider that it will create quite some diff noise and probably merge conflicts for any open PRs.
That being said, there's a tool that does these transformations for you: https://lebab.io/. Last time I checked it was a bit overzealous with the arrow functions, resulting in bad code layout. And one of the code transforms choked on our license header. So if we do this, it might be worth considering throwing something like prettier
at the code to format it uniformly (and make sure we make git blame
completely useless). @janpio Would love to do that, I hear :wink:
Of course, for var
to const
simple search and replace should work too. Then step through linter errors and change these all to let. Probably gets you 99% there with the minimal impact.
I think we can close this ticket as we had already been converting things to use const
& let
.