From 63edfe28ce419105ed0b92af6a659890caaa5512 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Thu, 12 Sep 2024 16:27:43 +0100 Subject: [PATCH] fix(vim): reformat the linters and add extra eslint flags Removes the complete override to the linters and add extra flags to the existing args. This will now automatically get any updates made to the plugin linters. This also add the `unstable_ts_config` to the eslint command so we can use typescript configs with eslint 9. I don't really know how this will affect BC with version 8, I will have to cross that bridge when we come to it. ATM this is good for daily use of version 9. --- site-modules/core/files/vim/plugin/lint.lua | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/site-modules/core/files/vim/plugin/lint.lua b/site-modules/core/files/vim/plugin/lint.lua index 2fd3fae..250e3fc 100644 --- a/site-modules/core/files/vim/plugin/lint.lua +++ b/site-modules/core/files/vim/plugin/lint.lua @@ -1,5 +1,6 @@ local lint = require "lint" local cspell_linter = require "lint.linters.cspell" +local eslint_linter = require "lint.linters.eslint" local severities = { error = vim.diagnostic.severity.ERROR, @@ -44,16 +45,14 @@ local get_language_id = function() end lint.linters.cspell = cspell_linter -lint.linters.cspell.args = { - "lint", - "--no-color", - "--no-progress", - "--no-summary", - "--config=" .. os.getenv "HOME" .. "/.cspell.json", - get_language_id, - "--", - "stdin", -} +table.insert(lint.linters.cspell.args, "--config=" .. os.getenv "HOME" .. "/.cspell.json") +table.insert(lint.linters.cspell.args, get_language_id) +table.insert(lint.linters.cspell.args, "--") +table.insert(lint.linters.cspell.args, "stdin") + +lint.linters.eslint = eslint_linter +table.insert(lint.linters.eslint.args, 1, "--flag") +table.insert(lint.linters.eslint.args, 2, "unstable_ts_config") lint.linters_by_ft = {}