Skip to content

Eslint workingDirectory.mode = auto breaks path resolution in a monorepo #4227

@MaxShymko

Description

@MaxShymko

Description

  • nvim: v0.11.5
  • nvim-lspconfig: master

workingDirectory.mode was updated from location to auto in #3955. After this change, I started seeing an issue with ESLint config path resolution in monorepo packages. Setting workingDirectory.mode = location fixes the issue.

I created an example: https://github.com/MaxShymko/eslint-issue
LSP works fine in file1.ts
but breaks in file2.ts with error

eslint: Parsing error: Cannot read file '/Users/maxshymko/src/eslint-issue/src/packages/package1/tsconfig.json'.

My workaround for now is:

vim.lsp.config('eslint', {
  settings = {
    workingDirectory = { mode = 'location' },
  },
})

Should we roll back mode to location, or will it break something else?
@fuegoio, would love to hear your thoughts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions