TS Conversion > src/query-helpers.js
#1009
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What: Convert
src/query-helpers.js
to TS. Includes test snapshot updates, some type declaration file changes.Why: Motivations are outlined in #494
How: Filename changes first. Then error fixes. Then fixes to make tests pass. I also occasionally changed files imported from or exported into from
query-helpers
to include pending changes made from other PRs that made TS changes, just for sanity checks and guiding inspiration whilst working on my changes. Of course, those changes were not included in this PR, nor were they kept around when finally running tests for my changes.Checklist:
docs site NA
No, as I need feedback for the following concerns:
There are some sections of code that raise type errors or lint errors, whose solution I cannot tell with what little I know of this library and its usage. Those sections require input from other community members/maintainers, and I've marked them with
// FIXME:
comments. I'll open threads (if possible, have not used GitHub in this manner before) for review at each point.There are some potentially questionable type definitions I've made where I've tried to square the existing types in
types/query-helpers.d.ts
with the errors raised by inlining those types intosrc/query-helpers.ts
. Tests pass without too much finagling with// @ts-expect-error
or// eslint-disable
, yet, for the same reason as the previous point, I cannot fully tell if these are acceptable changes/compromises.Similar question to my other TS PRs (chore: Convert screen.js to TypeScript #1002 TS Conversion >
src/events.js
+ editsrc/events.d.ts
#1008): I've changed public facing type declarations, are these changes acceptable?