diff options
| author | 汐 <31800073+Parsifa1@users.noreply.github.com> | 2025-04-28 20:41:35 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-28 05:41:35 -0700 |
| commit | 7a96d4be7725785fe6a451563186dd86477cfdff (patch) | |
| tree | 088e99cae09e847088fcda17a2293f5da99cd2a4 /lsp | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-7a96d4be7725785fe6a451563186dd86477cfdff.tar nvim-lspconfig-7a96d4be7725785fe6a451563186dd86477cfdff.tar.gz nvim-lspconfig-7a96d4be7725785fe6a451563186dd86477cfdff.tar.bz2 nvim-lspconfig-7a96d4be7725785fe6a451563186dd86477cfdff.tar.lz nvim-lspconfig-7a96d4be7725785fe6a451563186dd86477cfdff.tar.xz nvim-lspconfig-7a96d4be7725785fe6a451563186dd86477cfdff.tar.zst nvim-lspconfig-7a96d4be7725785fe6a451563186dd86477cfdff.zip | |
fix(eslint): check nil before on_dir #3800
Diffstat (limited to 'lsp')
| -rw-r--r-- | lsp/eslint.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lsp/eslint.lua b/lsp/eslint.lua index 4c01f3f2..92b740cc 100644 --- a/lsp/eslint.lua +++ b/lsp/eslint.lua @@ -80,7 +80,9 @@ return { local fname = vim.api.nvim_buf_get_name(bufnr) root_file_patterns = util.insert_package_json(root_file_patterns, 'eslintConfig', fname) local root_dir = vim.fs.dirname(vim.fs.find(root_file_patterns, { path = fname, upward = true })[1]) - on_dir(root_dir) + if root_dir then + on_dir(root_dir) + end end, -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. settings = { |
