From ff1b44e67606080b8b40d066943c55c92856e3c6 Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:31:11 +0300 Subject: [PATCH] fix(lint): make prepend_args opt work when default args is empty (#3828) ## What is this PR for? There's some logic in `linting.lua` to allow for easy setting of linter args, but it doesn't work when default args is empty. This hopefully fixes it. ## Does this PR fix an existing issue? N/A. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/linting.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/linting.lua b/lua/lazyvim/plugins/linting.lua index 7b5b3be3..46cf2898 100644 --- a/lua/lazyvim/plugins/linting.lua +++ b/lua/lazyvim/plugins/linting.lua @@ -35,6 +35,7 @@ return { if type(linter) == "table" and type(lint.linters[name]) == "table" then lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name], linter) if type(linter.prepend_args) == "table" then + lint.linters[name].args = lint.linters[name].args or {} vim.list_extend(lint.linters[name].args, linter.prepend_args) end else