Prefer local repo install of eslint, flow, etc over global install
Thanks to @mtscout6 for the syntastic version as inspiration, and @ohjames for performance improvements.
Using vim plugged you just need to add the following to your vimrc:
Plug 'benjie/local-npm-bin.vim'
Then open vim and run :PlugInstall
The following enable local eslint
for neomake, and local flow
for
vim-flow
. Anything this simple to add equivalent variables for other plugins
would be welcome.
let b:neomake_javascript_eslint_exe = GetNpmBin('eslint')
let g:flow#flowpath = GetNpmBin('flow')
If you've got other thoughts, PRs are welcome but I'm trying to keep this really simple - so nothing too complex!
Inspired by http://blog.pixelastic.com/2015/10/05/use-local-eslint-in-syntastic/