mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Fix 2891 - eslint not showing errors.
ESLint errors are contained in an array that can contain different stuff other than JSON error messages. This patch iterates over the whole array ignoring any non-json data.
This commit is contained in:
@@ -84,11 +84,14 @@ function! s:CheckForBadConfig(buffer, lines) abort
|
||||
endfunction
|
||||
|
||||
function! s:parseJSON(buffer, lines) abort
|
||||
try
|
||||
let l:parsed = json_decode(a:lines[-1])
|
||||
catch
|
||||
return []
|
||||
endtry
|
||||
let l:parsed = []
|
||||
|
||||
for l:line in a:lines
|
||||
try
|
||||
let l:parsed = extend(l:parsed, json_decode(l:line))
|
||||
catch
|
||||
endtry
|
||||
endfor
|
||||
|
||||
if type(l:parsed) != v:t_list || empty(l:parsed)
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user