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.
Checklist
I had converted
koa
to TS last year as a bit of a learning exercise and the thought of having my own custom TS framework, but I ended up not using it.When I saw koa was open to a TS rewrite for v3, I decided to dust this off.
Its an attempt to keep the v2 koa code as close to untouched as possible while:
In addition, I also wrote it with
xo
as the linter, I was going to attempt to convert to ts-standard, but it was going to be a pain in the butt, so I just made xo lint ts files and kept standard the linter for js files.The tests remain in js and they test the TS build output.
One thing of note is that these types are not compatible with the current definitely typed ts types.
EDIT: also note all the tests are passing in each node version, but there is a problem with experimental code cov or something, and node 20 has some known issues with sourcemaps causing issues.