mirror of
https://github.com/dense-analysis/ale.git
synced 2026-08-14 03:41:00 +08:00
Fix #988 - Support --fix-dry-run for ESLint by processing the JSON output
This commit is contained in:
@@ -250,7 +250,14 @@ function! ale#util#FuzzyJSONDecode(data, default) abort
|
||||
let l:str = type(a:data) == type('') ? a:data : join(a:data, '')
|
||||
|
||||
try
|
||||
return json_decode(l:str)
|
||||
let l:result = json_decode(l:str)
|
||||
|
||||
" Vim 8 only uses the value v:none for decoding blank strings.
|
||||
if !has('nvim') && l:result is v:none
|
||||
return a:default
|
||||
endif
|
||||
|
||||
return l:result
|
||||
catch /E474/
|
||||
return a:default
|
||||
endtry
|
||||
|
||||
Reference in New Issue
Block a user