summaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/deno_fmt.lua
blob: 7b48320585f957203dce264466b9eff04545c6d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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,
}