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: Add type declarations to exports fields #1758

Merged
merged 2 commits into from Jun 9, 2022
Merged

Conversation

lahirumaramba
Copy link
Member

Fixes #1726

Copy link

@dwyfrequency dwyfrequency left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

package.json Outdated
@@ -113,63 +113,78 @@
".": "./lib/index.js",
"./app": {
"require": "./lib/app/index.js",
"import": "./lib/esm/app/index.js"
"import": "./lib/esm/app/index.js",
"types": "./lib/app/index.d.ts"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs say that the types field should always come first in exports: https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing

"Note that the "types" condition should always come first in "exports"." (under the second code sample in that section)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thank you!

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.

Invalid type declaration after upgrading to TS 4.7
3 participants