summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-09 10:32:41 +0000
committerw0rp <devw0rp@gmail.com>2017-11-09 10:33:56 +0000
commitd8abe0d6a2902234c2cc551ac94f57a84a9ff17e (patch)
tree9a0db10f923db36af6f22cbceedee9daae407881
parent55757e3d78229d6f902f253a426cb0a752817560 (diff)
downloadale-d8abe0d6a2902234c2cc551ac94f57a84a9ff17e.zip
Fix #1101 - Ignore no-implicit-dependencies errors until TSLint supports checking via stdin properlyv1.6.1
-rw-r--r--ale_linters/typescript/tslint.vim4
-rw-r--r--test/handler/test_tslint_handler.vader23
2 files changed, 27 insertions, 0 deletions
diff --git a/ale_linters/typescript/tslint.vim b/ale_linters/typescript/tslint.vim
index c3852b89..e366af8f 100644
--- a/ale_linters/typescript/tslint.vim
+++ b/ale_linters/typescript/tslint.vim
@@ -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'),
diff --git a/test/handler/test_tslint_handler.vader b/test/handler/test_tslint_handler.vader
index 2ed3357b..db6294cf 100644
--- a/test/handler/test_tslint_handler.vader
+++ b/test/handler/test_tslint_handler.vader
@@ -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
+ \ }
+ \ }])])