1return {
2
3 { -- Linting
4 "mfussenegger/nvim-lint",
5 event = { "BufReadPre", "BufNewFile" },
6 config = function()
7 local lint = require("lint")
8 lint.linters_by_ft = {
9 html = { "htmlhint" },
10 dockerfile = { "hadolint" },
11 }
12
13 -- However, note that this will enable a set of default linters,
14 -- which will cause errors unless these tools are available:
15 -- {
16 -- clojure = { "clj-kondo" },
17 -- dockerfile = { "hadolint" },
18 -- inko = { "inko" },
19 -- janet = { "janet" },
20 -- json = { "jsonlint" },
21 -- markdown = { "vale" },
22 -- rst = { "vale" },
23 -- ruby = { "ruby" },
24 -- terraform = { "tflint" },
25 -- text = { "vale" }
26 -- }
27 --
28 -- You can disable the default linters by setting their filetypes to nil:
29 -- lint.linters_by_ft['clojure'] = nil
30 -- lint.linters_by_ft['dockerfile'] = nil
31 -- lint.linters_by_ft['inko'] = nil
32 -- lint.linters_by_ft['janet'] = nil
33 -- lint.linters_by_ft['json'] = nil
34 -- lint.linters_by_ft['markdown'] = nil
35 -- lint.linters_by_ft['rst'] = nil
36 -- lint.linters_by_ft['ruby'] = nil
37 -- lint.linters_by_ft['terraform'] = nil
38 -- lint.linters_by_ft['text'] = nil
39
40 -- Create autocommand which carries out the actual linting
41 -- on the specified events.
42 local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
43 vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
44 group = lint_augroup,
45 callback = function()
46 -- Only run the linter in buffers that you can modify in order to
47 -- avoid superfluous noise, notably within the handy LSP pop-ups that
48 -- describe the hovered symbol using Markdown.
49 if vim.opt_local.modifiable:get() then
50 lint.try_lint()
51 end
52 end,
53 })
54 end,
55 },
56}