Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(types): Reference global.d.ts using path not types #51104

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

krystofwoldrich
Copy link
Contributor

@krystofwoldrich krystofwoldrich commented May 5, 2025

Summary:

After #49516 TSC would not find the global types.

Types reference expect a package name but was given a path to a declaration.

TS doc: https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-path-

This PR changes types to path to fix the issue.

dtslint fails with no-bad-reference rule, but the ../src lives in the same package in react-native package.

Changelog:

[GENERAL] [FIXED] - Reference global.d.ts using path so they can be resolved by TSC

Test Plan:

Before the change with current RN 0.79.2 TSC would fail on resolving the global types (example from Sentry RN SDK build):

Screenshot 2025-05-05 at 17 18 04

After the change to path TSC finds the global types.

Using TSC Version 4.9.5

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Sentry Partner: Sentry Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels May 5, 2025
@facebook-github-bot
Copy link
Contributor

@philIip has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@krystofwoldrich
Copy link
Contributor Author

@philIip Let me know if you can reproduce the issue, or if there is something I can do. I thought I can ignore the lint by the ignore comment, but sadly that doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Sentry Partner: Sentry Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants