diff options
| -rw-r--r-- | .github/ci/lint.sh | 2 | ||||
| -rw-r--r-- | lsp/eslint.lua | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/.github/ci/lint.sh b/.github/ci/lint.sh index a6bf8a1e..8efeac73 100644 --- a/.github/ci/lint.sh +++ b/.github/ci/lint.sh @@ -36,7 +36,7 @@ _check_brief_placement() { } # Returned object should have `---@type vim.lsp.Config` annotation. -# TODO: use luals/emmylua type checking in CI: https://github.com/neovim/neovim/pull/33344 +# CI checks luals/emmylua: https://github.com/neovim/nvim-lspconfig/pull/4185 _check_type() { if git grep --files-without-match '\-\-\-\@type vim\.lsp\.Config' -- 'lsp/*.lua' ; then _fail 'Missing `---@type vim.lsp.Config` annotation.' diff --git a/lsp/eslint.lua b/lsp/eslint.lua index 593d602a..37f51eac 100644 --- a/lsp/eslint.lua +++ b/lsp/eslint.lua @@ -201,9 +201,8 @@ return { -- Support Yarn2 (PnP) projects local pnp_cjs = root_dir .. '/.pnp.cjs' local pnp_js = root_dir .. '/.pnp.js' - if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then - local cmd = config.cmd - config.cmd = vim.list_extend({ 'yarn', 'exec' }, type(cmd) == 'table' and cmd or {}) + if type(config.cmd) == 'table' and (vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js)) then + config.cmd = vim.list_extend({ 'yarn', 'exec' }, config.cmd --[[@as table]]) end end end, |
