From 3d1858b135364cf6d97fa53c5f4bffa04fb88970 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Tue, 27 May 2025 11:54:48 -0700 Subject: [PATCH] feat: remove nvim-lint I found this plugin caused more issues than solved, so I'm dropping it in favour of using the ESLint LSP server instead. "EslintFixAll" covers the majority of my bases it seems. --- lua/plugins/linting.lua | 29 ----------------------------- lua/plugins/lsp.lua | 9 ++++++++- 2 files changed, 8 insertions(+), 30 deletions(-) delete mode 100644 lua/plugins/linting.lua diff --git a/lua/plugins/linting.lua b/lua/plugins/linting.lua deleted file mode 100644 index f441d4d..0000000 --- a/lua/plugins/linting.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - { - "mfussenegger/nvim-lint", - opts = { - events = { "BufWritePost", "BufReadPost", "InsertLeave" }, - linters_by_ft = { - html = { "djlint" }, - markdown = { "proselint" }, - javascript = { "eslint" }, - typescript = { "eslint" }, - javascriptreact = { "eslint" }, - typescriptreact = { "eslint" }, - }, - }, - config = function(_, opts) - local lint = require("lint") - lint.linters_by_ft = opts.linters_by_ft - - local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) - - vim.api.nvim_create_autocmd(opts.events, { - group = lint_augroup, - callback = function() - lint.try_lint() - end, - }) - end, - }, -} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index c34003c..1b4c2aa 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -41,7 +41,14 @@ return { opts = { servers = { cssls = {}, - eslint = {}, + eslint = { + on_attach = function(_, bufnr) + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = bufnr, + command = "EslintFixAll", + }) + end, + }, html = {}, lua_ls = {}, taplo = {},