tsdjs / tsd

Check TypeScript type definitions
MIT License
2.4k stars 67 forks source link

Doesn't appear to look for index.d.ts if main field of package.json is listed as a different name #217

Open jamesbrobb opened 3 months ago

jamesbrobb commented 3 months ago

In the README point 2 under "Order of Operations" states:

  1. Finds a .d.ts file, checking to see if one was specified manually or in the types field of the package.json. If neither is found, attempts to find one in the project directory named the same as the main field of the package.json or index.d.ts. Fails if no .d.ts file is found.

I'm not finding this to be the case. My main field is public-api.js but i have an index.d.ts file in the project directory i'm targeting, but am still getting the following error:

The type definition public-api.d.ts does not exist at...

Obviously if i rename index.d.ts to public-api.d.ts it works, so it this a mistake in the README explanation?