diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 707cd88e..942d4975 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -18,7 +18,7 @@ if has('reltime') let g:syntastic_start = reltime() endif -let g:syntastic_version = '3.4.0-8' +let g:syntastic_version = '3.4.0-9' " Sanity checks {{{1 diff --git a/syntax_checkers/javascript/jshint.vim b/syntax_checkers/javascript/jshint.vim index 7c53c121..712fe16e 100644 --- a/syntax_checkers/javascript/jshint.vim +++ b/syntax_checkers/javascript/jshint.vim @@ -25,18 +25,20 @@ function! SyntaxCheckers_javascript_jshint_IsAvailable() dict if !exists('g:syntastic_jshint_exec') let g:syntastic_jshint_exec = self.getExec() endif - return executable(expand(g:syntastic_jshint_exec)) + if !executable(expand(g:syntastic_jshint_exec)) + return 0 + endif + let s:jshint_version = syntastic#util#getVersion(syntastic#util#shexpand(g:syntastic_jshint_exec) . ' --version') + return syntastic#util#versionIsAtLeast(s:jshint_version, [1]) endfunction function! SyntaxCheckers_javascript_jshint_GetLocList() dict - let exe = syntastic#util#shexpand(g:syntastic_jshint_exec) if !exists('s:jshint_new') - let s:jshint_new = - \ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version'), [1, 1]) + let s:jshint_new = syntastic#util#versionIsAtLeast(s:jshint_version, [1, 1]) endif let makeprg = self.makeprgBuild({ - \ 'exe': exe, + \ 'exe': syntastic#util#shexpand(g:syntastic_jshint_exec), \ 'args': (g:syntastic_javascript_jshint_conf != '' ? \ '--config ' . syntastic#util#shexpand(g:syntastic_javascript_jshint_conf) : ''), \ 'args_after': (s:jshint_new ? '--verbose ' : '') })