Skip to content

Commit

Permalink
fix(nvim-lint): don't duplicate linters. Fixes #2852
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Mar 27, 2024
1 parent e3075b0 commit cfbd358
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/lazyvim/plugins/linting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ return {
-- ['*'] = { 'global linter' },
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
-- ['_'] = { 'fallback linter' },
-- ["*"] = { "typos" },
},
-- LazyVim extension to easily override linter options
-- or add custom linters.
Expand Down Expand Up @@ -57,6 +58,9 @@ return {
-- * 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)

-- Create a copy of the names table to avoid modifying the original.
names = vim.list_extend({}, names)

-- Add fallback linters.
if #names == 0 then
vim.list_extend(names, lint.linters_by_ft["_"] or {})
Expand Down

0 comments on commit cfbd358

Please sign in to comment.