diff options
| author | Alexis Tacnet <alexis@mistral.ai> | 2025-08-18 00:18:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-17 15:18:30 -0700 |
| commit | 612d9fcc652725ce2e3a8043daad6cfc6865c4a7 (patch) | |
| tree | 0dd4eecc98d49df922698ec66bb0a45ca009f1b4 | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-612d9fcc652725ce2e3a8043daad6cfc6865c4a7.tar nvim-lspconfig-612d9fcc652725ce2e3a8043daad6cfc6865c4a7.tar.gz nvim-lspconfig-612d9fcc652725ce2e3a8043daad6cfc6865c4a7.tar.bz2 nvim-lspconfig-612d9fcc652725ce2e3a8043daad6cfc6865c4a7.tar.lz nvim-lspconfig-612d9fcc652725ce2e3a8043daad6cfc6865c4a7.tar.xz nvim-lspconfig-612d9fcc652725ce2e3a8043daad6cfc6865c4a7.tar.zst nvim-lspconfig-612d9fcc652725ce2e3a8043daad6cfc6865c4a7.zip | |
fix(eslint): performance regression on configuration lookup #4004
| -rw-r--r-- | lsp/eslint.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lsp/eslint.lua b/lsp/eslint.lua index 30c7eb4d..044107c4 100644 --- a/lsp/eslint.lua +++ b/lsp/eslint.lua @@ -172,11 +172,17 @@ return { end, eslint_config_files) for _, file in ipairs(flat_config_files) do - local found_files = vim.fs.find(function(name, path) - return name == file and not path:match('[/\\]node_modules[/\\]') - end, { path = root_dir, type = 'file', limit = 1 }) + local found_files = vim.fn.globpath(root_dir, file, true, true) - if #found_files > 0 then + -- Filter out files inside node_modules + local filtered_files = {} + for _, found_file in ipairs(found_files) do + if string.find(found_file, '[/\\]node_modules[/\\]') == nil then + table.insert(filtered_files, found_file) + end + end + + if #filtered_files > 0 then config.settings.experimental = config.settings.experimental or {} config.settings.experimental.useFlatConfig = true break |
