neovim: Run all ESLint fixes on save
This commit is contained in:
parent
97b2bb0d4f
commit
4257f77c6f
1 changed files with 10 additions and 0 deletions
|
|
@ -24,6 +24,16 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("eslint", {
|
||||||
|
on_attach = function()
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.code_action({ context = { only = { "source.fixAll.eslint" } }, apply = true })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
-- HUD
|
-- HUD
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue