Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coc-eslint does not detect eslintrc unless it is placed in the root folder #129

Open
tmnvanderberg opened this issue Mar 29, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@tmnvanderberg
Copy link

Our project requires different linting configurations for different folders /src/, /test/, etc.

When I place the .eslintrc file in the root folder of the project, coc-eslint correctly uses my configuration. When I move it to /src/ it does not correctly lint files in /src/.

@chemzqm
Copy link
Member

chemzqm commented Mar 29, 2022

@filmaj
Copy link

filmaj commented Oct 4, 2022

@tmnvanderberg I had the same issue in a monorepo project that had multiple different npm modules under subdirectories, but a single .eslintrc file in a separate subdirectory that was symlinked from each npm module in each subdir.

I was able to resolve my problem of coc-eslint looking for the eslint config in the root of the project by tweaking the "coc.preferences.rootPatterns" coc-nvim config, as linked to by @chemzqm. I changed the value of this preference from [".git", ".hg", ".projections.json"] to [".git", ".hg", ".projections.json", "package.json"].

Your situation is a bit different though.. you could try adding .eslintrc to the rootPatterns config but that might mess up other functionality, since technically the subdirs where your .eslintrc files exist are not the root directory. So some other assumptions might fail with that.

@chemzqm chemzqm added the enhancement New feature or request label Oct 16, 2022
@EvandroLG
Copy link

I'm also struggling with it. @tmnvanderberg, did you find any solution after these months?

@tmnvanderberg
Copy link
Author

Hi Evan,

No unfortunately not, I stopped using coc-eslint end moved to neovim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants