3 ms·
gofmt helped drive the demand and popularity for prettier, but people have been trying to build something like it for JS since before Go existed [0]. Prettier
by rattray 10y ago
gofmt helped drive the demand and popularity for prettier, but people have been trying to build something like it for JS since before Go existed [0].
Prettier has succeeded largely due to a better algorithm, which actually came from the haskell community, via Wadler's paper A Prettier Printer [1] (with an implementation available at [2]).
[0] js-beautify had its first commit in 2007: https://github.com/beautify-web/js-beautify/commit/e1ddc28b2ac8140047269562e375f018c58e3a7e https://github.com/beautify-web/js-beautify/commit/e1ddc28b2...
[1] https://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf https://homepages.inf.ed.ac.uk/wadler/papers/prettier/pretti... [PDF]
[2] https://hackage.haskell.org/package/wl-pprint https://hackage.haskell.org/package/wl-pprint