Skip to content
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

fix: The eslint.nodePath path generated by @yarnpkg/sdks cannot be resolved by eslint using require.resolve #6009

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chenhebing
Copy link

What's the problem this PR addresses?

#6007
...

How did you fix it?

Removed a call to path.dirname and set nodePath to ".yarn/sdks/eslint"
...

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Copy link
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the VSCode-Eslint documentation, nodePath needs to point to a node_modules folder:

eslint.nodePath - use this setting if an installed ESLint package can't be detected, for example /myGlobalNodePackages/node_modules.

@chenhebing
Copy link
Author

According to the VSCode-Eslint documentation, nodePath needs to point to a node_modules folder:

eslint.nodePath - use this setting if an installed ESLint package can't be detected, for example /myGlobalNodePackages/node_modules.

Jan 23, 2024
View reviewed changes

Yes, there is no problem parsing node_modules under normal circumstances. But in submodule, there is a problem that it cannot be parsed. It can be seen from the VSCode-Eslint plug-in source code that the eslint plug-in is parsed through require.resolve of nodejs. In submodule, if it cannot be resolved in node_modules, it will be searched upward. It seems to be a depth-first search.

https://github.com/microsoft/vscode-languageserver-node/blob/4812428a8621dff4153282407fc71494b994eda3/server/src/node/files.ts#L41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants