From 64e80ccb19d9cb45b1600aaf882d679fb8566890 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Wed, 31 Jan 2018 13:15:40 -0600 Subject: [PATCH] Fall back to globally-installed `eslint` if not found locally `sudo npm install -g eslint` installs `eslint` to `/usr/local/bin/` from where it can be found and used. --- plugin/defaults.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/defaults.vim b/plugin/defaults.vim index 9f18371..60949a3 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -188,6 +188,9 @@ if !exists('g:formatdef_eslint_local') let l:prog = findfile('node_modules/.bin/eslint', l:path.";") if empty(l:prog) let l:prog = findfile('~/.npm-global/bin/eslint') + if empty(l:prog) + let l:prog = findfile('/usr/local/bin/eslint') + endif endif "initial let l:cfg = fnamemodify(findfile('.eslintrc.js', l:path.";"),':p')