Post

Announcing Oxfmt Alpha! 🚀 We’re excited to announce the alpha release of Oxfmt, our Rust-powered formatter. We designed Oxfmt to be easily adoptable, especially for existing Prettier users More below and in our announcement post voidzero.dev/posts/announ...

voidzero.devAnnouncing Oxfmt AlphaOxfmt is a fast Rust-based formatter that is available now in alpha stage and supports JavaScript and TypeScript files. It is 30x faster than Prettier while having >95% compatibility.

not sure if feedback is useful but slight nitpick on the example given in the blog post: sorting imports is not a styling concern (and should imo not be done by a formatter). it's a semantically meaningful change, whereas a formatter is expected to never make semantically meaningful changes.

+1 Sorting imports is kind of sorting object properties. In most cases it's fine, but it actually changes semantics. Sorting imports can cause some very difficult-to-debug problems as soon as you have cycles, since then they get "de-cycled" differently and some vars suddenly start being in TDZ.

0 reposts3 likes

Merging duplicate import statements is instead something that a formatter can safely do, as long as it preserves the order in which each import occurs the first time.