aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/djlint.lua
blob: b7a177b9a752d2728cc3a4b1838e9ad3b11ed1ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local util = require("conform.util")
---@type conform.FileFormatterConfig
return {
  meta = {
    url = "https://github.com/Riverside-Healthcare/djLint",
    description = "✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang.",
  },
  command = "djlint",
  args = function(_, ctx)
    local indent = vim.bo[ctx.buf].tabstop or 4 -- default is 4
    return { "--reformat", "--indent", indent, "-" }
  end,
  cwd = util.root_file({
    ".djlintrc",
  }),
}