feat(eslint): added an extra for eslint lsp that runs EslintFixAll before saving a buffer

This commit is contained in:
Folke Lemaitre 2023-03-10 08:44:47 +01:00
parent 5aad5749a7
commit 75299da24c
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -0,0 +1,23 @@
return {
{
"neovim/nvim-lspconfig",
-- other settings removed for brevity
opts = {
servers = {
eslint = {
settings = {
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
workingDirectory = { mode = "auto" },
},
},
},
setup = {
eslint = function()
vim.api.nvim_create_autocmd("BufWritePre", {
command = "EslintFixAll",
})
end,
},
},
},
}