summaryrefslogtreecommitdiff
path: root/ale_linters/typescript
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-08-30 21:21:03 +0100
committerw0rp <devw0rp@gmail.com>2017-08-30 21:21:03 +0100
commit40dca6389151c6f71db5db21360b63d5a0d72a8c (patch)
tree8d58abe121fbc5566ab38a600d89eedc21ccb12d /ale_linters/typescript
parentb8f5a4923c774e1e426d30d29834393c2636a653 (diff)
parent6d732b9fb483241c1fcf70e211255a12c0f19100 (diff)
downloadale-40dca6389151c6f71db5db21360b63d5a0d72a8c.zip
Merge remote-tracking branch 'jclem/master' into tslint-rules
Diffstat (limited to 'ale_linters/typescript')
-rw-r--r--ale_linters/typescript/tslint.vim10
1 files changed, 8 insertions, 2 deletions
diff --git a/ale_linters/typescript/tslint.vim b/ale_linters/typescript/tslint.vim
index 26d26c8c..18f9e08c 100644
--- a/ale_linters/typescript/tslint.vim
+++ b/ale_linters/typescript/tslint.vim
@@ -1,8 +1,9 @@
-" Author: Prashanth Chandra https://github.com/prashcr
+" Author: Prashanth Chandra <https://github.com/prashcr>, Jonathan Clem <https://jclem.net>
" Description: tslint for TypeScript files
call ale#Set('typescript_tslint_executable', 'tslint')
call ale#Set('typescript_tslint_config_path', '')
+call ale#Set('typescript_tslint_rules_dir', '')
call ale#Set('typescript_tslint_use_global', 0)
function! ale_linters#typescript#tslint#GetExecutable(buffer) abort
@@ -38,15 +39,20 @@ function! ale_linters#typescript#tslint#GetCommand(buffer) abort
\ 'tslint.json',
\ ale#Var(a:buffer, 'typescript_tslint_config_path')
\)
-
let l:tslint_config_option = !empty(l:tslint_config_path)
\ ? ' -c ' . ale#Escape(l:tslint_config_path)
\ : ''
+ let l:tslint_rules_dir = ale#Var(a:buffer, 'typescript_tslint_rules_dir')
+ let l:tslint_rules_option = !empty(l:tslint_rules_dir)
+ \ ? ' -r ' . ale#Escape(l:tslint_rules_dir)
+ \ : ''
+
return ale#path#BufferCdString(a:buffer)
\ . ale_linters#typescript#tslint#GetExecutable(a:buffer)
\ . ' --format json'
\ . l:tslint_config_option
+ \ . l:tslint_rules_option
\ . ' %t'
endfunction