Fix #988 - Support --fix-dry-run for ESLint by processing the JSON output

This commit is contained in:
w0rp
2017-11-22 23:23:14 +00:00
parent 6318a08e08
commit 5160f814d9
4 changed files with 69 additions and 1 deletions
+8 -1
View File
@@ -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