-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Shared "types" condition for "import" and "require" should not warn if has no default export #63
Comments
IIRC the file needs to use file extensions for imports (vitejs/vite#13947) to share the file for them. |
True. Yeah the heuristic to skip this warning then is if it has
I'm thinking we can allow sharing if it's only bare imports as it may still work for some deps. Further analysis for the dep could be done in #18 |
I think I confused myself. You could I think I'd want to skip checking whether an import has the extension or not first, since it's harder to track and convey the error message. It would be a new error message e.g. "the dts file contains imports that does not work in node16/bundler". So regarding sharing the dts itself,
Resources: |
Ah, you're right. Sorry for the confusion. |
I'm confusing myself big time 😄 So apparently default export, regardless if one exists or not is also ambiguous, because it's ambiguous at the consumer-side. The attw FalseCJS link already explains that. I'll close this for now. |
https://publint.dev/resolve.exports@2.0.2
There should not be a warning for the
"types"
condition as it's perfectly safe to be shared for both"import"
and"require"
. The"import"
would use the CJS-scoped context when interpreting default exports, which can be wrong for ESM, but if the package doesn't default export things, it's fine.The text was updated successfully, but these errors were encountered: