tsdjs / tsd

Check TypeScript type definitions
MIT License
2.36k stars 68 forks source link

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

Open micnic opened 1 year ago

micnic commented 1 year ago

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 commented 1 year ago

Do you have an example repo for this?

micnic commented 1 year ago

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

micnic commented 1 year ago

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.