fix(formatting): remove deprecation check on some options

This commit is contained in:
Folke Lemaitre
2024-06-07 22:48:26 +02:00
parent 789b1b4fd4
commit c16fb5d49b

View File

@ -2,27 +2,10 @@ local M = {}
---@param opts ConformOpts
function M.setup(_, opts)
for name, formatter in pairs(opts.formatters or {}) do
if type(formatter) == "table" then
---@diagnostic disable-next-line: undefined-field
if formatter.extra_args then
---@diagnostic disable-next-line: undefined-field
formatter.prepend_args = formatter.extra_args
LazyVim.deprecate(
("opts.formatters.%s.extra_args"):format(name),
("opts.formatters.%s.prepend_args"):format(name)
)
end
end
end
for _, key in ipairs({ "format_on_save", "format_after_save" }) do
if opts[key] then
LazyVim.warn(
("Don't set `opts.%s` for `conform.nvim`.\n**LazyVim** will use the conform formatter automatically"):format(
key
)
)
local msg = "Don't set `opts.%s` for `conform.nvim`.\n**LazyVim** will use the conform formatter automatically"
LazyVim.warn(msg:format(key))
---@diagnostic disable-next-line: no-unknown
opts[key] = nil
end