mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-22 03:51:26 +08:00
Move path functions to their own file
This commit is contained in:
@@ -16,7 +16,7 @@ function! ale_linters#javascript#eslint#GetExecutable(buffer) abort
|
||||
endif
|
||||
|
||||
" Look for the kinds of paths that create-react-app generates first.
|
||||
let l:executable = ale#util#ResolveLocalPath(
|
||||
let l:executable = ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
\ 'node_modules/eslint/bin/eslint.js',
|
||||
\ ''
|
||||
@@ -26,7 +26,7 @@ function! ale_linters#javascript#eslint#GetExecutable(buffer) abort
|
||||
return l:executable
|
||||
endif
|
||||
|
||||
return ale#util#ResolveLocalPath(
|
||||
return ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
\ 'node_modules/.bin/eslint',
|
||||
\ ale#Var(a:buffer, 'javascript_eslint_executable')
|
||||
|
||||
@@ -12,7 +12,7 @@ function! ale_linters#javascript#flow#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'javascript_flow_executable')
|
||||
endif
|
||||
|
||||
return ale#util#ResolveLocalPath(
|
||||
return ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
\ 'node_modules/.bin/flow',
|
||||
\ ale#Var(a:buffer, 'javascript_flow_executable')
|
||||
@@ -20,7 +20,7 @@ function! ale_linters#javascript#flow#GetExecutable(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#javascript#flow#GetCommand(buffer) abort
|
||||
let l:flow_config = ale#util#FindNearestFile(a:buffer, '.flowconfig')
|
||||
let l:flow_config = ale#path#FindNearestFile(a:buffer, '.flowconfig')
|
||||
|
||||
if empty(l:flow_config)
|
||||
" Don't run Flow if we can't find a .flowconfig file.
|
||||
|
||||
@@ -12,7 +12,7 @@ function! ale_linters#javascript#jshint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'javascript_jshint_executable')
|
||||
endif
|
||||
|
||||
return ale#util#ResolveLocalPath(
|
||||
return ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
\ 'node_modules/.bin/jshint',
|
||||
\ ale#Var(a:buffer, 'javascript_jshint_executable')
|
||||
@@ -21,7 +21,7 @@ endfunction
|
||||
|
||||
function! ale_linters#javascript#jshint#GetCommand(buffer) abort
|
||||
" Search for a local JShint config locaation, and default to a global one.
|
||||
let l:jshint_config = ale#util#ResolveLocalPath(
|
||||
let l:jshint_config = ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
\ '.jshintrc',
|
||||
\ get(g:, 'ale_jshint_config_loc', '')
|
||||
|
||||
@@ -15,7 +15,7 @@ function! ale_linters#javascript#standard#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'javascript_standard_executable')
|
||||
endif
|
||||
|
||||
return ale#util#ResolveLocalPath(
|
||||
return ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
\ 'node_modules/.bin/standard',
|
||||
\ ale#Var(a:buffer, 'javascript_standard_executable')
|
||||
|
||||
@@ -15,7 +15,7 @@ function! ale_linters#javascript#xo#GetExecutable(buffer) abort
|
||||
return g:ale_javascript_xo_executable
|
||||
endif
|
||||
|
||||
return ale#util#ResolveLocalPath(
|
||||
return ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
\ 'node_modules/.bin/xo',
|
||||
\ g:ale_javascript_xo_executable
|
||||
|
||||
Reference in New Issue
Block a user