millermedeiros / esformatter

ECMAScript code beautifier/formatter
MIT License
970 stars 91 forks source link

merge with lebab #453

Closed graingert closed 8 years ago

graingert commented 8 years ago

Lebab is another tool that does JS autofixing, but focussed on fixers like let and const

https://github.com/mohebifar/lebab

millermedeiros commented 8 years ago

there is no way to implement the features we have on esformatter on top of lebab.. they use https://github.com/benjamn/recast internally - which have it's own printer/formatter...

the thing about the "printer" approach is that it receives an AST as input and it decides how to convert that AST into code... so if we "reprint" the whole program, it will be a "destructive" operation (it will remove optional tokens like "()" and all whitespaces/linebreaks)

recast/lebab could reuse esformatter tho... (the same way as jsfmt does)

graingert commented 8 years ago

Looks like everyone needs to use cst On 6 Jul 2016 03:40, "Miller Medeiros" notifications@github.com wrote:

Closed #453 https://github.com/millermedeiros/esformatter/issues/453.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/millermedeiros/esformatter/issues/453#event-713819510, or mute the thread https://github.com/notifications/unsubscribe/AAZQTMr6CHAGRmPyrbHfv4S5R0v-vo7sks5qSxWkgaJpZM4JD85T .