Skip to content

Add typechecking in CI for react-data-query - #10010

Draft
mcmire wants to merge 2 commits into
enable-typechecking-for-base-data-servicefrom
enable-typechecking-for-react-data-query
Draft

Add typechecking in CI for react-data-query#10010
mcmire wants to merge 2 commits into
enable-typechecking-for-base-data-servicefrom
enable-typechecking-for-react-data-query

Conversation

@mcmire

@mcmire mcmire commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Explanation

To ensure all files in react-data-query — not just production files — are typechecked in CI now and in the future:

  • Add tsconfig.lint.json for react-data-query and hook it into root tsconfig.lint.json
  • Fix type errors in tests
    • Refactor createUIQueryClient test setup by porting createRootMessenger and createServiceMessenger helpers from base-data-service tests
    • Change createUIQueryClient test setup to create a messenger adapter instead of passing a messenger, since that isn't supported
  • Remove tstyche test and dependency (it was only added as a stopgap until we had true typechecking in CI)

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

it('calls the underlying TanStack query function', () => {
const options = { queryKey: ['foo'] };
const options = {
// Type assertion: `useQuery` wants `[string, ...Json[]]`,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not great, but I think this is just how useQuery works: if you store options in a variable and pass the variable into useQuery you have to add some kind of type assertion to satisfy the strange types that useQuery has.

@mcmire

mcmire commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

Adding no-changelog since there are no changes to source files.

To ensure all files in `react-data-query` — not just production files —
are typechecked in CI now and in the future:

- Add `tsconfig.lint.json` for `react-data-query` and hook it into root `tsconfig.lint.json`
- Fix type errors in tests
  - Refactor `createUIQueryClient` test setup by porting
    `createRootMessenger` and `createServiceMessenger` helpers from
    `base-data-service` tests
  - Change `createUIQueryClient` test setup to create a messenger
    adapter instead of passing a messenger, since that isn't supported
- Remove `tstyche` test and dependency (it was only added as a stopgap
  until we had true typechecking in CI)
@mcmire
mcmire force-pushed the enable-typechecking-for-react-data-query branch from 1c8634e to 9ff4d1a Compare August 28, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant