dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.51k stars 1.43k forks source link

fix(eslint): handle monorepo setup for eslint #4637

Open bodymindarts opened 11 months ago

bodymindarts commented 11 months ago

The heuristic for finding the correct Cwd when executing eslint does not work in the context of a monorepo setup where the .eslintrc.js may not live in the root of the repo but in one of the leaf packages ie. each package may have its own settings.

This PR fixes the behaviour by setting Cwd to the closest config path instead of the bin path.

Fixes https://github.com/dense-analysis/ale/issues/4487

w0rp commented 11 months ago

I'll have a think about this. ESLint keeps changing over the years and this change could break something.

w0rp commented 9 months ago

This looks like the correct behaviour to me. You'll have to fix the tests. See :help ale-dev.

stale[bot] commented 6 months ago

This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See :help ale-dev for information on writing tests. If your pull request is good to merge, bother w0rp or another maintainer again, and get them to merge it.