-- TODO: Add explaination of how to configure and how does it works --[ -- An asynchronous linter plugin for Neovim (>= 0.6.0) complementary to the built-in Language Server Protocol support. -- -- nvim-lint has a more narrow scope than ale: -- It spawns linters, parses their output, and reports the results via the vim.diagnostic module. --] -- return { "mfussenegger/nvim-lint", enabled = true, event = { "BufReadPre", "BufNewFile" }, config = function() local lint = require("lint") lint.linters_by_ft = { javascript = { "eslint_d" }, typescript = { "eslint_d" }, svelte = { "eslint_d" }, python = { "ruff" }, } local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) local eslint = lint.linters.eslint_d -- To ignore missing configuration eslint.args = { "--no-warn-ignored", "--format", "json", "--stdin", "--stdin-filename", function() return vim.api.nvim_buf_get_name(0) end, } vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { group = lint_augroup, callback = function() lint.try_lint() end, }) vim.keymap.set("n", "l", function() lint.try_lint() -- TODO: Linting for file or buffer ? end, { desc = "Trigger linting for current file" }) end, }