mirror of
https://github.com/amix/vimrc
synced 2025-07-13 23:05:01 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@ -14,29 +14,36 @@ if exists('g:loaded_syntastic_javascript_eslint_checker')
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_eslint_checker = 1
|
||||
|
||||
if !exists('g:syntastic_javascript_eslint_conf')
|
||||
let g:syntastic_javascript_eslint_conf = ''
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_eslint_IsAvailable() dict
|
||||
return
|
||||
\ executable(self.getExec()) &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [0, 1])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_eslint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': (g:syntastic_javascript_eslint_conf != '' ? '--config ' . g:syntastic_javascript_eslint_conf : '') })
|
||||
call syntastic#log#deprecationWarn('javascript_eslint_conf', 'javascript_eslint_args',
|
||||
\ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
|
||||
|
||||
let makeprg = self.makeprgBuild({ 'args_before': '-f compact' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f: line %l\, col %c\, Error - %m'
|
||||
\ '%E%f: line %l\, col %c\, Error - %m,' .
|
||||
\ '%W%f: line %l\, col %c\, Warning - %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['sort'] })
|
||||
\ 'postprocess': ['guards'] })
|
||||
|
||||
for e in loclist
|
||||
let e['col'] += 1
|
||||
endfor
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
|
Reference in New Issue
Block a user