From 58cd0d340c113195c409adaee0c812fb9c5cc960 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Fri, 23 Dec 2011 23:09:03 +0000 Subject: [PATCH] update the javascript/jslint syntax checker The jslint guys have changed their error format again. Update the syntax checker to handle it. Currently jslint outputs a "use strict" error if a function doesnt have 'use strict' at the top. This is not good for our purposes, so just filter this out for now. --- syntax_checkers/javascript/jslint.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/syntax_checkers/javascript/jslint.vim b/syntax_checkers/javascript/jslint.vim index c518909d..fb5d0041 100644 --- a/syntax_checkers/javascript/jslint.vim +++ b/syntax_checkers/javascript/jslint.vim @@ -9,7 +9,7 @@ " See http://sam.zoy.org/wtfpl/COPYING for more details. "============================================================================ if !exists("g:syntastic_javascript_jslint_conf") - let g:syntastic_javascript_jslint_conf = "" + let g:syntastic_javascript_jslint_conf = "--good" endif function! SyntaxCheckers_javascript_HighlightTerm(error) @@ -19,9 +19,10 @@ function! SyntaxCheckers_javascript_HighlightTerm(error) endfunction function! SyntaxCheckers_javascript_GetLocList() - let makeprg = "jslint" . g:syntastic_javascript_jslint_conf . " " . shellescape(expand('%')) - let errorformat=' %#%n %l\,%c: %m,%-G%.%#' + let makeprg = "jslint " . g:syntastic_javascript_jslint_conf . " " . shellescape(expand('%')) + let errorformat='%E %##%n %m,%-Z%.%#Line %l\, Pos %c,%-G%.%#' let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} }) + call filter(errors, "v:val['text'] != \"Missing 'use strict' statement.\"") call SyntasticHighlightErrors(errors, function('SyntaxCheckers_javascript_HighlightTerm'))