Pruner – A recursive, Tree-sitter powered formatter

(pruner-formatter.github.io)

1 points | by julienvincent 11 hours ago ago

1 comments

  • julienvincent 11 hours ago ago

    I've long been interested in using tree-sitter to highlight and format injected languages.

    For a while I maintained some custom formatter logic in Neovim, which uses tree-sitter, to scratch this itch of mine.

    I've since pulled this out into a standalone binary which is editor agnostic, and can be run during CI for linting.

    It turned into a really nice way to define formatting rules in a language agnostic way, and gives a lot of control to teams who want to enforce formatting for code that contains a lot of embedded languages.

    It's also extensible through WASM plugins.

    I hope you enjoy!