sublimelsp / LSP-eslint

ESLint support for Sublime LSP plugin
MIT License
36 stars 5 forks source link

Support `pattern` option in `workingDirectories` #71

Open silverwind opened 4 months ago

silverwind commented 4 months ago

Requesting to add support for this option supported by vscode-eslint, but not by this LSP-eslint. To showcase the need, assume a workspace with multiple sub-projects which each have their own configs and at least one having a eslint config that fails to parse:

module1/.eslintrc.js // this config is broken
module2/.eslintrc.js // this config works

In VSCode with "eslint.workingDirectories": [{"pattern": "*"}] vscode-eslint continues to work in module2, but in LSP-eslint, it refuses to work in module2 because the unrelated config in module1 failed to parse.

Also, I think there would be a nice performance benefit if LSP-eslint would not try to parse unrelated config files.

predragnikolic commented 3 months ago

The vscode-eslint has some glue code for "eslint.workingDirectories": [{"pattern": "*"}] which LSP-eslint currently doesn't have

https://github.com/microsoft/vscode-eslint/blob/5314666f2bde824be899db454066999fb9d697de/client/src/client.ts#L765-L778