-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug?]: ESLint extension doesn't work with yarn pnp - Error: Missing "./lib/api.js" export in "eslint" package #3578
Comments
Hi @mr-bjerre I just experienced the same issue. This is specifically an error with ESLint v8 and is caused by https://eslint.org/docs/8.0.0/user-guide/migrating-to-8.0.0#the-lib-entrypoint-has-been-removed. Before it's fixed here, you can workaround it by updating your ESLint SDK file ( // Defer to the real eslint your application uses
module.exports = absRequire(`eslint/lib/api.js`); To: // Defer to the real eslint your application uses
module.exports = absRequire(`eslint`); |
Cool @joelmukuthu . I agree that the workaround doesn't throw the error anymore but the extension doesn't seem to highlight any issues either. So it isn't really working... EDIT This is related to microsoft/vscode-eslint#1225 |
Hm but why is vscode-eslint reading in |
@arcanis it seems that OP ran into a different issue that's related to vscode-eslint :) The original issue is caused by code in the ESLint SDKs for VS Code that are generated by Yarn. I'm not sure but it looks like this is what causes it:
Perhaps changing that to an empty string would fix it? 😃 And not to complicate this, but it might also be worthwhile to update how the SDKs are generated; in essence, to remove direct imports of "internal" module files |
Hello! I see this has the label Thanks in advance for your answers! |
This was fixed in #3709 but we forgot to reference this issue yarn dlx @yarnpkg/sdks |
@merceyz thanks for the info! Don't hesitate to ping me if you see something I can help on! |
Self-service
Describe the bug
I'm using the ESLint extension in VSCode. Unfortunately it doesn't work with Plug'n'Play - according to the docs it should work if I understand correctly?
I've been looking at issues both here and in the ESLint extension repro but I haven't found anyone with this exact error it seems. I'm not sure if the issue belongs here or in the ESLint extension repro, let me know.
To reproduce
Make sure you have arcanis.vscode-zipfs and dbaeumer.vscode-eslint extensions installed in VS Code.
Run the following commands and just select defaults in the config initialization wizard
Now verify that eslint will highlight an error in
.eslintrc.js
when running the following command (as expected)yarn eslint .
Open
eslintrc.js
in VS Code and verify that the ESLint extension doesn't work. You can select theOutput
tab and selectESLint
in the dropdown and see the following errorEnvironment
System: OS: Linux 5.11 Ubuntu 20.04.3 LTS (Focal Fossa) CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor Binaries: Node: 15.14.0 - /tmp/xfs-affdb263/node Yarn: 3.0.2 - /tmp/xfs-affdb263/yarn npm: 7.24.1 - ~/.nvm/versions/node/v15.14.0/bin/npm
Additional context
No response
The text was updated successfully, but these errors were encountered: