Closed pomeh closed 10 years ago
Actually jsfmt which is based on this project does variable renaming...
This is not the target for esformatter. But it can be achieved using its dependecy: rocambole
.
You can check a module I made as example: https://github.com/leobalter/rocambole-method-rename. It's not exactly what you want but it's on the same way.
Also, the acorn
is promising as a good JS parser to solve the variable renaming problem.
Ok I understand, it's not esformatter
's job to do variable renaming.
@pgilad @leobalter thanks for the links, I didn't know about jsmft
, rocambole
and acorn
.
I have completed esformatter-rename
which should work for this functionality
another plugin: https://github.com/twolfson/esformatter-phonetic
If you really want to "be the best JavaScript code formatter" (and I want you to become it because I need this tool !!),
esformatter
should definitely support renaming variable in some form. To understand what I mean you have to check out this online but closed-source JavaScript formatter: http://www.jsnice.org. There are two things involved in this tool:I don't know if esformatter could support this second point in any form but if yes it would be really, really powerful :)