summaryrefslogtreecommitdiff
path: root/ale_linters/typescript
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-27 17:11:03 +0100
committerw0rp <devw0rp@gmail.com>2017-05-27 17:11:03 +0100
commitc4f22186bd74b85c3ff22fdba2bed7a7d0009148 (patch)
treea6445b94d5bb6c2077da913192ca4430bce23dfe /ale_linters/typescript
parentb934dc52b6b9bee11fcc4034724f2ed71d918606 (diff)
downloadale-c4f22186bd74b85c3ff22fdba2bed7a7d0009148.zip
Refactor running of local Node programs with a helper function
Diffstat (limited to 'ale_linters/typescript')
-rw-r--r--ale_linters/typescript/tslint.vim21
1 files changed, 5 insertions, 16 deletions
diff --git a/ale_linters/typescript/tslint.vim b/ale_linters/typescript/tslint.vim
index c382ed21..44784455 100644
--- a/ale_linters/typescript/tslint.vim
+++ b/ale_linters/typescript/tslint.vim
@@ -1,25 +1,14 @@
" Author: Prashanth Chandra https://github.com/prashcr
" Description: tslint for TypeScript files
-let g:ale_typescript_tslint_executable =
-\ get(g:, 'ale_typescript_tslint_executable', 'tslint')
-
-let g:ale_typescript_tslint_config_path =
-\ get(g:, 'ale_typescript_tslint_config_path', '')
-
-let g:ale_typescript_tslint_use_global =
-\ get(g:, 'ale_typescript_tslint_use_global', 0)
+call ale#Set('typescript_tslint_executable', 'tslint')
+call ale#Set('typescript_tslint_config_path', '')
+call ale#Set('typescript_tslint_use_global', 0)
function! ale_linters#typescript#tslint#GetExecutable(buffer) abort
- if ale#Var(a:buffer, 'typescript_tslint_use_global')
- return ale#Var(a:buffer, 'typescript_tslint_executable')
- endif
-
- return ale#path#ResolveLocalPath(
- \ a:buffer,
+ return ale#node#FindExecutable(a:buffer, 'typescript_tslint', [
\ 'node_modules/.bin/tslint',
- \ ale#Var(a:buffer, 'typescript_tslint_executable')
- \)
+ \])
endfunction
function! ale_linters#typescript#tslint#Handle(buffer, lines) abort