Added eslint auto fix all
This commit is contained in:
@@ -562,6 +562,22 @@ require('lazy').setup({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, -- hybrid mode is default
|
}, -- 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 = {},
|
html = {},
|
||||||
cssls = {},
|
cssls = {},
|
||||||
jsonls = {},
|
jsonls = {},
|
||||||
@@ -659,6 +675,7 @@ require('lazy').setup({
|
|||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
javascript = {},
|
javascript = {},
|
||||||
typescript = {},
|
typescript = {},
|
||||||
|
esmodule = { 'eslint-lsp' },
|
||||||
vue = {},
|
vue = {},
|
||||||
typescriptreact = {},
|
typescriptreact = {},
|
||||||
javascriptreact = {},
|
javascriptreact = {},
|
||||||
|
|||||||
Reference in New Issue
Block a user