47 lines
829 B
Lua
47 lines
829 B
Lua
local M = {}
|
|
|
|
M.setup = function(on_attach, capabilities)
|
|
require("lspconfig").eslint.setup({
|
|
capabilities = capabilities,
|
|
filetypes = {
|
|
"javascript",
|
|
"javascriptreact",
|
|
"javascript.jsx",
|
|
"typescript",
|
|
"typescriptreact",
|
|
"typescript.tsx",
|
|
"vue",
|
|
},
|
|
on_attach = on_attach,
|
|
settings = {
|
|
codeAction = {
|
|
disableRuleComment = {
|
|
enable = true,
|
|
location = "separateLine",
|
|
},
|
|
showDocumentation = {
|
|
enable = true,
|
|
},
|
|
},
|
|
codeActionOnSave = {
|
|
enable = false,
|
|
mode = "all",
|
|
},
|
|
format = false,
|
|
nodePath = "",
|
|
onIgnoredFiles = "off",
|
|
packageManager = "yarn",
|
|
quiet = false,
|
|
rulesCustomizations = {},
|
|
run = "onType",
|
|
useESLintClass = false,
|
|
validate = "on",
|
|
workingDirectory = {
|
|
mode = "location",
|
|
},
|
|
},
|
|
})
|
|
end
|
|
|
|
return M
|