chore: type check tests via lint:tsc - #334
Open
cryptodev-2s wants to merge 1 commit into
Open
Conversation
cryptodev-2s
added this pull request to stack #331
September 9, 2026 20:40
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
The following preview build has been published: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Top of stack #331, on #333. Opts this package into the progressive test type checking rollout core is doing (16 of its 100 packages so far).
Tests were not type checked at all
Verified by injecting
const deliberateTypeError: number = "a string"into a test file:yarn buildtsconfig.build.jsonexcludes testsyarn test:sourceyarn test:types*.test-d.tsyarn linttest:sourcecan never catch it:isolatedModulesputs ts-jest on itstranspileModulepath, which erases types without checking them.The change
tsconfig.lint.jsonextendstsconfig.json(which already covers everything the build does not) and addsskipLibCheck, because dependency declarations do not satisfy the strict flags used here.Why
*.test-d.tsis excludedThose belong to
tsd, which checks them itself viayarn test:types(fixed in #322). Including them here pullstsd's own types into the program, and those reachtype-fest, whosebasic.d.tscarries/// <reference lib="esnext" />. That silently widens built in types past this package'slib, producing a spurious failure whereFrozenSetno longer satisfiesReadonlySetbecause of Set methods we do not target. Traced withtsc --explainFiles.Why this stacks on ES2022
With
lib: ES2020atscpass over the tests reports 11 errors, nearly allProperty 'cause' does not exist. Withlib: ES2022, zero. #333 has to land first.Confirmed not vacuous
A deliberate type error in a test file now exits non-zero with
TS2322, andtsdstill independently catches a badexpectAssignablein a.test-d.tsfile.Note
Low Risk
Lint-only tooling; no runtime or published API behavior changes.
Overview
Adds
yarn lint:tsc(tsc --noEmitagainst a newtsconfig.lint.json) and runs it first inyarn lint, so Jest/ts-jest test files and other non-build TypeScript actually get type-checked during CI and local lint (build and transpile-only tests did not cover them).tsconfig.lint.jsonextends the root config withskipLibCheckand excludesdistand*.test-d.tsso dependency.d.tsnoise andtsd-owned declaration tests stay out of this pass whileyarn test:typesstill handles the latter.Reviewed by Cursor Bugbot for commit 2caaa71. Bugbot is set up for automated code reviews on this repo. Configure here.