using the config callback for defining setup for nvim conform

This commit is contained in:
aminnairi
2023-12-06 04:48:34 +01:00
parent 305fff1968
commit 586fcd2c1d
+17 -7
View File
@@ -1,12 +1,5 @@
return { return {
"stevearc/conform.nvim", "stevearc/conform.nvim",
opts = {
formatters_by_ft = {
lua = { "stylua" },
javascript = { "eslint_d" },
php = { "phpcbf" }
},
},
init = function() init = function()
local whichKey = require("which-key"); local whichKey = require("which-key");
local conform = require("conform") local conform = require("conform")
@@ -25,4 +18,21 @@ return {
} }
}) })
end, end,
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
lua = { "stylua" },
javascript = { "eslint_d" },
php = { "phpcbf" }
},
})
conform.formatters.phpcbf = {
prepend_args = {
"--standard=PSR12"
}
}
end
} }