32 lines
895 B
Lua
32 lines
895 B
Lua
|
|
-- Install: npm install -g vscode-langservers-extracted
|
||
|
|
return {
|
||
|
|
cmd = { "vscode-eslint-language-server", "--stdio" },
|
||
|
|
filetypes = {
|
||
|
|
"javascript", "javascriptreact",
|
||
|
|
"typescript", "typescriptreact",
|
||
|
|
},
|
||
|
|
root_markers = {
|
||
|
|
".eslintrc", ".eslintrc.js", ".eslintrc.cjs",
|
||
|
|
".eslintrc.json", "eslint.config.js", "eslint.config.mjs",
|
||
|
|
"eslint.config.cjs",
|
||
|
|
},
|
||
|
|
settings = {
|
||
|
|
validate = "on",
|
||
|
|
experimental = { useFlatConfig = false },
|
||
|
|
format = false,
|
||
|
|
quiet = false,
|
||
|
|
run = "onType",
|
||
|
|
workingDirectory = { mode = "location" },
|
||
|
|
codeAction = {
|
||
|
|
disableRuleComment = { enable = true, location = "separateLine" },
|
||
|
|
showDocumentation = { enable = true },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
before_init = function(params, config)
|
||
|
|
config.settings.workspaceFolder = {
|
||
|
|
uri = params.rootPath,
|
||
|
|
name = vim.fn.fnamemodify(params.rootPath, ":t"),
|
||
|
|
}
|
||
|
|
end,
|
||
|
|
}
|