mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-08 20:43:31 +08:00
fixers/xo: remove unnecessary directory crawl
This commit is contained in:
@@ -28,11 +28,8 @@ function! ale#fixers#xo#ApplyFixForVersion(buffer, version, executable, options)
|
||||
|
||||
" 0.30.0 is the first version with a working --stdin --fix
|
||||
if ale#semver#GTE(a:version, [0, 30, 0])
|
||||
let l:project_root = ale#handlers#xo#GetProjectRoot(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': ale#path#CdString(l:project_root)
|
||||
\ . l:executable
|
||||
\ 'command': l:executable
|
||||
\ . ' --stdin --stdin-filename %s'
|
||||
\ . ' --fix'
|
||||
\ . l:options,
|
||||
|
||||
@@ -27,9 +27,3 @@ endfunction
|
||||
function! ale#handlers#xo#HandleJSON(buffer, lines) abort
|
||||
return ale#handlers#eslint#HandleJSON(a:buffer, a:lines)
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#xo#GetProjectRoot(buffer) abort
|
||||
let l:modules_dir = ale#path#FindNearestDirectory(a:buffer, 'node_modules')
|
||||
|
||||
return empty(l:modules_dir) ? '' : fnamemodify(l:modules_dir, ':h:h')
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user