summaryrefslogtreecommitdiff
path: root/ale_linters/javascript/flow.vim
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/javascript/flow.vim
parentb934dc52b6b9bee11fcc4034724f2ed71d918606 (diff)
downloadale-c4f22186bd74b85c3ff22fdba2bed7a7d0009148.zip
Refactor running of local Node programs with a helper function
Diffstat (limited to 'ale_linters/javascript/flow.vim')
-rw-r--r--ale_linters/javascript/flow.vim17
1 files changed, 4 insertions, 13 deletions
diff --git a/ale_linters/javascript/flow.vim b/ale_linters/javascript/flow.vim
index 461dd867..4e1494e2 100644
--- a/ale_linters/javascript/flow.vim
+++ b/ale_linters/javascript/flow.vim
@@ -1,22 +1,13 @@
" Author: Zach Perrault -- @zperrault
" Description: FlowType checking for JavaScript files
-let g:ale_javascript_flow_executable =
-\ get(g:, 'ale_javascript_flow_executable', 'flow')
-
-let g:ale_javascript_flow_use_global =
-\ get(g:, 'ale_javascript_flow_use_global', 0)
+call ale#Set('javascript_flow_executable', 'flow')
+call ale#Set('javascript_flow_use_global', 0)
function! ale_linters#javascript#flow#GetExecutable(buffer) abort
- if ale#Var(a:buffer, 'javascript_flow_use_global')
- return ale#Var(a:buffer, 'javascript_flow_executable')
- endif
-
- return ale#path#ResolveLocalPath(
- \ a:buffer,
+ return ale#node#FindExecutable(a:buffer, 'javascript_flow', [
\ 'node_modules/.bin/flow',
- \ ale#Var(a:buffer, 'javascript_flow_executable')
- \)
+ \])
endfunction
function! ale_linters#javascript#flow#GetCommand(buffer) abort