Changes
- feat!: require a FormatMemory to format with (#952)
- fix: format assignments in if, for and while bodies the same as elsewhere (#939)
- perf: add an AllocatorPool to reuse the memory of the parser's allocator between files (#938)
- perf: allocate the vectors created while generating in the arena (#934)
- perf: emit less for assignments that don't need the start line or the indent condition (#941)
- perf: generate and print the statements of large files a chunk at a time (#951)
- perf: only allocate the same-kind neighbors of list values when there are some (#948)
- perf: only emit the close token comments condition when there are comments (#940)
- perf: parse with oxc instead of swc (#908)
- perf: reserve the formatted text up front from the length of the file text (#949)
- perf: size pooled parser allocators to fit what they used after they grow (#947)
- perf: skip the token walk for comments when there are none and track handled comments in a bitset (#935)
- perf: use static strings for keywords and allocate the last item line state once (#942)
- perf: use the signals for conditional indents and possible newlines above a width (#944)
Install
Then in your project's dprint configuration file:
- Specify the plugin url in the
"plugins"array (can be done viadprint add typescript). - Add a
"typescript"configuration property if desired.
JS Formatting API
- JS Formatter - Browser/Deno and Node
- npm package
{ // ...etc... "typescript": { // TypeScript & JavaScript config goes here }, "excludes": [ "**/node_modules" ], "plugins": [ "npm:@dprint/typescript@0.102.0" ] }