mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 09:18:51 +02:00
feat!: make conform.nvim
and nvim-lint
the default formatters/linters
This commit is contained in:
parent
70f91956e7
commit
14c091b1fc
13 changed files with 148 additions and 64 deletions
|
@ -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", {}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue