Native formatter integrated into TypeScript (tsgo) #2884
GkIgor
started this conversation in
Design Discussion
Replies: 1 comment
-
|
tsgo's lsp server already supports formatting - it has the capability |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
With the transition to
tsgoand the rewrite of TypeScript in Go, this seems like the ideal moment to reconsider tooling consolidation.Why?
The TypeScript ecosystem currently depends on multiple external tools for formatting and linting:
This creates: fragmentation, tooling duplication, version incompatibilities, extra maintenance overhead
Languages like Go with
gofmtand Dart have shown that having an official formatter built into the toolchain greatly simplifies the ecosystem.Proposal
Introduce a native formatter in tsgo:
tsc formattsconfig.jsonThe goal is not to replace advanced linting rules, but to: standardize formatting, reduce ecosystem complexity, remove the need for external formatters in most projects, improve performance by leveraging the native Go implementation
Why now?
The rewrite in Go already centralizes parsing, AST handling and type checking. Adding an official formatting pass at this stage would:
Even a minimally configurable formatter similar to
gofmtwould already be a huge win.Beta Was this translation helpful? Give feedback.
All reactions