feat(eslint): added an extra for eslint lsp that runs EslintFixAll before saving a buffer
This commit is contained in:
1 file changed
+23
@@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user