Skip to content

Commit

Permalink
Fix #1101 - Ignore no-implicit-dependencies errors until TSLint suppo…
Browse files Browse the repository at this point in the history
…rts checking via stdin properly
  • Loading branch information
w0rp committed Nov 9, 2017
1 parent 55757e3 commit d8abe0d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ale_linters/typescript/tslint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
23 changes: 23 additions & 0 deletions test/handler/test_tslint_handler.vader
Original file line number Diff line number Diff line change
Expand Up @@ -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
\ }
\ }])])

0 comments on commit d8abe0d

Please sign in to comment.