diff --git a/lua/lazyvim/plugins/extras/linting/eslint.lua b/lua/lazyvim/plugins/extras/linting/eslint.lua new file mode 100644 index 00000000..68a7ea1c --- /dev/null +++ b/lua/lazyvim/plugins/extras/linting/eslint.lua @@ -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, + }, + }, + }, +}