diff --git a/AppData/Local/nvim/init.lua b/AppData/Local/nvim/init.lua index 1f01467..02ece34 100644 --- a/AppData/Local/nvim/init.lua +++ b/AppData/Local/nvim/init.lua @@ -562,6 +562,22 @@ require('lazy').setup({ }, }, }, -- hybrid mode is default + eslint = { + flags = { debounce_text_changes = 500 }, + on_attach = function(client, bufnr) + client.server_capabilities.documentFormattingProvider = true + if client.server_capabilities.documentFormattingProvider then + local au_lsp = vim.api.nvim_create_augroup('eslint_lsp', { clear = true }) + vim.api.nvim_create_autocmd('BufWritePre', { + pattern = '*', + callback = function() + vim.lsp.buf.format { async = true } + end, + group = au_lsp, + }) + end + end, + }, html = {}, cssls = {}, jsonls = {}, @@ -659,6 +675,7 @@ require('lazy').setup({ -- You can use 'stop_after_first' to run the first available formatter from the list javascript = {}, typescript = {}, + esmodule = { 'eslint-lsp' }, vue = {}, typescriptreact = {}, javascriptreact = {},