Skip to content

Commit

Permalink
feat(eslint): added an extra for eslint lsp that runs EslintFixAll be…
Browse files Browse the repository at this point in the history
…fore saving a buffer
  • Loading branch information
folke committed Mar 10, 2023
1 parent 5aad574 commit 75299da
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lua/lazyvim/plugins/extras/linting/eslint.lua
Original file line number Diff line number Diff line change
@@ -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,
},
},
},
}

0 comments on commit 75299da

Please sign in to comment.