Skip to content

fix(nextjs): correct types conditional export ordering #12355

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

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

jpulec
Copy link
Contributor

@jpulec jpulec commented Jun 4, 2024

Description

As stated here in the typescript docs, types exports should always come first, so that they are resolved correctly. This also applies to the nested types within and exports condition.

This corrects an issue where eslint-import-resolver-typescript was not correctly resolving the full types for Sentry.

As stated in the typescript docs, `types` exports should always come first, so that they are resolved correctly. This also applies to the nested `types` within and `exports` condition.
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Damn TIL. We need to fix this for all of our packages then.

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

Thanks a lot, I'll open a follow up PR also updating this in other places 🙏

@mydea mydea changed the title fix: correct types conditional export ordering fix(nextjs): correct types conditional export ordering Jun 7, 2024
@mydea mydea merged commit 28da802 into getsentry:develop Jun 7, 2024
39 checks passed
mydea added a commit that referenced this pull request Jun 7, 2024
mydea added a commit that referenced this pull request Jun 7, 2024
@jpulec jpulec deleted the patch-1 branch June 7, 2024 17:26
billyvg pushed a commit that referenced this pull request Jun 10, 2024
## Description
As stated
[here](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-referencing)
in the typescript docs, `types` exports should always come first, so
that they are resolved correctly. This also applies to the nested
`types` within and `exports` condition.

This corrects an issue where `eslint-import-resolver-typescript` was not
correctly resolving the full types for Sentry.
billyvg pushed a commit that referenced this pull request Jun 10, 2024
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.

3 participants