feat: cria função para retornar formatter quando filetype for typescript

This commit is contained in:
Lucas Garcia Rubio 2025-04-19 21:01:04 -03:00
parent 9ec28738f5
commit 725f770d47
1 changed files with 10 additions and 1 deletions

View File

@ -768,7 +768,16 @@ require('lazy').setup({
-- --
-- You can use 'stop_after_first' to run the first available formatter from the list -- You can use 'stop_after_first' to run the first available formatter from the list
javascript = { 'prettierd', 'prettier', 'prettierrc', stop_after_first = true }, javascript = { 'prettierd', 'prettier', 'prettierrc', stop_after_first = true },
typescript = { 'deno_fmt', 'prettier', ' prettierd', 'prettierrc', stop_after_first = true }, typescript = function()
local root_dir = vim.loop.cwd()
local deno_json_path = root_dir .. '/deno.json'
local deno_jsonc_path = root_dir .. '/deno.jsonc'
if vim.loop.fs_stat(deno_json_path) or vim.loop.fs_stat(deno_jsonc_path) then
return { 'deno_fmt' }
else
return { 'prettier', 'prettierd', 'prettierrc', stop_after_first = true }
end
end,
}, },
}, },
}, },