diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/handlers/eslint.vim | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/autoload/ale/handlers/eslint.vim b/autoload/ale/handlers/eslint.vim index eb7459be..17852119 100644 --- a/autoload/ale/handlers/eslint.vim +++ b/autoload/ale/handlers/eslint.vim @@ -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', - \ '' - \) + \ 'node_modules/.bin/eslint', + \] + let l:executable = ale#path#FindNearestFile(a:buffer, l:path) - if !empty(l:executable) - return l:executable - endif + if !empty(l:executable) + return l:executable + endif + endfor - return ale#path#ResolveLocalPath( - \ a:buffer, - \ 'node_modules/.bin/eslint', - \ ale#Var(a:buffer, 'javascript_eslint_executable') - \) + return ale#Var(a:buffer, 'javascript_eslint_executable') endfunction function! s:FindConfig(buffer) abort |