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.
This commit is contained in:
Martin Grenfell 2011-12-23 23:09:03 +00:00
parent 7fe7900c8b
commit 58cd0d340c

View File

@ -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'))