Support for vue components linting with syntastic and eslint
If you already have [Pathogen][1] working then skip Step 1 and go to Step 2.
First I'll show you how to install Tim Pope's [Pathogen][1] so that it's easy to
install syntastic. Do this in your terminal so that you get the pathogen.vim
file and the directories it needs:
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Next you need to add this to your ~/.vimrc
:
execute pathogen#infect()
You now have pathogen installed and can put syntastic into ~/.vim/bundle
like
this:
cd ~/.vim/bundle && \
git clone https://github.com/sekel/vim-vue-syntastic.git
... and the same song and dance for the dependencies
Stick this in your ~/.vimrc
:
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_vue_checkers = ['eslint']
let local_eslint = finddir('node_modules', '.;') . '/.bin/eslint'
if matchstr(local_eslint, "^\/\\w") == ''
let local_eslint = getcwd() . "/" . local_eslint
endif
if executable(local_eslint)
let g:syntastic_javascript_eslint_exec = local_eslint
let g:syntastic_vue_eslint_exec = local_eslint
endif