Skip to content

Keep the pointerEvents ts-expect-error in emitted spec declarations - #4601

Merged
m-bert merged 1 commit into
mainfrom
@mbert/specs-ts-directive-in-dts
Oct 16, 2026
Merged

m-bert merged 1 commit into
mainfrom
@mbert/specs-ts-directive-in-dts

Conversation

@m-bert

@m-bert m-bert commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Description

The three codegen specs redeclare pointerEvents as WithDefault<..., 'auto'>, which codegen requires. WithDefault adds null, so the interface no longer satisfies ViewProps.pointerEvents, and the source suppresses that with a // @ts-expect-error (or // @ts-ignore) line.

Declaration emit drops line comments, so the published lib/typescript/specs/*.d.ts carry a bare TS2430. Any consumer with skipLibCheck: false fails to type-check:

error TS2430: Interface 'NativeProps' incorrectly extends interface 'ViewProps'. Types of property 'pointerEvents' are incompatible.

This turns the directives into /** */ block comments. TypeScript honours directives in block comments, and JSDoc survives declaration emit, so the suppression now ships with the types. Codegen can't do this itself: extends Omit<ViewProps, 'pointerEvents'> fails with "Unable to handle prop spread: Omit" and dropping WithDefault fails with "A default enum value is required".

Test plan

  • yarn ts-check and yarn lint:js in the package
  • Codegen schema (combine-js-to-schema-cli, iOS and Android) identical before and after
  • yarn build, then installed the packed tarball into a fresh RN 0.87 app with skipLibCheck: false: the two RNGH TS2430 errors are gone, only RN's own typing errors remain
  • Same check against RN 0.88 declarations

Copilot AI balanced review requested due to automatic review settings October 16, 2026 11:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 11fd606a-9fb9-4093-b507-1d1dfb77423a
📥 Commits

Reviewing files that changed from the base of the PR and between fe86f59 and 8a53ccc.

📒 Files selected for processing: 3
  • packages/react-native-gesture-handler/src/specs/RNGestureHandlerButtonNativeComponent.ts
  • packages/react-native-gesture-handler/src/specs/RNGestureHandlerDetectorNativeComponent.ts
  • packages/react-native-gesture-handler/src/specs/RNGestureHandlerRootViewNativeComponent.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Chores
    • Updated internal type-checking annotations in gesture handling components. These maintenance changes do not alter runtime behavior, public declarations, or available interactions. There are no new features or user-visible changes in this update. Existing gesture handling behavior remains unchanged.

Three native component specs change existing TypeScript suppression comments to JSDoc-style comments. The suppression text and surrounding declarations remain unchanged.

Changes: Suppression comment formatting

Layer / File(s) Summary
Update suppression comment syntax
packages/react-native-gesture-handler/src/specs/RNGestureHandlerButtonNativeComponent.ts, packages/react-native-gesture-handler/src/specs/RNGestureHandlerDetectorNativeComponent.ts, packages/react-native-gesture-handler/src/specs/RNGestureHandlerRootViewNativeComponent.ts
The three specs use JSDoc-style comments for existing TypeScript suppressions. Suppression text and surrounding declarations remain unchanged.

Suggested reviewers: j-piasecki

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 8a53c

The changed directives remain effective in emitted declarations, avoiding the targeted consumer type errors. No actionable merge risk remains.

Pre-merge checks: Passed 3
Check name Status Explanation
Title check Passed The title clearly describes the main change: preserving the pointerEvents TypeScript suppression in emitted spec declarations.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

One or more issues must be addressed before approval.

1 open finding

🧠 Review effort: Lite

@m-bert
m-bert merged commit 404c091 into main Oct 16, 2026
13 checks passed
@m-bert
m-bert deleted the @mbert/specs-ts-directive-in-dts branch October 16, 2026 12:55
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