-
Notifications
You must be signed in to change notification settings - Fork 339
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
eslint.nodePath only works with absolute paths in multi module vscode workspaces #1225
Comments
Have you confirmed the I will close the issue as a dup. If it doesn't help please ping and I will reopen. |
Sorry but that linked issue doesn't help (unless im missing something). I already had the relative path in my .code-workspace file which seems to be the suggested fix (see the commented out line in my code sample above). In my case i had to move away from that to an absolute one to get it to work. |
The linked issue was about the need of confirming the setting. And the example in that issues uses a relative value |
I'm also having this problem with a relative nodePath. I created a demo project https://github.com/gmeligio/vscode-eslint-yarn-berry-typescript-workspace where the relative path
My environment is:
You can reproduce the exception by cloning the |
I'm experiencing this issue too, please reopen. Only an absolute path for I can set |
Ok I just confirmed, it seems the relative path is not being resolved correctly. If you use a relative path for So I can set
|
Actually this is how VS Code treats these files. This is why a setting in the code-workspace file is resolved relative to the workspace folder it is applied to. |
Ok it's by design, nevermind. |
That model works for npm projects where each workspace is essentially
standalone. It doesn’t work for a yarn 2 monorepo though where all
dependencies and several config file are stored at the root of the project.
Appreciate that it’s not the eslint plug-ins job to solve this one. But if
you have suggestions on how you would go about influencing vscode to
support project root relative paths that would make this work for eslint it
would be much appreciated.
…On Fri, 16 Jul 2021 at 5:45 pm, Dirk Bäumer ***@***.***> wrote:
Actually this is how VS Code treats these files. This is why a setting in
the code-workspace file is resolved relative to the workspace folder it is
applied to.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1225 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG5EP5ZD5XOIG7PT6A6ZUDTX7PRVANCNFSM4Z53RLWQ>
.
|
@jousby in a yarn 2 monorepo you usually don't have a code-workspace file? Or do you. Can you explain why this is necessary. Change how these settings are resolved will be a big breaking change and very likely not happening. All I can think of having a different setting in a different scope. |
@dbaeumer The workspace feature in vscode is primarily (for me at least) about making the explorer sidebar easier to navigate (you get a seperate toplevel folder with its own src/, test/ etc for each subproject/package). This is still relevant for monorepo's that are backed by yarn 2. How would you get vscode workspace goodness for yarn 2 monorepos without a code-workspace file? |
I am not sure I understand this. Why can't you simply open the root of the mono repository? This is what I usually do. |
Opening the project at the root and not using the multi root workspace feature will work but... this is a step backwards in user experience. VSCode has a feature that makes working with monorepo/mult module/multi package projects much nicer. It would be nice not to give this up. |
eslint.nodePath only works with absolute paths in multi module vscode workspaces microsoft/vscode-eslint#1225
Support for environment variables in |
In case anyone comes here because of problems with having their own eslint-config packages bring along their own plugin dependencies in a monorepo setup, then forget about fiddling with |
I'm looking to manage a multi module / monorepo typescript project with Yarn 2 workspaces + VSCode Workspaces.
I have one eslintrc.yml file in the root folder of my project that configures eslint for all sub projects/packages. I have this working with one catch in that I have to make the the 'eslint.nodePath' property in my . code-workspace file an absolute path for the vscode-eslint extension to work. i.e
/.code-workspace
This means i can't check the *.code-workspace file in to my project to help others get started quickly with vscode.
When i use the original relative path and I navigate to a .ts file in one of the sub packages it complains that the eslint file can't be loaded. It feels like the eslint extension might be trying to find a '.yarn/sdk' folder relative to base of the current sub package instead of continuing to look at the base of the project perhaps?
The text was updated successfully, but these errors were encountered: