tsv 0.6 is out, near-production-ready formatters/parsers for TypeScript/JS, CSS, and Svelte - 2.2x faster than oxfmt for TS single-threaded, 3.6x CSS - wasm builds for browsers (oxfmt ships none) - CLI formatting is 3x faster than rsvelte-fmt - vscode/openvsx extension tsv.fuz.dev/docs/benchma...
Post
The format style is hardcoded to Prettier + Svelte's config which uses trailingComma:none ... save tokens! Svelte formatting also respects version 5's HTML-diverging whitespace trimming rules, making common warty cases readable (a bigger motivation for starting this project than I'd like to admit)
0 reposts0 likes
Here's a sample of complaints over the years that v5's whitespace rules finally enabled a fix for (there's a lot more than this): www.reddit.com/r/sveltejs/c... www.reddit.com/r/sveltejs/c... www.reddit.com/r/sveltejs/c... www.reddit.com/r/sveltejs/c...
Next I'm experimenting with rearchitecting to Zig-inspired data-oriented parsing - mitchellh.com/zig/parser - which should get tsv closer to Yuku's perf, and then I may have a fork of Svelte that replaces acorn/acorn-typescript with a useful speedup. HTML and JSON support soon after that.
Feedback welcome! The hardcoded formatting style is for simplicity and to avoid depending on a JS runtime for Prettier-compat config, which has perf costs and deployment downsides. Extensions: marketplace.visualstudio.com/items?itemNa... open-vsx.org/extension/fu... Repo: github.com/fuzdev/tsv