From a54964b04f6e6ff00dc3ea49259bd3cbc3ea3d70 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Fri, 3 Jan 2025 20:17:19 -0800 Subject: [PATCH] feat: Add support for Biome formatter --- nix/neovim-overlay.nix | 1 + nvim/lua/plugins/formatting/conform-nvim.lua | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index c3711af..c7f9875 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -129,6 +129,7 @@ with final.pkgs.lib; let # Formatters shfmt stylua + biome ]; in { # This is the neovim derivation returned by the overlay. diff --git a/nvim/lua/plugins/formatting/conform-nvim.lua b/nvim/lua/plugins/formatting/conform-nvim.lua index a263ee8..af23c11 100644 --- a/nvim/lua/plugins/formatting/conform-nvim.lua +++ b/nvim/lua/plugins/formatting/conform-nvim.lua @@ -31,10 +31,26 @@ return { return { timeout_ms = 3000, lsp_format = 'fallback' } end, + formatters_by_ft = { - lua = { 'stylua' }, + css = { 'biome' }, fish = { 'fish_indent' }, + graphql = { 'biome' }, + javascript = { 'biome' }, + javascriptreact = { 'biome' }, + json = { 'biome' }, + jsonc = { 'biome' }, + lua = { 'stylua' }, sh = { 'shfmt' }, + typescript = { 'biome' }, + typescriptreact = { 'biome' }, + vue = { 'biome' }, + }, + + formatters = { + biome = { + require_cwd = true, + }, }, })