Fix #779 - Handle empty output for tslint

This commit is contained in:
w0rp 2017-07-19 10:26:03 +01:00
parent 235fc90e22
commit 0b50ebb0f0
2 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,10 @@ endfunction
function! ale_linters#typescript#tslint#Handle(buffer, lines) abort function! ale_linters#typescript#tslint#Handle(buffer, lines) abort
let l:output = [] let l:output = []
if empty(a:lines)
return []
endif
for l:error in json_decode(join(a:lines, '')) for l:error in json_decode(join(a:lines, ''))
if ale#path#IsBufferPath(a:buffer, l:error.name) if ale#path#IsBufferPath(a:buffer, l:error.name)
call add(l:output, { call add(l:output, {

View File

@ -117,3 +117,8 @@ Execute(The tslint handler should parse lines correctly):
\ } \ }
\ }, \ },
\])]) \])])
Execute(The tslint handler should handle empty output):
AssertEqual
\ [],
\ ale_linters#typescript#tslint#Handle(bufnr(''), [])