dotfiles/vim/lua/conform_config.lua

25 lines
551 B
Lua

-- TODO: prettierd
-- TODO: async save-on-write? Or set timeout.
require("conform").setup({
formatters_by_ft = {
javascript = { "prettier" },
go = { "goimports" },
lua = { "stylua" },
rust = { "rustfmt" },
typescript = { "prettier" },
typescriptreact = { "prettier" },
css = { "prettier" },
scss = { "prettier" },
},
formatters = {
prettier = {
args = { "--stdin-filepath", "$FILENAME", "--single-quote" },
},
},
format_on_save = {
lsp_fallback = true,
},
log_level = vim.log.levels.ERROR,
notify_on_error = false,
})