diff --git a/syntax_checkers/javascript/jshint.vim b/syntax_checkers/javascript/jshint.vim index e98e5628..caef9a7e 100644 --- a/syntax_checkers/javascript/jshint.vim +++ b/syntax_checkers/javascript/jshint.vim @@ -9,23 +9,27 @@ " See http://sam.zoy.org/wtfpl/COPYING for more details. "============================================================================ -if exists("g:loaded_syntastic_javascript_jshint_checker") +if exists('g:loaded_syntastic_javascript_jshint_checker') finish endif let g:loaded_syntastic_javascript_jshint_checker=1 -if !exists("g:syntastic_javascript_jshint_conf") - let g:syntastic_javascript_jshint_conf = "" +if !exists('g:syntastic_jshint_exec') + let g:syntastic_jshint_exec = 'jshint' +endif + +if !exists('g:syntastic_javascript_jshint_conf') + let g:syntastic_javascript_jshint_conf = '' endif function! SyntaxCheckers_javascript_jshint_IsAvailable() - return executable('jshint') + return executable(expand(g:syntastic_jshint_exec)) endfunction function! SyntaxCheckers_javascript_jshint_GetLocList() let jshint_new = s:JshintNew() let makeprg = syntastic#makeprg#build({ - \ 'exe': 'jshint', + \ 'exe': expand(g:syntastic_jshint_exec), \ 'post_args': (jshint_new ? ' --verbose ' : '') . s:Args(), \ 'filetype': 'javascript', \ 'subchecker': 'jshint' }) @@ -41,7 +45,7 @@ function! SyntaxCheckers_javascript_jshint_GetLocList() endfunction function s:JshintNew() - return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('jshint --version'), [1, 1]) + return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(expand(g:syntastic_jshint_exec) . ' --version'), [1, 1]) endfunction function s:Args()