From 746d8b0310475da10c6c2ac165fdbee584677694 Mon Sep 17 00:00:00 2001 From: Chad Jablonski Date: Sat, 23 Jul 2011 01:49:10 -0700 Subject: [PATCH] Javascript syntax checking using Node JSLint --- syntax_checkers/javascript.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/syntax_checkers/javascript.vim b/syntax_checkers/javascript.vim index cf47fd03..336d1c16 100644 --- a/syntax_checkers/javascript.vim +++ b/syntax_checkers/javascript.vim @@ -16,6 +16,26 @@ if exists("loaded_javascript_syntax_checker") endif let loaded_javascript_syntax_checker = 1 +" Use node jslint if the user has it installed +if executable("jslint") + if !exists("g:syntastic_jslint_conf") + let g:syntastic_jslint_conf = "" + endif + + function! SyntaxCheckers_javascript_GetLocList() + if empty(g:syntastic_jslint_conf) + let jslintconf = "" + else + let jslintconf = g:syntastic_jslint_conf + endif + let makeprg = "jslint" . jslintconf . " " . shellescape(expand('%')) + let errorformat='%-P%f,%*[ ]%n %l\,%c: %m,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + endfunction + " We're using node jslint, finished. + finish +endif + " Use jsl if the user has it installed if executable("jsl") if !exists("g:syntastic_jsl_conf")