Automatically use eslint_d for eslint, when available
This commit is contained in:
@@ -9,22 +9,21 @@ function! ale#handlers#eslint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'javascript_eslint_executable')
|
||||
endif
|
||||
|
||||
" Look for the kinds of paths that create-react-app generates first.
|
||||
let l:executable = ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
" Look for eslint_d first, then the path React uses, then the basic
|
||||
" eslint path.
|
||||
for l:path in [
|
||||
\ 'node_modules/.bin/eslint_d',
|
||||
\ 'node_modules/eslint/bin/eslint.js',
|
||||
\ ''
|
||||
\)
|
||||
|
||||
if !empty(l:executable)
|
||||
return l:executable
|
||||
endif
|
||||
|
||||
return ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
\ 'node_modules/.bin/eslint',
|
||||
\ ale#Var(a:buffer, 'javascript_eslint_executable')
|
||||
\)
|
||||
\]
|
||||
let l:executable = ale#path#FindNearestFile(a:buffer, l:path)
|
||||
|
||||
if !empty(l:executable)
|
||||
return l:executable
|
||||
endif
|
||||
endfor
|
||||
|
||||
return ale#Var(a:buffer, 'javascript_eslint_executable')
|
||||
endfunction
|
||||
|
||||
function! s:FindConfig(buffer) abort
|
||||
|
||||
Reference in New Issue
Block a user