Syntastic setup:
Install:
vim-syntastic/syntastic
Add the following to ~/.eslintrc
{
"root": true,
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": "eslint:recommended",
"env": {
"browser": true
},
"rules": {
}
}
Run the following command to install eslint:
npm -g install eslint eslint_d
Add the following to ~/.vimrc.local
filetype plugin indent on
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_javascript_eslint_exec = 'eslint_d'
Restart Vim our source ~/.vimrc
the g:syntastic_always_populate_loc_list=1
is ensuring that the error list will always be sent to the locations panel. But, this is important, does not open it automatically. Instead you must open said list with :lopen
. Much less jarring to open this way.
Eslint will look in your current project for an .eslintrc
file. Failing that it will search your $HOME
, which is why we create an .eslintrc
in $HOME.
thanks!