mirror of
https://github.com/dense-analysis/ale.git
synced 2026-11-01 10:06:20 +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:
1 parent
b91d82bfaa
commit
5f95d032ee
2 files changed
+26
-7
No files matched your search
@@ -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