feat(conform): add more formatters

This commit is contained in:
Oliver Ladner 2025-03-28 13:43:19 +01:00
commit 23fe78acec

View file

@ -1,34 +1,35 @@
-- Some things are from https://www.josean.com/posts/neovim-linting-and-formatting -- Some things are from https://www.josean.com/posts/neovim-linting-and-formatting
return { return {
"stevearc/conform.nvim", "stevearc/conform.nvim",
tag = "stable", tag = "stable",
opts = {}, opts = {},
config = function() config = function()
local conform = require("conform") local conform = require("conform")
conform.setup({ conform.setup({
-- formatters_by_ft = { formatters_by_ft = {
formatters = { javascript = { "prettier" },
javascript = { "prettier" }, typescript = { "prettier" },
typescript = { "prettier" }, javascriptreact = { "prettier" },
javascriptreact = { "prettier" }, typescriptreact = { "prettier" },
typescriptreact = { "prettier" }, svelte = { "prettier" },
svelte = { "prettier" }, css = { "prettier" },
css = { "prettier" }, html = { "prettier" },
html = { "prettier" }, json = { "prettier" },
json = { "prettier" }, yaml = { "prettier" },
yaml = { "prettier" }, markdown = { "prettier" },
markdown = { "prettier" }, graphql = { "prettier" },
graphql = { "prettier" }, lua = { "stylua" },
lua = { "stylua" }, python = { "isort", "black" },
python = { "isort", "black" }, sh = { "shfmt" },
sh = { "shfmt" }, terraform = { "tflint" },
}, hcl = { "hclfmt" },
stop_after_first = false, },
format_on_save = { stop_after_first = false,
lsp_fallback = true, format_on_save = {
async = false, lsp_fallback = true,
timeout_ms = 1000, -- default: 1000 async = false,
}, timeout_ms = 1000, -- default: 1000
}) },
end, })
end,
} }