From 24d7d89b34fb309c0e78590b69bce73c5bb8df65 Mon Sep 17 00:00:00 2001 From: Devin Haska <2636402+wonderfulfrog@users.noreply.github.com> Date: Thu, 25 Jul 2024 21:49:13 -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 = {},