Re:From 200K lines of CoffeeScript to zero: making decaffein...
by wereHamster on Sunday January 07, 2018 @07:05AM
(#16090535)
When I had to convert a CoffeeScript project to plain JS, I basically took the output from the coffeescript compiler, formatted it using prettify/standard and fixed up any obviously stupid things that the coffeescript compiler does by hand. Took only a few days, but it wasn't a large project either.
[ Parent
| on HN ]
Re:From 200K lines of CoffeeScript to zero: making decaffein...
by alangpierce on Sunday January 07, 2018 @10:04AM
(#16091057)
Makes sense, I've certainly heard of people taking that approach. When I started working on decaffeinate, Prettier didn't exist and ESLint autofixing could only handle very simple cases.
Out of curiosity, were you using CoffeeScript 2? As I was doing research for this post, I noticed that the CoffeeScript 2 output was pretty good compared to what I had seen with CoffeeScript 1, although I think decaffeinate still gives better results in many cases. CoffeeScript 2 also had some small breaking changes, whereas with decaffeinate I needed to stay true to the exact language semantics, so arguably decaffeinate is safer than CS2 when run on a CS1 codebase.