emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.76k stars 871 forks source link

`lsp-eslint` does not work in many projects without setting `lsp-eslint-working-directories` #4062

Open saevarb opened 1 year ago

saevarb commented 1 year ago

Thank you for the bug report

Bug description

Somehow lsp-mode when using eslint does not work correctly in many projects unless you set lsp-eslint-working-directories. I have a project with multiple sub-projects, one of which is web, containing a t3(https://t3.gg/) app. yarn eslint . in that directory works as intended, yet lsp does not show any messages from eslint.

Naturally, people setting lsp-eslint-working-directories manually for every project is not a workable fix. It seems (pattern "./*") works.

I have also tried to ensure that my projectile project root is set to the web subproject, but that does not change anything.

Steps to reproduce

  1. Create a new directory
  2. Inside that directory, create a new t3 app
  3. Open any file with eslint errors.
  4. Nothing is shown by lsp eslint.

Expected behavior

Errors are shown.

Which Language Server did you use?

eslint

OS

Linux

Error callstack

No response

Anything else?

No response

yyoncho commented 1 year ago

To me, this sounds like a specific behavior of eslint language server. What is the expected fix from lsp-mode side?

JordanAnthonyKing commented 1 week ago

Is there a convenient way to debug this against my project structure? I too am using a mono repo with many projects, only some of which need eslint but as far as I can tell my lsp project dir should be the subrepo.