stevearc / conform.nvim

Lightweight yet powerful formatter plugin for Neovim
MIT License
2.72k stars 142 forks source link

Using `leptosfmt` #363

Closed Rolv-Apneseth closed 4 months ago

Rolv-Apneseth commented 4 months ago

Hey, not an issue just thought I would leave this here, both in case you'd like to include it as a recipe or just for other people who come looking for this, but this is the snippet I'm using to get formatting for leptos projects to work using leptosfmt:

formatters = {
    rustfmt = {
        command = "leptosfmt",
        args = {
            "--stdin",
            "--rustfmt",
        },
    },
}

This replaces rustfmt with leptosfmt, which will still call rustfmt due to that --rustfmt flag so it still formats code outside of leptos projects just fine too.