This shift created a new problem for me: I suddenly have a massive volume of code in languages I’ve used for decades, alongside languages I barely know. And frankly, it looks like a mess.
I tried existing formatters, but I kept hitting two walls:
- Lack of broad language support within a single tool.
- Too opinionated: most formatters give you a few toggles, but if you don't like their core philosophy, you're stuck.
So in the spirit of the age, I set out with AI to create a new formatter tool with a core written in Rust (for raw speed), Tree-sitter for AST (for its broad support) and Rhai scripts for dynamic formatting rules.
The system is set up to allow any language supported by Tree-sitter and any formatting (or linting) rules you want with the scripting interface.
Current Progress:
It’s already self-hosting (formatting its own Rust and Rhai code). I’ve also implemented initial support for Java, TS/JS, Markdown, CSS, SQL, Vue, HTML, and JSON.
Fun part? There is "fragment" formatting - for example, it can reach into Markdown and format the code blocks within the text with the matching syntax formatter.