diff options
Diffstat (limited to 'lua')
-rw-r--r-- | lua/conform/formatters/deno_fmt.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lua/conform/formatters/deno_fmt.lua b/lua/conform/formatters/deno_fmt.lua new file mode 100644 index 0000000..7b48320 --- /dev/null +++ b/lua/conform/formatters/deno_fmt.lua @@ -0,0 +1,25 @@ +local extensions = { + javascript = "js", + javascriptreact = "jsx", + json = "json", + jsonc = "jsonc", + markdown = "md", + typescript = "ts", + typescriptreact = "tsx", +} +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://deno.land/manual/tools/formatter", + description = "Use [Deno](https://deno.land/) to format TypeScript, JavaScript/JSON and markdown.", + }, + command = "deno", + args = function(ctx) + return { + "fmt", + "-", + "--ext", + extensions[vim.bo[ctx.buf].filetype], + } + end, +} |