feat!: make conform.nvim
and nvim-lint
the default formatters/linters
This commit is contained in:
@ -124,7 +124,26 @@ function M.format(opts)
|
||||
end
|
||||
end
|
||||
|
||||
function M.health()
|
||||
local Config = require("lazy.core.config")
|
||||
local has_plugin = Config.spec.plugins["none-ls.nvim"]
|
||||
local has_extra = vim.tbl_contains(Config.spec.modules, "lazyvim.plugins.extras.lsp.none-ls")
|
||||
if has_plugin and not has_extra then
|
||||
Util.warn({
|
||||
"`conform.nvim` and `nvim-lint` are now the default forrmatters and linters in LazyVim.",
|
||||
"",
|
||||
"You can use those plugins together with `none-ls.nvim`,",
|
||||
"but you need to enable the `lazyvim.plugins.extras.lsp.none-ls` extra,",
|
||||
"for formatting to work correctly.",
|
||||
"",
|
||||
"In case you no longer want to use `none-ls.nvim`, just remove the spec from your config.",
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
M.health()
|
||||
|
||||
-- Autoformat autocmd
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = vim.api.nvim_create_augroup("LazyFormat", {}),
|
||||
|
Reference in New Issue
Block a user