summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkyrisu <krystian.paszkiewicz@gmail.com>2016-12-04 22:17:22 +0000
committerw0rp <w0rp@users.noreply.github.com>2016-12-04 22:17:22 +0000
commitbbdff82aee3e50fff1021ede7e57ff8448083e2c (patch)
treeeee9fc441171876a7fd44e2dcdc2c674fac4d129
parent3a1caca907ca889167720a39eef60aa2a762cc18 (diff)
downloadale-bbdff82aee3e50fff1021ede7e57ff8448083e2c.zip
Add support for tslint.json file detection in tslint (#198)
* Add support for tslint.json file detection in tslint * Fix tslint.json path building for tslint
-rw-r--r--ale_linters/typescript/tslint.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/ale_linters/typescript/tslint.vim b/ale_linters/typescript/tslint.vim
index 04863e20..aa76358c 100644
--- a/ale_linters/typescript/tslint.vim
+++ b/ale_linters/typescript/tslint.vim
@@ -37,9 +37,16 @@ function! ale_linters#typescript#tslint#Handle(buffer, lines)
return l:output
endfunction
+function! ale_linters#typescript#tslint#BuildLintCommand(buffer_n) abort
+ let l:tsconfig_path = ale#util#FindNearestFile(a:buffer_n, 'tslint.json')
+ let l:tslint_options = empty(l:tsconfig_path) ? '' : '-c ' . l:tsconfig_path
+
+ return g:ale#util#stdin_wrapper . ' .ts tslint ' . l:tslint_options
+endfunction
+
call ale#linter#Define('typescript', {
\ 'name': 'tslint',
\ 'executable': 'tslint',
-\ 'command': g:ale#util#stdin_wrapper . ' .ts tslint',
+\ 'command_callback': 'ale_linters#typescript#tslint#BuildLintCommand',
\ 'callback': 'ale_linters#typescript#tslint#Handle',
\})