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

import/extensions: Requesting the rule treat subpath imports the same as non-package imports #2679

Open
ajvincent opened this issue Jan 16, 2023 · 4 comments

Comments

@ajvincent
Copy link

I use subpath imports (prefixed with #) in my Motherhen project as a shortcut to import Foo from "../../../../someDir/someOtherDir/Foo.js". The examples for import/extensions, unsurprisingly, don't cover this case. Apparently, the tests don't cover this either.

My preference is to treat subpath imports identically to non-package imports - and to test for the same.

Failing that, I would consider documenting subpath import examples sufficient.

@ljharb
Copy link
Member

ljharb commented Jan 16, 2023

This plugin uses resolve, which does not yet support exports nor imports (and thus, not subpath imports either).

When it does, we will.

@ajvincent
Copy link
Author

Can you point me to a relevant issue link on the resolve package's repository, please, so I may subscribe to it?

@ljharb
Copy link
Member

ljharb commented Jan 16, 2023

browserify/resolve#222 Is the closest.

@ljharb
Copy link
Member

ljharb commented Jan 16, 2023

To be clear, i consider the best practice anyways to be keeping a package backwards compatible with pre-exports node - that does, ofc, preclude subpath imports and self-referencing.

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

No branches or pull requests

2 participants