Add 'dots/' from commit 'f64b634dd8fbb2c8a2898c3b9d0acc9452e4d966'
git-subtree-dir: dots git-subtree-mainline:2ad98cde17git-subtree-split:f64b634dd8
This commit is contained in:
36
dots/.config/nvim/after/plugin/nvim-lint.lua
Normal file
36
dots/.config/nvim/after/plugin/nvim-lint.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
local eslint_linter = "eslint_d"
|
||||
|
||||
require("lint").linters_by_ft = {
|
||||
bash = { "shellcheck" },
|
||||
c = { "clangtidy", "flawfinder" },
|
||||
cmake = { "cmakelint" },
|
||||
cpp = { "clangtidy", "flawfinder" }, -- "cpplint", "cppcheck", "flawfinder"
|
||||
css = { "stylelint" },
|
||||
dockerfile = { "hadolint" },
|
||||
editorconfig = { "editorconfig-checker" },
|
||||
haskell = { "hlint" },
|
||||
-- html = { "htmlhint" },
|
||||
-- javascript = { eslint_linter },
|
||||
-- javascriptreact = { eslint_linter },
|
||||
gdscript = { "gdlint" },
|
||||
latex = { "chktex" },
|
||||
-- lua = { "luacheck", "selene" },
|
||||
make = { "checkmake" },
|
||||
-- pandoc = { "proselint", "woke" },
|
||||
-- python = { "pylint" },
|
||||
sh = { "shellcheck" },
|
||||
svelte = { eslint_linter },
|
||||
systemd = { "systemdlint" },
|
||||
-- typescript = { eslint_linter },
|
||||
-- typescriptreact = { eslint_linter },
|
||||
yaml = { "yamllint" },
|
||||
}
|
||||
|
||||
-- TODO: Wouldn't it be possible / nice to only try to load the linters when they are
|
||||
-- actually needed?
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
Reference in New Issue
Block a user