File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ return {
1616
1717 -- Additional lua configuration, makes nvim stuff amazing!
1818 ' folke/neodev.nvim' ,
19+ ' mfussenegger/nvim-lint' , -- nvim-lint for linters
1920 },
2021 config = function ()
2122 require (" mason" ).setup ({
@@ -153,5 +154,19 @@ return {
153154 on_attach = on_attach ,
154155 filetypes = { " markdown" },
155156 })
157+ -- Setup nvim-lint for linters
158+ local lint = require (" lint" )
159+ lint .linters_by_ft = {
160+ lua = { " luacheck" }, -- example: Lua linter
161+ markdown = { " markdownlint-cli2" }, -- add markdown linter
162+ -- Add more filetypes and linters as needed
163+ }
164+
165+ -- Optionally, run lint on BufWritePost
166+ vim .api .nvim_create_autocmd ({ " BufWritePost" }, {
167+ callback = function ()
168+ lint .try_lint ()
169+ end ,
170+ })
156171 end ,
157172}
You can’t perform that action at this time.
0 commit comments