mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-01-21 05:08:37 +01:00
neovim: Use eslint with nvim-lspconfig
Note that sometimes you may need to disable autosave with :ASToggle since JavaScript code is also automatically formatted on save.
This commit is contained in:
parent
d5fe4c2118
commit
360898f626
@ -50,6 +50,7 @@ in
|
||||
nodePackages."@prisma/language-server"
|
||||
nodePackages.pnpm
|
||||
tailwindcss-language-server
|
||||
vscode-langservers-extracted
|
||||
|
||||
# rust
|
||||
rustc
|
||||
@ -252,6 +253,14 @@ in
|
||||
exportPdf = "onSave"
|
||||
}
|
||||
}
|
||||
lspconfig.eslint.setup {
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = bufnr,
|
||||
command = "EslintFixAll",
|
||||
})
|
||||
end
|
||||
}
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||
|
Loading…
Reference in New Issue
Block a user