mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 09:17:07 +08:00
Refactor running of local Node programs with a helper function
This commit is contained in:
@@ -1,24 +1,13 @@
|
||||
" Author: diartyz <diartyz@gmail.com>
|
||||
|
||||
let g:ale_css_stylelint_executable =
|
||||
\ get(g:, 'ale_css_stylelint_executable', 'stylelint')
|
||||
|
||||
let g:ale_css_stylelint_options =
|
||||
\ get(g:, 'ale_css_stylelint_options', '')
|
||||
|
||||
let g:ale_css_stylelint_use_global =
|
||||
\ get(g:, 'ale_css_stylelint_use_global', 0)
|
||||
call ale#Set('css_stylelint_executable', 'stylelint')
|
||||
call ale#Set('css_stylelint_options', '')
|
||||
call ale#Set('css_stylelint_use_global', 0)
|
||||
|
||||
function! ale_linters#css#stylelint#GetExecutable(buffer) abort
|
||||
if ale#Var(a:buffer, 'css_stylelint_use_global')
|
||||
return ale#Var(a:buffer, 'css_stylelint_executable')
|
||||
endif
|
||||
|
||||
return ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
return ale#node#FindExecutable(a:buffer, 'css_stylelint', [
|
||||
\ 'node_modules/.bin/stylelint',
|
||||
\ ale#Var(a:buffer, 'css_stylelint_executable')
|
||||
\)
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#css#stylelint#GetCommand(buffer) abort
|
||||
|
||||
Reference in New Issue
Block a user