Turn your ES5 code into readable ES6
github.com
github.com
The most complex feature in my code is the ability to turn var into let/const optimally using an esgraph-based dataflow analysis, and it also has the ability to introduce arrow functions, shorthand/method properties and classes.
It is implemented as a fork of Babel with slightly changed packaging and a bunch of ES5-to-ES6 passes.
I'm not sure if I'm going to do any further work on this, so feel free to incorporate the code into your project if you find it useful or start maintaining a fork.
It has been tested a bit but as much as it should, so it may not just work out of the box.
You can find it at https://github.com/luca-barbieri/5to6
It could definitely do with a list of supported/unsupported functionality.
The main thing with having classes is about encapsulating functionality into objects which can be tested, reused and extended as a component in its own right.
(that said, not all uses of require can be translated to import statements)
Bu on the whole I cannot really tell you how smart it is because it is in alpha stage. We need more users to test it.