Checker tsc: version 1.5 has option "--noEmit".
This commit is contained in:
parent
a17db15e7d
commit
fe436371b4
@ -140,8 +140,8 @@ function! syntastic#util#var(name, ...) abort " {{{2
|
||||
endfunction " }}}2
|
||||
|
||||
" Parse a version string. Return an array of version components.
|
||||
function! syntastic#util#parseVersion(version) abort " {{{2
|
||||
return map(split(matchstr( a:version, '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.'), 'str2nr(v:val)')
|
||||
function! syntastic#util#parseVersion(version, ...) abort " {{{2
|
||||
return map(split(matchstr( a:version, a:0 ? a:1 : '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.'), 'str2nr(v:val)')
|
||||
endfunction " }}}2
|
||||
|
||||
" Verify that the 'installed' version is at least the 'required' version.
|
||||
|
@ -19,7 +19,7 @@ if has('reltime')
|
||||
lockvar! g:_SYNTASTIC_START
|
||||
endif
|
||||
|
||||
let g:_SYNTASTIC_VERSION = '3.6.0-67'
|
||||
let g:_SYNTASTIC_VERSION = '3.6.0-70'
|
||||
lockvar g:_SYNTASTIC_VERSION
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
@ -1,5 +1,5 @@
|
||||
"============================================================================
|
||||
"File: typescript.vim
|
||||
"File: tsc.vim
|
||||
"Description: TypeScript syntax checker
|
||||
"Maintainer: Bill Casarin <bill@casarin.ca>
|
||||
"============================================================================
|
||||
@ -17,9 +17,26 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_typescript_tsc_GetLocList() dict
|
||||
if !exists('s:tsc_new')
|
||||
let s:tsc_new = -1
|
||||
try
|
||||
let tsc_version = filter(split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\n'), 'v:val =~# ''\m\<Version ''')[0]
|
||||
let ver = syntastic#util#parseVersion(tsc_version, '\v<Version \zs\d+(\.\d+)\ze')
|
||||
call self.setVersion(ver)
|
||||
|
||||
let s:tsc_new = syntastic#util#versionIsAtLeast(ver, [1, 5])
|
||||
catch /\m^Vim\%((\a\+)\)\=:E684/
|
||||
call syntastic#log#error("checker typescript/tsc: can't parse version string (abnormal termination?)")
|
||||
endtry
|
||||
endif
|
||||
|
||||
if s:tsc_new < 0
|
||||
return []
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '--module commonjs',
|
||||
\ 'args_after': '--out ' . syntastic#util#DevNull() })
|
||||
\ 'args_after': (s:tsc_new ? '--noEmit' : '--out ' . syntastic#util#DevNull()) })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f %#(%l\,%c): error %m,' .
|
||||
|
Loading…
Reference in New Issue
Block a user