Turn your ES5 code into readable ES6
github.com
Turn your ES5 code into readable ES6
1–10 of 31 posts
Re: Turn your ES5 code into readable ES6
#2Re: Turn your ES5 code into readable ES6
#3Re: Turn your ES5 code into readable ES6
#4Re: Turn your ES5 code into readable ES6
#5Re: Turn your ES5 code into readable ES6
#6Hmm. How smart is it? Can it detect when some usage of prototypes is not class-like and not convert it to an ES6 class?
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.
Re: Turn your ES5 code into readable ES6
#7There's also this one https://github.com/mping/5to6
Re: Turn your ES5 code into readable ES6
#8Re: Turn your ES5 code into readable ES6
#9Interesting idea, but the backwards compatibility of ES6 means that you can refactor a project piece by piece as you work on it - IMO that's a better approach.
It could definitely do with a list of supported/unsupported functionality.
Re: Turn your ES5 code into readable ES6
#10The 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