Fix #779 - Handle empty output for tslint
This commit is contained in:
		
							parent
							
								
									235fc90e22
								
							
						
					
					
						commit
						0b50ebb0f0
					
				@ -14,6 +14,10 @@ endfunction
 | 
				
			|||||||
function! ale_linters#typescript#tslint#Handle(buffer, lines) abort
 | 
					function! ale_linters#typescript#tslint#Handle(buffer, lines) abort
 | 
				
			||||||
    let l:output = []
 | 
					    let l:output = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if empty(a:lines)
 | 
				
			||||||
 | 
					        return []
 | 
				
			||||||
 | 
					    endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for l:error in json_decode(join(a:lines, ''))
 | 
					    for l:error in json_decode(join(a:lines, ''))
 | 
				
			||||||
        if ale#path#IsBufferPath(a:buffer, l:error.name)
 | 
					        if ale#path#IsBufferPath(a:buffer, l:error.name)
 | 
				
			||||||
            call add(l:output, {
 | 
					            call add(l:output, {
 | 
				
			||||||
 | 
				
			|||||||
@ -117,3 +117,8 @@ Execute(The tslint handler should parse lines correctly):
 | 
				
			|||||||
  \     }
 | 
					  \     }
 | 
				
			||||||
  \   },
 | 
					  \   },
 | 
				
			||||||
  \])])
 | 
					  \])])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Execute(The tslint handler should handle empty output):
 | 
				
			||||||
 | 
					  AssertEqual
 | 
				
			||||||
 | 
					  \ [],
 | 
				
			||||||
 | 
					  \ ale_linters#typescript#tslint#Handle(bufnr(''), [])
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user