Match @types/node to TS version for each run of npm test:types #655
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.
Summary & motivation
When running tests, we test against a variety of TS versions, including
next
. Recently, our check againstnext
began to fail due to some transitive copies of@types/node
and their incompatibility with newer versions of TS. I tried making@types/node
an explicit dependency, which fixednext
but broke older versions of the TS check starting with 4.7.The Definitively Typed project only supports TS versions 2 years in the past, so we were bound to get wedged like this at some point. This PR attempts to address this issue by installing a tagged version of
@types/node
for each run of the types check, pinning@types/node
to the TS version we are testing. (e.g., for TS 4.7.4, we install@types/node@ts4.7
.I've also removed TS 3 checks in this PR as TS 3.9 is now over 4 years old and it doesn't seem like we need to support that far in the past. Let me know if you disagree, happy to bring it back!
Testing & documentation
Not user facing, only internal types tests are impact.