ghmcadams / vscode-lintlens

Augment your ESLint rules in Visual Studio Code - Adds metadata beside each ESLint rule.
MIT License
42 stars 9 forks source link

Doesn't support config files outside of the root open folder #51

Closed zachhardesty7 closed 1 year ago

zachhardesty7 commented 2 years ago

MissingESLintError: Unable to find ESLint within the open folders' node_modules, make sure you've run npm install or yarn

I work on a repo that's structured in a slightly non-standard way, but similar to a monorepo. My repo keeps unrelated shared config in the root, so I need to open the root folder as my workspace. The React and NPM code only exist in a "react" folder. In my opinion, the best way to solve would be adding the ability to configure a non-default path to either the folder root or ESLint itself.

ghmcadams commented 1 year ago

@zachhardesty7 Sorry I haven't replied for so long. This is not something I plan to support. For a vast majority of users, config files and packages that live within the currently open workspaces is enough. I'm not sure how I would support other cases and still maintain good performance.

zachhardesty7 commented 1 year ago

The config files and packages are within the currently open workspace, they're just nested 1 folder down from the root. I wouldn't think that adding a setting for targeting the JavaScript part of the project would have any performance impact, but I could be misunderstanding. Here's what my repo looks like for reference, if it helps at all. I believe it's pretty common that people are working with repos like this that have multiple "services" within them, so it wouldn't just benefit me. 🙂

workspace root folder I open in VSCode --| .vscode settings --| Proxy service source code folder --| Java source code folder --| Test source code folder --| gradle & jenkins config files --| Typescript React source code folder ----| node_modules ----| src ------| components ------| interfaces ------| styles ----| package.json ----| .eslintrc.json

ghmcadams commented 1 year ago

@zachhardesty7 The latest version should work for your use case. Please give it a try and let me know.

zachhardesty7 commented 1 year ago

It does in fact work now, thank you!