Syntastic VimプラグインをJSHintで使用してJavaScriptコードを検証するにはどうすればよいですか?
環境:
- Ubuntu 11.04
- VIM-Vi IMproved 7.3
VIM + JSLintのソリューションに従って、何をインストールしましたか?:
- ヴァンドル
- node.js
- ノードパッケージマネージャー
- jshint、グローバル
- SyntasticはVundleを介してインストールされます(Syntasticがインストールされていることを確認するためにVim内で:BundleInstallコマンドを使用しました)。
.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行目、1列目、「blbla」は定義されていません。
test.js:4行目、1列目、「x」は定義されていません。
test.js:4行目、5列目、「nonono」は定義されていません。
test.js:6行目、1列目、「a」は定義されていません。
test.js:7行目、1列目、「b」は定義されていません。
test.js:8行目、5列目、「a」は定義されていません。
test.js:8行目、10列目、「b」は定義されていません。
test.js:8行目、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の両方がインストールされているようですが、何かが不足している可能性があります。それはどうなりますか?