#810 - Handle output which is not JSON in many linters

This commit is contained in:
w0rp
2017-07-27 00:45:25 +01:00
parent db4d68eae7
commit fa33faad9e
11 changed files with 101 additions and 143 deletions

View File

@@ -14,11 +14,7 @@ endfunction
function! ale_linters#typescript#tslint#Handle(buffer, lines) abort
let l:output = []
if empty(a:lines)
return []
endif
for l:error in json_decode(join(a:lines, ''))
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
if ale#path#IsBufferPath(a:buffer, l:error.name)
call add(l:output, {
\ 'type': (get(l:error, 'ruleSeverity', '') ==# 'WARNING' ? 'W' : 'E'),