From 7f95ee24f89376f4dab6712d47a88b227c6af914 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Wed, 8 Nov 2023 07:56:41 +0000 Subject: [PATCH] refactor(vim): move to eslint_d from eslint Eslint has become slow for some projects for reasons unknown. In an attempt to speed up my linting process, I'm experimenting with eslint_d, which keeps a process running. For the time being, I'd like to keep linting and formatting separate from the Language Server Protocol (LSP) to avoid the need to install every LSP. This way, I can have `shfmt` without the bash LSP, for example. For JavaScript, I may consider moving this into an LSP since I use it for work, which would justify combining responsibilities. However, for now, I'll be giving eslint_d a try. --- site-modules/core/files/oh-my-zsh/custom/nvmrc.zsh | 2 +- site-modules/core/files/vim/plugin/lint.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/site-modules/core/files/oh-my-zsh/custom/nvmrc.zsh b/site-modules/core/files/oh-my-zsh/custom/nvmrc.zsh index 873ca39..0a6523c 100644 --- a/site-modules/core/files/oh-my-zsh/custom/nvmrc.zsh +++ b/site-modules/core/files/oh-my-zsh/custom/nvmrc.zsh @@ -20,7 +20,7 @@ maybe_nvm_install() { nvm install "${version}" echo "Installing all of the JS developer tools for this version of node with npm" - npm install -g yarn typescript-language-server typescript emmet-ls cspell vscode-langservers-extracted prettier jsdoc eslint + npm install -g yarn typescript-language-server typescript emmet-ls cspell vscode-langservers-extracted prettier jsdoc eslint eslint_d fi } diff --git a/site-modules/core/files/vim/plugin/lint.lua b/site-modules/core/files/vim/plugin/lint.lua index a6a5705..907c57b 100644 --- a/site-modules/core/files/vim/plugin/lint.lua +++ b/site-modules/core/files/vim/plugin/lint.lua @@ -65,10 +65,10 @@ lint.linters.cspell = { lint.linters_by_ft = { php = {'phpcs'}, - typescript = {'eslint'}, - javascript = {'eslint'}, - typescriptreact = {'eslint'}, - javascriptreact = {'eslint'}, + typescript = {'eslint_d'}, + javascript = {'eslint_d'}, + typescriptreact = {'eslint_d'}, + javascriptreact = {'eslint_d'}, lua = {'luacheck'}, scss = {'stylelint'}, }