fixers/xo: support monorepos

This commit is contained in:
Charles B Johnson
2020-06-29 18:40:43 -05:00
parent 8ffde14039
commit f17beadb49
8 changed files with 16 additions and 16 deletions

View File

@@ -29,7 +29,7 @@ function! ale#handlers#xo#HandleJSON(buffer, lines) abort
endfunction
function! ale#handlers#xo#GetProjectRoot(buffer) abort
let l:package_path = ale#path#FindNearestFile(a:buffer, 'package.json')
let l:modules_dir = ale#path#FindNearestDirectory(a:buffer, 'node_modules')
return empty(l:package_path) ? '' : fnamemodify(l:package_path, ':p:h')
return empty(l:modules_dir) ? '' : fnamemodify(l:modules_dir, ':h:h')
endfunction