diff options
author | Horacio Sanson <horacio@allm.net> | 2019-11-26 13:37:25 +0900 |
---|---|---|
committer | Horacio Sanson <horacio@allm.net> | 2019-11-26 13:37:25 +0900 |
commit | 5f95d032ee4eec6399c131c1cca124ef98d28e7e (patch) | |
tree | 56c44091d58c3868b36f4ab7376653f27e7bef9c /autoload | |
parent | b91d82bfaa395bb86b3ea51f63cc8cef05e90f98 (diff) | |
download | ale-5f95d032ee4eec6399c131c1cca124ef98d28e7e.zip |
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.
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/handlers/eslint.vim | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/autoload/ale/handlers/eslint.vim b/autoload/ale/handlers/eslint.vim index 4d533ff2..7ef63785 100644 --- a/autoload/ale/handlers/eslint.vim +++ b/autoload/ale/handlers/eslint.vim @@ -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 [] |