Skip to content

fix: simplify 'as unknown as X' casts to 'as X' where compiler allows - #6

Open
KuraPiee wants to merge 1 commit into
pmndrs:mainfrom
KuraPiee:fix/react-three-examples-5-simplify-type-casts
Open

KuraPiee wants to merge 1 commit into
pmndrs:mainfrom
KuraPiee:fix/react-three-examples-5-simplify-type-casts

Conversation

@KuraPiee

Copy link
Copy Markdown

Closes #5

Summary

Performs a mechanical cleanup across the codebase, simplifying \�s unknown as X\ assertions down to plain \�s X\ assertions where TypeScript single-step assertion rules allow.

  • Tested every double-hop cast across the repository against \ sc --noEmit.
  • Replaced 30 instances across 13 files where target types sufficiently overlap the source types, removing unnecessary intermediate \unknown\ hops.
  • Preserved existing comments and left double casts intact only where TypeScript strictly requires them.
  • All checks (\pnpm typecheck, \pnpm lint, \pnpm build) pass cleanly.

This branch has not been deployed

No deployments
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.

Mechanical sweep: prefer plain 'as X' over 'as unknown as X' where the compiler allows it

1 participant