summaryrefslogtreecommitdiff
path: root/lua/lsp/ts-fmt-lint.lua
diff options
context:
space:
mode:
authormaxime50 <[email protected]>2021-07-04 18:22:10 -0400
committerGitHub <[email protected]>2021-07-04 18:22:10 -0400
commitd2324d14e166a17b2573006485fd3e4e8c971100 (patch)
tree2b1426f0ef6fa1eb82514856e6be739c755990d1 /lua/lsp/ts-fmt-lint.lua
parentf93c00796281a9620c3f3714cf4129be80d80e89 (diff)
Better JS/TS Development Experience (#667)
Co-authored-by: Maxime <[email protected]>
Diffstat (limited to 'lua/lsp/ts-fmt-lint.lua')
-rw-r--r--lua/lsp/ts-fmt-lint.lua30
1 files changed, 1 insertions, 29 deletions
diff --git a/lua/lsp/ts-fmt-lint.lua b/lua/lsp/ts-fmt-lint.lua
index 3ca97d71..5cca9c60 100644
--- a/lua/lsp/ts-fmt-lint.lua
+++ b/lua/lsp/ts-fmt-lint.lua
@@ -17,46 +17,18 @@ M.setup = function()
}
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 {
-- init_options = {initializationOptions},
cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"},
init_options = {documentFormatting = true, codeAction = false},
- filetypes = {
- "javascriptreact", "javascript", "typescript", "typescriptreact",
- "html", "css", "yaml", "vue"
- },
+ filetypes = {"html", "css", "yaml", "vue"},
settings = {
rootMarkers = {".git/", "package.json"},
languages = {
- javascript = tsserver_args,
- javascriptreact = tsserver_args,
- typescript = tsserver_args,
- typescriptreact = tsserver_args,
html = {prettier},
css = {prettier},
json = {prettier},
yaml = {prettier}
- -- javascriptreact = {prettier, eslint},
- -- javascript = {prettier, eslint},
-- markdown = {markdownPandocFormat, markdownlint},
}
}