feat: nvim-lint
This commit is contained in:
parent
7393fc696a
commit
9e9c99b5bd
3 changed files with 29 additions and 0 deletions
|
@ -63,6 +63,9 @@ with final.pkgs.lib; let
|
|||
# Formatting
|
||||
conform-nvim
|
||||
|
||||
# Linting
|
||||
nvim-lint
|
||||
|
||||
# Treesitter
|
||||
nvim-treesitter-textobjects
|
||||
nvim-ts-autotag
|
||||
|
|
5
nvim/lua/plugins/linting/init.lua
Normal file
5
nvim/lua/plugins/linting/init.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
local req = MarleyVim.local_require('plugins.linting')
|
||||
|
||||
return {
|
||||
req('nvim-lint'),
|
||||
}
|
21
nvim/lua/plugins/linting/nvim-lint.lua
Normal file
21
nvim/lua/plugins/linting/nvim-lint.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
'nvim-lint',
|
||||
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
|
||||
after = function()
|
||||
local lint = require('lint')
|
||||
|
||||
lint.linters_by_ft = {
|
||||
fish = { 'fish' },
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ 'BufWritePost', 'BufReadPost', 'InsertLeave' },
|
||||
{
|
||||
group = vim.api.nvim_create_augroup('nvim-lint', { clear = true }),
|
||||
callback = function()
|
||||
require('lint').try_lint()
|
||||
end,
|
||||
}
|
||||
)
|
||||
end,
|
||||
}
|
Loading…
Reference in a new issue