Skip to content

Comments

fix: Add type declarations to exports fields#1758

Merged
lahirumaramba merged 2 commits intomasterfrom
lm-fix-exports
Jun 9, 2022
Merged

fix: Add type declarations to exports fields#1758
lahirumaramba merged 2 commits intomasterfrom
lm-fix-exports

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
"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