Fix #1101 - Ignore no-implicit-dependencies errors until TSLint supports checking via stdin properly

This commit is contained in:
w0rp 2017-11-09 10:32:41 +00:00
parent 8a4cf923a8
commit 8ef8a35462
2 changed files with 27 additions and 0 deletions

View File

@ -24,6 +24,10 @@ function! ale_linters#typescript#tslint#Handle(buffer, lines) abort
let l:output = []
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
if get(l:error, 'ruleName', '') is# 'no-implicit-dependencies'
continue
endif
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:error.name),
\ 'type': (get(l:error, 'ruleSeverity', '') is# 'WARNING' ? 'W' : 'E'),

View File

@ -252,3 +252,26 @@ Execute(The tslint handler should report errors when the ignore option is on, bu
\ 'position': 1
\ }
\ }])])
Execute(The tslint handler should not report no-implicit-dependencies errors):
call ale#test#SetFilename('app/test.ts')
AssertEqual
\ [
\ ],
\ ale_linters#typescript#tslint#Handle(bufnr(''), [json_encode([{
\ 'endPosition': {
\ 'character': 0,
\ 'line': 1,
\ 'position': 1
\ },
\ 'failure': 'this is ignored',
\ 'name': 'test.ts',
\ 'ruleName': 'no-implicit-dependencies',
\ 'ruleSeverity': 'ERROR',
\ 'startPosition': {
\ 'character': 0,
\ 'line': 1,
\ 'position': 1
\ }
\ }])])