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

Non-type exports defined by package.json exports are typed as any #174

Open
micnic opened this issue Mar 6, 2023 · 3 comments
Open

Non-type exports defined by package.json exports are typed as any #174

micnic opened this issue Mar 6, 2023 · 3 comments

Comments

@micnic
Copy link

micnic commented Mar 6, 2023

If a package has it's structure defined using package.json exports all non-type exports are considered any by tsd but are typed properly in TypeScript.

@BendingBender
Copy link
Collaborator

Do you have an example repo for this?

@micnic
Copy link
Author

micnic commented Mar 6, 2023

I will prepare a gist with an example repo and add the link here.

@micnic
Copy link
Author

micnic commented Mar 6, 2023

I ended up creating this repo: https://github.com/micnic/tsd-exports-test
You just need to run npm i to install the dependencies, then run npm run check, the tsc ends ok, the tsd will fail to run.

My initial test with failing just for non-type was running inside a node_modules folder, and got 2 problems, if you run it outside of node_modules it will fail to find the package.

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

No branches or pull requests

2 participants