diff options
| author | christianchiarulli <[email protected]> | 2021-07-05 16:26:31 -0400 | 
|---|---|---|
| committer | christianchiarulli <[email protected]> | 2021-07-05 16:26:31 -0400 | 
| commit | 20485971641a9d916640ccad05586a641c984ed6 (patch) | |
| tree | d397a3a9adba502b4c26b802d897b8310972f76f /lua/lsp/ts-fmt-lint.lua | |
| parent | 56e82dac4497293541099185441485dd31e98dc8 (diff) | |
| parent | a469c710bfc01f291df68dba40464caaa2b496da (diff) | |
Merge branch 'master' of github.com:ChristianChiarulli/LunarVim into stable
Diffstat (limited to 'lua/lsp/ts-fmt-lint.lua')
| -rw-r--r-- | lua/lsp/ts-fmt-lint.lua | 33 | 
1 files changed, 2 insertions, 31 deletions
| diff --git a/lua/lsp/ts-fmt-lint.lua b/lua/lsp/ts-fmt-lint.lua index 3ca97d71..36d4ca8a 100644 --- a/lua/lsp/ts-fmt-lint.lua +++ b/lua/lsp/ts-fmt-lint.lua @@ -10,54 +10,25 @@ M.setup = function()          formatStdin = true      } -    if vim.fn.glob("node_modules/.bin/prettier") then +    if vim.fn.glob("node_modules/.bin/prettier") ~= "" then          prettier = {              formatCommand = "./node_modules/.bin/prettier --stdin-filepath ${INPUT}",              formatStdin = true          }      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", "javascript", "javascriptreact", "typescript", "typescriptreact"},          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},              }          }      } | 
