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

fix: export types from build instead of src #21

Merged

Conversation

waaker
Copy link

@waaker waaker commented Oct 7, 2024

@sberthier

Proposed change

Changed the way types are exported: index.d.ts now points to build directory instead of src in order to resolve to other .d.ts files in sub-directories instead of resolving to source .ts files.

Reason for change

I encountered a situation where a TS error in the source code of f-promise-async caused an error to be thrown at compile time when f-promise-async was included as a dependency.

According to microsoft/TypeScript#41883 (comment), inbound references should resolve to .d.ts files and not source .ts files.

The tsconfig skipLibCheck option can only affect the checking of .d.ts files. There are no options to avoid checking .ts files. Therefore, it is recommended to export types via .d.ts files, so that projects depending on this package can use skipLibCheck to choose if they want to perform the check, rather than being forced to do it.

Anael Moissiard added 3 commits October 7, 2024 14:34
According to TS dev team, inbound references should resolve to .d.ts files and not .ts files.
cf: microsoft/TypeScript#41883 (comment)
@sberthier sberthier merged commit 031eab8 into BEE-BUZZINESS:master Oct 7, 2024
1 check passed
@waaker waaker deleted the fix/types/export-d.ts-from-build branch October 7, 2024 15:15
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