File tree Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change @@ -47,28 +47,6 @@ local root_file = {
47
47
' eslint.config.cts' ,
48
48
}
49
49
50
- --- Find the closest directory containing the ESLint library.
51
- --- Using the repository root as the ESLint library location is a common practice
52
- --- but handling different versions in monorepos can cause the LSP not to point to
53
- --- the correct instance.
54
- ---
55
- --- @return string | nil (path ) The path to the closest directory containing the ESLint library , or nil if not found.
56
- local function get_eslint_closest_dir ()
57
- local cwd = vim .fn .getcwd ()
58
- local eslint_node_modules = vim .fn .finddir (' node_modules/eslint' , cwd .. ' ;' )
59
-
60
- if eslint_node_modules == ' ' then
61
- return nil
62
- end
63
-
64
- if eslint_node_modules == ' node_modules/eslint' then
65
- return cwd
66
- end
67
-
68
- -- Strip the node_modules/eslint part
69
- return eslint_node_modules :match ' (.*)/node_modules/eslint'
70
- end
71
-
72
50
return {
73
51
default_config = {
74
52
cmd = { ' vscode-eslint-language-server' , ' --stdio' },
@@ -124,8 +102,6 @@ return {
124
102
},
125
103
},
126
104
on_new_config = function (config , new_root_dir )
127
- new_root_dir = get_eslint_closest_dir () or new_root_dir
128
-
129
105
-- The "workspaceFolder" is a VSCode concept. It limits how far the
130
106
-- server will traverse the file system when locating the ESLint config
131
107
-- file (e.g., .eslintrc).
You can’t perform that action at this time.
0 commit comments