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

Incompatibility with ESLint rule import/no-unresolved #109

Closed
bershanskiy opened this issue Sep 1, 2023 · 5 comments
Closed

Incompatibility with ESLint rule import/no-unresolved #109

bershanskiy opened this issue Sep 1, 2023 · 5 comments

Comments

@bershanskiy
Copy link

ESLint rule import/no-unresolved fails to resolve get-stream version 8 because this rule does supports only package.json key main but not exports and get-stream provides only exports and does not provide main.

As a fix, I propose adding the following line to get-stream's package.json:

"main": "source/index.js",

I'll look into extending this ESLint rule with exports support, but that is likely to take a while.

@bershanskiy
Copy link
Author

Most packages do not need to have main specified explicitly, since most of them use the default entry point index.js. get-stream uses the non-default location, so it probably should explicitly specify it for compatibility.

@ehmicky
Copy link
Collaborator

ehmicky commented Sep 1, 2023

Hi @bershanskiy,

Thanks for the additional insights. @sindresorhus What do you think considering the additional information about import/no-unresolved?

@sindresorhus
Copy link
Owner

ESLint rule import/no-unresolved fails to resolve get-stream version 8 because this rule does supports only package.json key main but not exports and get-stream provides only exports and does not provide main.

That is a problem with import/no-unresolved and you need to bring it up there.

@sindresorhus
Copy link
Owner

exports is a modern replacement to main. We are not going to bring back main.

https://nodejs.org/api/packages.html#package-entry-points

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2023
@ehmicky
Copy link
Collaborator

ehmicky commented Sep 1, 2023

For reference, the issue you might want to track seems to be this one: import-js/eslint-plugin-import#2495

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 a pull request may close this issue.

3 participants