|
@@ -17,46 +17,18 @@ M.setup = function()
|
|
}
|
|
}
|
|
end
|
|
end
|
|
|
|
|
|
- -- TODO global eslint?
|
|
|
|
-
|
|
|
|
- local eslint = {
|
|
|
|
- lintCommand = "./node_modules/.bin/eslint -f unix --stdin --stdin-filename ${INPUT}",
|
|
|
|
- lintIgnoreExitCode = true,
|
|
|
|
- lintStdin = true,
|
|
|
|
- lintFormats = {"%f:%l:%c: %m"},
|
|
|
|
- -- formatCommand = "./node_modules/.bin/eslint -f unix --fix --stdin-filename ${INPUT}", -- TODO check if eslint is the formatter then add this
|
|
|
|
- formatStdin = true
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if O.lang.tsserver.formatter == 'prettier' then
|
|
|
|
- table.insert(tsserver_args, prettier)
|
|
|
|
- end
|
|
|
|
-
|
|
|
|
- if O.lang.tsserver.linter == 'eslint' then
|
|
|
|
- table.insert(tsserver_args, eslint)
|
|
|
|
- end
|
|
|
|
-
|
|
|
|
require"lspconfig".efm.setup {
|
|
require"lspconfig".efm.setup {
|
|
-- init_options = {initializationOptions},
|
|
-- init_options = {initializationOptions},
|
|
cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"},
|
|
cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"},
|
|
init_options = {documentFormatting = true, codeAction = false},
|
|
init_options = {documentFormatting = true, codeAction = false},
|
|
- filetypes = {
|
|
|
|
- "javascriptreact", "javascript", "typescript", "typescriptreact",
|
|
|
|
- "html", "css", "yaml", "vue"
|
|
|
|
- },
|
|
|
|
|
|
+ filetypes = {"html", "css", "yaml", "vue"},
|
|
settings = {
|
|
settings = {
|
|
rootMarkers = {".git/", "package.json"},
|
|
rootMarkers = {".git/", "package.json"},
|
|
languages = {
|
|
languages = {
|
|
- javascript = tsserver_args,
|
|
|
|
- javascriptreact = tsserver_args,
|
|
|
|
- typescript = tsserver_args,
|
|
|
|
- typescriptreact = tsserver_args,
|
|
|
|
html = {prettier},
|
|
html = {prettier},
|
|
css = {prettier},
|
|
css = {prettier},
|
|
json = {prettier},
|
|
json = {prettier},
|
|
yaml = {prettier}
|
|
yaml = {prettier}
|
|
- -- javascriptreact = {prettier, eslint},
|
|
|
|
- -- javascript = {prettier, eslint},
|
|
|
|
-- markdown = {markdownPandocFormat, markdownlint},
|
|
-- markdown = {markdownPandocFormat, markdownlint},
|
|
}
|
|
}
|
|
}
|
|
}
|