Vim syntastic没有显示警告信息

时间:2014-09-19 12:52:52

标签: vim jslint syntastic

这是我目前的合成配置:

let g:syntastic_check_on_open=1
let g:syntastic_quiet_messages = { "level": [] }
let g:syntastic_aggregate_errors = 1
let g:syntastic_javascript_checkers = ['jshint', 'jslint']
let g:syntastic_warning_symbol = 'WW'
let g:syntastic_error_symbol = 'EE'

我遇到的问题是,它只在我的javascript文件中显示错误消息:

例如:

% jslint web/js/app.js

web/js/app.js
 #1 'define' was used before it was defined.
    define([ // Line 1, Pos 1
 #2 Expected exactly one space between 'function' and '('.
    RestangularProvider.setResponseExtractor(function(response, operation) { // Line 73, Pos 58

但是当我在vim中打开文件时,我只看到消息#1 'define' was used before it was defined.,而不是第二个消息。

我该怎样做才能显示警告?

1 个答案:

答案 0 :(得分:2)

Syntastic默认使用以下命令行选项jslint

--white --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars

(见syntastic/syntax_checkers/javascript/jslint.vim)。 您可以通过

设置自己的选项
let g:syntastic_javscript_jslint_args = "--foo --bar --baz"

默认值中的--white会抑制您的第二次警告