aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-04-05 06:14:21 -0700
committerGitHub <noreply@github.com>2025-04-05 06:14:21 -0700
commit2aacdb484141b74cd98a014662ff387b67a5d05b (patch)
tree8dbf810d5744b5d695f7e1fc4a4a1ebbcdf5bbe1 /lua/lspconfig
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-2aacdb484141b74cd98a014662ff387b67a5d05b.tar
nvim-lspconfig-2aacdb484141b74cd98a014662ff387b67a5d05b.tar.gz
nvim-lspconfig-2aacdb484141b74cd98a014662ff387b67a5d05b.tar.bz2
nvim-lspconfig-2aacdb484141b74cd98a014662ff387b67a5d05b.tar.lz
nvim-lspconfig-2aacdb484141b74cd98a014662ff387b67a5d05b.tar.xz
nvim-lspconfig-2aacdb484141b74cd98a014662ff387b67a5d05b.tar.zst
nvim-lspconfig-2aacdb484141b74cd98a014662ff387b67a5d05b.zip
Revert "fix(eslint): find closest ESLint directory to avoid version mismatch …" #3689
This reverts commit 93835565a746e252b3342dbab688c22bdea81da7.
Diffstat (limited to 'lua/lspconfig')
-rw-r--r--lua/lspconfig/configs/eslint.lua24
1 files changed, 0 insertions, 24 deletions
diff --git a/lua/lspconfig/configs/eslint.lua b/lua/lspconfig/configs/eslint.lua
index f80eee4b..e701928d 100644
--- a/lua/lspconfig/configs/eslint.lua
+++ b/lua/lspconfig/configs/eslint.lua
@@ -47,28 +47,6 @@ local root_file = {
'eslint.config.cts',
}
---- Find the closest directory containing the ESLint library.
---- Using the repository root as the ESLint library location is a common practice
---- but handling different versions in monorepos can cause the LSP not to point to
---- the correct instance.
----
---- @return string|nil (path) The path to the closest directory containing the ESLint library, or nil if not found.
-local function get_eslint_closest_dir()
- local cwd = vim.fn.getcwd()
- local eslint_node_modules = vim.fn.finddir('node_modules/eslint', cwd .. ';')
-
- if eslint_node_modules == '' then
- return nil
- end
-
- if eslint_node_modules == 'node_modules/eslint' then
- return cwd
- end
-
- -- Strip the node_modules/eslint part
- return eslint_node_modules:match '(.*)/node_modules/eslint'
-end
-
return {
default_config = {
cmd = { 'vscode-eslint-language-server', '--stdio' },
@@ -124,8 +102,6 @@ return {
},
},
on_new_config = function(config, new_root_dir)
- new_root_dir = get_eslint_closest_dir() or new_root_dir
-
-- The "workspaceFolder" is a VSCode concept. It limits how far the
-- server will traverse the file system when locating the ESLint config
-- file (e.g., .eslintrc).