tsv_ts
TypeScript and JavaScript formatting, type stripping, and parsing to acorn-typescript's wire JSON — part of tsv (tsv.fuz.dev).
formatformats one source; aFormatterformats many on one thread, keeping its arenas warm between calls.striperases the types, keeping every surviving character at its line and column.parse_to_jsonparses to the wire JSON AST (the defaultjsonfeature).run_with_stackruns a call on a thread reservingSTACK_SIZE, for a thread whose stack may be too small for the deepest input tsv accepts.
use ;
This release exposes no AST: parsing returns the wire JSON — the AST as JSON in the canonical
parser's shape (acorn-typescript's), its start / end UTF-16 offsets, span-only by default (no
loc; the locations feature adds it), unlike an error's span(), a UTF-8 byte range.
JSX and TSX are not supported: JSX is never read as JSX, so a source holding it fails to parse or is misread.
The formatter is non-configurable by design: Prettier's style with printWidth 100, tabs, single
quotes, and no trailing commas. Formatting output is not frozen: it changes between releases as
formatting bugs are fixed.
API docs: docs.rs/tsv_ts.
Minimum supported Rust version: 1.94; raising it ships in a minor release. Release notes: CHANGELOG.md.
License: 0BSD