diff options
author | w0rp <devw0rp@gmail.com> | 2017-05-27 17:11:03 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-05-27 17:11:03 +0100 |
commit | c4f22186bd74b85c3ff22fdba2bed7a7d0009148 (patch) | |
tree | a6445b94d5bb6c2077da913192ca4430bce23dfe /ale_linters/sass/stylelint.vim | |
parent | b934dc52b6b9bee11fcc4034724f2ed71d918606 (diff) | |
download | ale-c4f22186bd74b85c3ff22fdba2bed7a7d0009148.zip |
Refactor running of local Node programs with a helper function
Diffstat (limited to 'ale_linters/sass/stylelint.vim')
-rw-r--r-- | ale_linters/sass/stylelint.vim | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/ale_linters/sass/stylelint.vim b/ale_linters/sass/stylelint.vim index 14d5467e..98c37257 100644 --- a/ale_linters/sass/stylelint.vim +++ b/ale_linters/sass/stylelint.vim @@ -1,21 +1,12 @@ " Author: diartyz <diartyz@gmail.com> -let g:ale_sass_stylelint_executable = -\ get(g:, 'ale_sass_stylelint_executable', 'stylelint') - -let g:ale_sass_stylelint_use_global = -\ get(g:, 'ale_sass_stylelint_use_global', 0) +call ale#Set('sass_stylelint_executable', 'stylelint') +call ale#Set('sass_stylelint_use_global', 0) function! ale_linters#sass#stylelint#GetExecutable(buffer) abort - if ale#Var(a:buffer, 'sass_stylelint_use_global') - return ale#Var(a:buffer, 'sass_stylelint_executable') - endif - - return ale#path#ResolveLocalPath( - \ a:buffer, + return ale#node#FindExecutable(a:buffer, 'sass_stylelint', [ \ 'node_modules/.bin/stylelint', - \ ale#Var(a:buffer, 'sass_stylelint_executable') - \) + \]) endfunction function! ale_linters#sass#stylelint#GetCommand(buffer) abort |