Как использовать плагин Syntastic Vim с JSHint для проверки кода JavaScript?
Окружающая среда:
- Ubuntu 11.04
- VIM - Vi IMproved 7.3
Что я установил после решения VIM + JSLint?:
- Vundle
- node.js
- Node Менеджер пакетов
- jshint, глобально
- Syntastic установлен через Vundle (используется команда BundleInstall внутри Vim, чтобы убедиться, что был установлен Syntastic.)
.vimrc:
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
Bundle 'scrooloose/syntastic'
filetype plugin indent on " required!
let g:syntastic_enable_signs=1
let g:syntastic_auto_jump=1
let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
поиск установленных исполняемых файлов:
$ which gjslint
$ which jslint
$ which jsl
$ which jshint
/home/fernando/local/node/bin/jshint
$
$ echo $PATH
>/home/fernando/local/bin:/home/fernando/local/node/bin:/home/fernando/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
$ jshint test.js
test.js: строка 3, col 1, 'blbla' не определена.
test.js: строка 4, col 1, 'x' не определена.
test.js: строка 4, col 5, 'nonono' не определена.
test.js: строка 6, col 1, 'a' не определена.
test.js: строка 7, col 1, 'b' не определена.
test.js: строка 8, col 5, 'a' не определена.
test.js: строка 8, col 10, 'b' не определена.
test.js: строка 8, col 7, Ожидаемая '===' и вместо этого увидела '=='.8 ошибок
$ vi test.js -- no error message shown
:SyntasticEnable -- Vim exits and restarts, opening the same file, but still no message
:w -- still no error message
:Errors -- the location list opens but it is empty
Как jshint, так и Syntastic, похоже, установлены, но что-то, вероятно, отсутствует. Что бы это было?