plugins/lsp: move eslint fix command to lsp section

This commit is contained in:
Dmitriy Pleshevskiy 2022-11-19 21:02:45 +03:00
parent 4edf3f4d64
commit aa9f2ccb68
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
2 changed files with 10 additions and 28 deletions

View file

@ -6,6 +6,5 @@ vim.cmd([[
aug fmt aug fmt
au! au!
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
au BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll
aug END aug END
]]) ]])

View file

@ -57,6 +57,7 @@ nlsp_settings.setup({})
-- See: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md -- See: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
-- --
vim.g.markdown_fenced_languages = { "ts=typescript" }
-- Override the default configuration to be applied to all servers -- Override the default configuration to be applied to all servers
lsp_config.util.default_config = vim.tbl_extend("force", lsp_config.util.default_config, { lsp_config.util.default_config = vim.tbl_extend("force", lsp_config.util.default_config, {
@ -68,32 +69,14 @@ local root_pattern = lsp_config.util.root_pattern
for name, settings in pairs(@lspConfigServers@) do for name, settings in pairs(@lspConfigServers@) do
lsp_config[name].setup(settings) lsp_config[name].setup(settings)
if name == "eslint" then
vim.cmd([[
aug eslint_fix
au!
au BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll
aug END
]])
end
end end
--[[
-- js,ts
lsp_config.tsserver.setup({})
lsp_config.eslint.setup({})
-- deno
-- To appropriately highlight codefences returned from denols
vim.g.markdown_fenced_languages = { "ts=typescript" }
lsp_config.denols.setup({
root_dir = lsp_config.util.root_pattern("deno.json", "deno.jsonc"),
})
-- rust
lsp_config.rust_analyzer.setup({
-- Server-specific settings...
settings = {
["rust-analyzer"] = {
["server.path"] = "rust-analyzer",
["updates.prompt"] = false,
["updates.checkOnStartup"] = false,
["checkOnSave.enable"] = true,
["checkOnSave.command"] = "clippy",
["cargo.autoreload"] = true,
},
},
})
]]--