Skip to content

Update lint:tsc to run against all packages & remove it from CI - #10215

Open
mcmire wants to merge 5 commits into
mainfrom
populate-all-lint-tsconfigs
Open

Update lint:tsc to run against all packages & remove it from CI#10215
mcmire wants to merge 5 commits into
mainfrom
populate-all-lint-tsconfigs

Conversation

@mcmire

@mcmire mcmire commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Explanation

Currently, many test files across the monorepo exhibit type errors. These errors are not checked by yarn build (as test files are not production code), and so they have been allowed to accumulate.

To help work through these errors, a package script, lint:tsc, was introduced and added as a step to the lint job in CI. This script calls tsc to typecheck files as yarn build does, but writes the output files to a hidden directory. To prevent from having to address all type errors at once, this typechecking step was initially applied not to the entire monorepo, but only to a small list of packages.

Unfortunately, because of the complex nature of the monorepo, this strategy has accidentally created an an obstacle for other engineers. If a package introduces a dependency that is not within the lint:tsc allowlist, there is a chance that it will accidentally get included anyway, thus forcing engineers to employ less-than-ideal practices to work around type errors.

It's still worth it to take an incremental approach to resolve type errors, but we can do so in a less invasive way. This commit accomplishes this by changing lint:tsc to cover all packages, and at the same time, it removes the package script from CI. This increases the potential for type errors to be introduced; however, it gives everyone freedom to fix these errors as they have time, and it allows engineers — particularly agents — to use yarn lint:tsc as a way to programmatically verify fixes.

References

Related to https://consensyssoftware.atlassian.net/browse/WPC-1275.

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

Medium Risk
CI no longer enforces monorepo TypeScript checks, so type regressions can land unless teams run lint:tsc locally; the change is tooling-only but affects how quality gates work.

Overview
yarn lint:tsc now typechecks the whole monorepo, and it is no longer run in CI or in the root yarn lint chain so PRs are not blocked by existing test-file type debt.

This is done by adding tsconfig.lint.json for many packages (with project references to workspace deps and .tsc-lint-cache output), wiring them into the root tsconfig.lint.json, and updating lint-tsconfigs scripts so lint configs must reference expected dependencies instead of using an incremental allowlist that skipped packages without a lint tsconfig.

Developers and agents can still run yarn lint:tsc locally to verify fixes incrementally without the old cross-package dependency footgun.

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

Currently, many test files across the monorepo exhibit type errors.
These errors are not checked by `yarn build` (as test files are not
production code), and so they have been allowed to accumulate.

To help work through these errors, a package script, `lint:tsc`, was
introduced and added to CI. This script calls `tsc` to typecheck files
as `yarn build` does, but writes the output files to a hidden directory.
To prevent from having to address all type errors at once, this
typechecking step was initially applied not to the entire monorepo, but
only to a small list of packages.

Unfortunately, because of the complex nature of the monorepo, this
strategy has accidentally created an an obstacle for other engineers. If
a package introduces a dependency that is _not_ within the `lint:tsc`
allowlist, there is a chance that it will accidentally get included
anyway, thus forcing engineers to employ less-than-ideal practices to
work around type errors.

It's still worth it to take an incremental approach to resolve type
errors, but we can do so in a less invasive way. This commit
accomplishes this by changing `lint:tsc` to cover _all_ packages, and at
the same time, it removes the package script from CI. This increases the
potential for type errors to be introduced; however, it gives everyone
freedom to fix these errors as they have time, and it allows engineers
(especially agents) to use `yarn lint:tsc` as a way to programmatically
verify fixes.
packageNames: expectedPackageNames,
workspaces,
});
const lintWorkspaces = await filterWorkspacesWithTsconfig({

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Previously, this code allowed a subset of packages to contain a tsconfig.lint.json. If this file was present for a package then the references field in the config file would be checked against the dependencies of the package (omitting any dependencies that did not have a tsconfig.lint.json). This logic allowed lint:tsc to be progressively rolled out across the monorepo; but it was not a good idea in hindsight, as it would inevitably force engineers to add tsconfig.lint.json for new dependencies (but then this would force them to fix existing type errors).

These changes remove that logic and simplify this file so that every package must now have a tsconfig.lint.json, and references must perfectly reflect dependencies (just like tsconfig.json and tsconfig.build.json).

@mcmire

mcmire commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

Adding no-changelog as there are no changes to production code.

@mcmire
mcmire marked this pull request as ready for review September 11, 2026 19:44
@mcmire
mcmire requested review from a team as code owners September 11, 2026 19:44
@mcmire
mcmire deployed to default-branch September 11, 2026 19:44 — 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 223f14f. Configure here.

Comment thread tsconfig.lint.json
}): Promise<TsconfigLintMetaReport> {
const lintTsconfig = await readTsconfig(repoRoot, 'tsconfig.lint.json');
// This allows us to increase linting for the whole repo incrementally.
const lintWorkspaces = await filterWorkspacesWithTsconfig({

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We don't need this either, for the same reason as I noted in lint-package-tsconfigs.mts.

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.

1 participant