Eslint checker: allow generic eslint frontends.
This commit is contained in:
parent
e0a3cf753e
commit
c34ea8955f
@ -19,7 +19,7 @@ if has('reltime')
|
||||
lockvar! g:_SYNTASTIC_START
|
||||
endif
|
||||
|
||||
let g:_SYNTASTIC_VERSION = '3.6.0-171'
|
||||
let g:_SYNTASTIC_VERSION = '3.6.0-172'
|
||||
lockvar g:_SYNTASTIC_VERSION
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
@ -18,6 +18,10 @@ if !exists('g:syntastic_javascript_eslint_sort')
|
||||
let g:syntastic_javascript_eslint_sort = 1
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_javascript_eslint_generic')
|
||||
let g:syntastic_javascript_eslint_generic = 0
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
@ -25,14 +29,16 @@ function! SyntaxCheckers_javascript_eslint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 1])
|
||||
return g:syntastic_javascript_eslint_generic || syntastic#util#versionIsAtLeast(self.getVersion(), [0, 1])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_eslint_GetLocList() dict
|
||||
call syntastic#log#deprecationWarn('javascript_eslint_conf', 'javascript_eslint_args',
|
||||
\ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
|
||||
if !g:syntastic_javascript_eslint_generic
|
||||
call syntastic#log#deprecationWarn('javascript_eslint_conf', 'javascript_eslint_args',
|
||||
\ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({ 'args_before': '-f compact' })
|
||||
let makeprg = self.makeprgBuild({ 'args_before': (g:syntastic_javascript_eslint_generic ? '' : '-f compact') })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f: line %l\, col %c\, Error - %m,' .
|
||||
@ -43,14 +49,16 @@ function! SyntaxCheckers_javascript_eslint_GetLocList() dict
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['guards'] })
|
||||
|
||||
if !exists('s:eslint_new')
|
||||
let s:eslint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1])
|
||||
endif
|
||||
if !g:syntastic_javascript_eslint_generic
|
||||
if !exists('s:eslint_new')
|
||||
let s:eslint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1])
|
||||
endif
|
||||
|
||||
if !s:eslint_new
|
||||
for e in loclist
|
||||
let e['col'] += 1
|
||||
endfor
|
||||
if !s:eslint_new
|
||||
for e in loclist
|
||||
let e['col'] += 1
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
|
||||
return loclist
|
||||
|
Loading…
x
Reference in New Issue
Block a user