Skip to content

Commit 1e9c9b5

Browse files
committed
fix(eslint.lua): nonsense passed to list_extend()
1 parent 95fe3c1 commit 1e9c9b5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.github/ci/lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ _check_brief_placement() {
3636
}
3737

3838
# Returned object should have `---@type vim.lsp.Config` annotation.
39-
# TODO: use luals/emmylua type checking in CI: https://github.com/neovim/neovim/pull/33344
39+
# CI checks luals/emmylua: https://github.com/neovim/nvim-lspconfig/pull/4185
4040
_check_type() {
4141
if git grep --files-without-match '\-\-\-\@type vim\.lsp\.Config' -- 'lsp/*.lua' ; then
4242
_fail 'Missing `---@type vim.lsp.Config` annotation.'

lsp/eslint.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,8 @@ return {
201201
-- Support Yarn2 (PnP) projects
202202
local pnp_cjs = root_dir .. '/.pnp.cjs'
203203
local pnp_js = root_dir .. '/.pnp.js'
204-
if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then
205-
local cmd = config.cmd
206-
config.cmd = vim.list_extend({ 'yarn', 'exec' }, type(cmd) == 'table' and cmd or {})
204+
if type(config.cmd) == 'table' and (vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js)) then
205+
config.cmd = vim.list_extend({ 'yarn', 'exec' }, config.cmd --[[@as table]])
207206
end
208207
end
209208
end,

0 commit comments

Comments
 (0)