Skip to content

chore: suppress existing type errors so lint:tsc can run in CI - #10251

Open
cryptodev-2s wants to merge 9 commits into
mainfrom
tsc-suppressions
Open

cryptodev-2s wants to merge 9 commits into
mainfrom
tsc-suppressions

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Explanation

lint:tsc typechecks every package, but the repo currently has 1,591 type errors, nearly all of them in test files. That makes it impossible to enforce typechecking in CI without fixing everything first.

This adds tsc-suppressions.json, which records how many errors of each code every file currently produces, in the same shape as eslint-suppressions.json.

  • yarn lint:tsc:check typechecks the repo and fails when a file produces an error the suppressions don't cover, or when a suppression no longer covers anything.
  • yarn lint:tsc:suppress regenerates the file.

Existing errors stay parked so they can be worked through package by package, while packages that are already clean can't regress. A cold run takes about 12 seconds, so the check is wired back into CI and into yarn lint.

Error messages are deliberately left out of the suppression key. Their wording changes between TypeScript releases, which would invalidate the whole file at once.

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

Note

Low Risk
Changes are CI/tooling and a checked-in suppressions baseline; runtime package behavior is unchanged, though contributors may need yarn lint:tsc:suppress when fixing types.

Overview
Adds a suppression-based TypeScript lint gate so the monorepo can run full tsc --build tsconfig.lint.json in CI without fixing ~1,591 existing errors first.

tsc-suppressions.json records allowed error counts per file and TS code (same idea as eslint-suppressions.json, without message text). yarn lint:tsc:check runs the build, parses output, and fails on new unsuppressed errors or stale suppressions; yarn lint:tsc:suppress regenerates the file. Supporting logic lives under scripts/lib/ with Jest coverage.

yarn lint and the lint CI matrix now include lint:tsc:check. tsconfig.packages.lint.json sets rootDir: "." so lint declaration emit does not spill into the repo root when tests import cross-package helpers.

Reviewed by Cursor Bugbot for commit 9aed625. Bugbot is set up for automated code reviews on this repo. Configure here.

Base automatically changed from populate-all-lint-tsconfigs to main September 15, 2026 15:17
@cryptodev-2s cryptodev-2s changed the title Suppress existing type errors so lint:tsc can run in CI chore: suppress existing type errors so lint:tsc can run in CI Sep 15, 2026
@cryptodev-2s cryptodev-2s self-assigned this Sep 15, 2026
@cryptodev-2s
cryptodev-2s requested a review from mcmire September 15, 2026 16:16
@cryptodev-2s

cryptodev-2s commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

@mcmire I am still reviewing this however does the idea sounds to you ?

@mcmire

mcmire commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

@cryptodev-2s Yeah if you can get this working this would be great!

@cryptodev-2s
cryptodev-2s marked this pull request as ready for review September 16, 2026 20:18
@cryptodev-2s
cryptodev-2s requested a review from a team as a code owner September 16, 2026 20:18
@cryptodev-2s
cryptodev-2s deployed to default-branch September 16, 2026 20:19 — with GitHub Actions Active

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b396a87. Configure here.

Comment thread scripts/lib/lint-tsc.ts
@cryptodev-2s
cryptodev-2s added this pull request to stack #10315 September 21, 2026 12:47
Adds tsc-suppressions.json, which records how many type errors of each code every file currently produces, in the same shape as eslint-suppressions.json.

yarn lint:tsc:check typechecks the repo and fails when a file produces an error the suppressions do not cover, or when a suppression no longer covers anything. yarn lint:tsc:suppress regenerates the file.

Also gives the package lint configs a rootDir so that declarations for files outside a package, such as tests/helpers.ts, are emitted into the lint cache rather than into the repo.
Main gained 104 type errors and fixed 10 of them since the suppressions were last generated, which is what the failing lint:tsc:check run on the previous commit reports.
Drops the uuid suppressions now that the mock typings are fixed on main, and picks up the remaining drift.
…eaks

Drops a redundant second pass over the errors, unused regex captures, and speculative handling for errors that tsc reports without a file.

That last case mattered for a different reason: tsc's exit code was being discarded, so a missing config or a crash produced no parseable errors and the check reported success. It now fails when tsc exits non-zero without reporting any type errors, which covers crashes too.
tsc --build carries on typechecking the remaining projects after one fails to load, so a broken project reference emitted TS6053 alongside 1540 ordinary type errors. The previous guard only fired when no errors were parsed at all, so the check reported success while a whole package went unchecked.

This branch was successfully deployed

1 active (outdated) deployment
default-branch 21d27269 Deployed Sep 16, 2026 by cryptodev-2s via Determine whether this PR is a release PR #4217
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.

2 participants