fix(nvim-lint): don't duplicate linters. Fixes #2852
This commit is contained in:
1 file changed
+4
@@ -11,6 +11,7 @@ return {
|
|||||||
-- ['*'] = { 'global linter' },
|
-- ['*'] = { 'global linter' },
|
||||||
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
|
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
|
||||||
-- ['_'] = { 'fallback linter' },
|
-- ['_'] = { 'fallback linter' },
|
||||||
|
-- ["*"] = { "typos" },
|
||||||
},
|
},
|
||||||
-- LazyVim extension to easily override linter options
|
-- LazyVim extension to easily override linter options
|
||||||
-- or add custom linters.
|
-- or add custom linters.
|
||||||
@@ -57,6 +58,9 @@ return {
|
|||||||
-- * this differs from conform.nvim which only uses the first filetype that has a formatter
|
-- * this differs from conform.nvim which only uses the first filetype that has a formatter
|
||||||
local names = lint._resolve_linter_by_ft(vim.bo.filetype)
|
local names = lint._resolve_linter_by_ft(vim.bo.filetype)
|
||||||
|
|
||||||
|
-- Create a copy of the names table to avoid modifying the original.
|
||||||
|
names = vim.list_extend({}, names)
|
||||||
|
|
||||||
-- Add fallback linters.
|
-- Add fallback linters.
|
||||||
if #names == 0 then
|
if #names == 0 then
|
||||||
vim.list_extend(names, lint.linters_by_ft["_"] or {})
|
vim.list_extend(names, lint.linters_by_ft["_"] or {})
|
||||||
|
|||||||
Reference in new issue
Block a user