mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-02-01 10:29:21 +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."@prisma/language-server"
|
||||||
nodePackages.pnpm
|
nodePackages.pnpm
|
||||||
tailwindcss-language-server
|
tailwindcss-language-server
|
||||||
|
vscode-langservers-extracted
|
||||||
|
|
||||||
# rust
|
# rust
|
||||||
rustc
|
rustc
|
||||||
@ -252,6 +253,14 @@ in
|
|||||||
exportPdf = "onSave"
|
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', '<space>e', vim.diagnostic.open_float)
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||||
|
Loading…
Reference in New Issue
Block a user