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

Corrects bug in type discovery. #11

Merged
merged 1 commit into from
Jan 15, 2023
Merged

Conversation

MicahZoltu
Copy link
Contributor

For reasons I don't understand, TypeScript is finding index.ts instead of index.d.ts when it goes looking for types for index.js. This is despite the docs saying that it will find index.d.ts. https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package

None the less, this can be resolved by just being explicit, as done in this PR.

I asked about this in an ongoing thread on the issue, hopefully I'll get some clarity on why the defaults aren't working here:
microsoft/TypeScript#40426 (comment)

For reasons I don't understand, TypeScript is finding `index.ts` instead of `index.d.ts` when it goes looking for types for `index.js`.
This is despite the docs saying that it will find `index.d.ts`.
https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package

None the less, this can be resolved by just being explicit, as done in this PR.
@paulmillr paulmillr merged commit 303d07b into paulmillr:main Jan 15, 2023
@MicahZoltu MicahZoltu deleted the patch-1 branch February 2, 2023 09:10
@MicahZoltu
Copy link
Contributor Author

Any chance we could get a release cut with this included?

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

Successfully merging this pull request may close these issues.

2 participants