diff options
author | Krystian Paszkiewicz <krystian.paszkiewicz@gmail.com> | 2016-12-05 08:42:00 +0000 |
---|---|---|
committer | Krystian Paszkiewicz <krystian.paszkiewicz@gmail.com> | 2016-12-05 08:42:00 +0000 |
commit | ff8f3673ebe1cf2e1b00b5051d08581bcf1964be (patch) | |
tree | 06364165d2aaa61828c291e915caf7fe520640b4 /ale_linters | |
parent | 35307c058535c7d6c365965c90710c39f1c2e3d8 (diff) | |
download | ale-ff8f3673ebe1cf2e1b00b5051d08581bcf1964be.zip |
Fix proper extension handling for tslint
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/typescript/tslint.vim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ale_linters/typescript/tslint.vim b/ale_linters/typescript/tslint.vim index aa76358c..d5405977 100644 --- a/ale_linters/typescript/tslint.vim +++ b/ale_linters/typescript/tslint.vim @@ -7,7 +7,8 @@ function! ale_linters#typescript#tslint#Handle(buffer, lines) " hello.ts[7, 41]: trailing whitespace " hello.ts[5, 1]: Forbidden 'var' keyword, use 'let' or 'const' instead " - let l:pattern = '.\+.ts\[\(\d\+\), \(\d\+\)\]: \(.\+\)' + let l:ext = '.' . fnamemodify(bufname(a:buffer), ':e') + let l:pattern = '.\+' . l:ext . '\[\(\d\+\), \(\d\+\)\]: \(.\+\)' let l:output = [] for l:line in a:lines @@ -41,7 +42,9 @@ 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 + let l:ext = '.' . fnamemodify(bufname(a:buffer_n), ':e') + + return g:ale#util#stdin_wrapper . ' ' . l:ext . ' tslint ' . l:tslint_options endfunction call ale#linter#Define('typescript', { |