mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
feat(nvim): configure nvim-lint
This commit is contained in:
@@ -4,8 +4,7 @@
|
|||||||
"lazyvim.plugins.extras.editor.aerial",
|
"lazyvim.plugins.extras.editor.aerial",
|
||||||
"lazyvim.plugins.extras.formatting.prettier",
|
"lazyvim.plugins.extras.formatting.prettier",
|
||||||
"lazyvim.plugins.extras.lang.tailwind",
|
"lazyvim.plugins.extras.lang.tailwind",
|
||||||
"lazyvim.plugins.extras.lang.yaml",
|
"lazyvim.plugins.extras.lang.yaml"
|
||||||
"lazyvim.plugins.extras.lsp.none-ls"
|
|
||||||
],
|
],
|
||||||
"news": {
|
"news": {
|
||||||
"NEWS.md": "2123"
|
"NEWS.md": "2123"
|
||||||
|
|||||||
@@ -25,8 +25,6 @@ vim.opt.iskeyword:append("-") -- Add dashes to words
|
|||||||
vim.opt.wildignore:append({ "*/node_modules/*" }) -- Wildignore
|
vim.opt.wildignore:append({ "*/node_modules/*" }) -- Wildignore
|
||||||
vim.opt.complete:append({ "i", "k", "s", "kspell" })
|
vim.opt.complete:append({ "i", "k", "s", "kspell" })
|
||||||
|
|
||||||
vim.g.nonels_supress_issue58 = true
|
|
||||||
|
|
||||||
-- Undercurl
|
-- Undercurl
|
||||||
vim.cmd([[let &t_Cs = "\e[4:3m"]])
|
vim.cmd([[let &t_Cs = "\e[4:3m"]])
|
||||||
vim.cmd([[let &t_Ce = "\e[4:0m"]])
|
vim.cmd([[let &t_Ce = "\e[4:0m"]])
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ return {
|
|||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
{ "<leader>L", "<cmd>Legendary<cr>", desc = "Legendary" },
|
-- { "<leader>L", "<cmd>Legendary<cr>", desc = "Legendary" },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("legendary").setup({
|
require("legendary").setup({
|
||||||
|
|||||||
34
nvim/lua/plugins/linting.lua
Normal file
34
nvim/lua/plugins/linting.lua
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
-- Linting
|
||||||
|
-- https://github.com/mfussenegger/nvim-lint
|
||||||
|
return {
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
event = {
|
||||||
|
"BufWritePre",
|
||||||
|
"BufNewFile",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local lint = require("lint")
|
||||||
|
|
||||||
|
lint.linters_by_ft = {
|
||||||
|
astro = { "eslint_d" },
|
||||||
|
javascript = { "eslint_d" },
|
||||||
|
javascriptreact = { "eslint_d" },
|
||||||
|
python = { "pylint" },
|
||||||
|
svelte = { "eslint_d" },
|
||||||
|
typescript = { "eslint_d" },
|
||||||
|
typescriptreact = { "eslint_d" },
|
||||||
|
}
|
||||||
|
|
||||||
|
local lint_augrup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
|
group = lint_augrup,
|
||||||
|
callback = function()
|
||||||
|
lint.try_lint()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>L", function()
|
||||||
|
lint.try_lint()
|
||||||
|
end, { desc = "Trigger linting for current file" })
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ return {
|
|||||||
"cssmodules-language-server",
|
"cssmodules-language-server",
|
||||||
"diagnostic-languageserver",
|
"diagnostic-languageserver",
|
||||||
"emmet-ls",
|
"emmet-ls",
|
||||||
|
"eslint-lsp",
|
||||||
"eslint_d",
|
"eslint_d",
|
||||||
"html-lsp",
|
"html-lsp",
|
||||||
"json-lsp",
|
"json-lsp",
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvimtools/none-ls.nvim",
|
|
||||||
enabled = true,
|
|
||||||
event = "LazyFile",
|
|
||||||
dependencies = { "mason.nvim" },
|
|
||||||
opts = function(_, opts)
|
|
||||||
local nls = require("null-ls")
|
|
||||||
opts.root_dir = opts.root_dir
|
|
||||||
or require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git")
|
|
||||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
|
||||||
nls.builtins.formatting.fish_indent,
|
|
||||||
nls.builtins.diagnostics.fish,
|
|
||||||
nls.builtins.diagnostics.eslint, -- TODO: How to get this feature in eslint-lsp?
|
|
||||||
nls.builtins.formatting.stylua,
|
|
||||||
nls.builtins.formatting.shfmt,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user