refactor(shared): tighten ts-strict typing helpers#5707
refactor(shared): tighten ts-strict typing helpers#5707rebelchris wants to merge 6 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude fix lint and test |
|
Claude finished @rebelchris's task in 2s —— View job Fixing lint and tests
What was fixedLint (3 prettier errors in Tests (2 failures in Fix: Extract boolean options to a stable primitive variable before the memo: const booleanOptions = typeof options === 'boolean' ? options : undefined;
// deps: [booleanOptions, once, passive, signal] — all primitives, stable across rendersThis restores the original correctness (stable deps = no spurious re-subscriptions) while keeping the PR's intent of handling the boolean case inside the memo. |
…s re-subscriptions Extract boolean options to a primitive before useMemo to prevent object reference changes from triggering unnecessary re-runs of the effect. Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
|
@claude still throws some bujild errors: |
|
Claude finished @rebelchris's task in 1m 41s —— View job Fixed SwipeEventData type error
What was fixedThe PR changed Fix: Cast // Before
onRequestClose(e);
// After
onRequestClose(e.event as React.MouseEvent);
|
Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
|
@claude the build is still failing what now? |
|
Claude finished @rebelchris's task in 5m 3s —— View job Fixed build failure
Root cause
In // Before fix — E defaults to unknown → T inferred as unknown → Promise<unknown>
const promise = promisifyEventListener(
'native-auth',
(event) => event.detail,
);
return promise; // ❌ Promise<unknown> not assignable to Promise<NativeAuthResponse | undefined>Fix: explicit type params at the call site in const promise = promisifyEventListener<
NativeAuthResponse | undefined,
NativeAuthResponse | undefined
>('native-auth', (event) => event.detail);Commit: |
…tiveAuth E = unknown default no longer infers T as any; must be explicit. Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
Summary
Testing
Preview domain
https://codex-ts-strict-shared-small-pas.preview.app.daily.dev