Skip to content

Remove unused hasWarnings and warnings - #96956

Merged
lukesandberg merged 1 commit into
vercel:canaryfrom
martinfrancois:remove-unused-has-warnings
Sep 21, 2026
Merged

lukesandberg merged 1 commit into
vercel:canaryfrom
martinfrancois:remove-unused-has-warnings

Conversation

@martinfrancois

@martinfrancois martinfrancois commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fixing a bug

Nothing reads the two fields hasWarnings and warnings on TypeCheckResult.

verifyAndRunTypeScript has four callers:

  • build/type-check.ts only reads inputFilesCount, totalFilesCount and incremental
  • next-test only reads version
  • setup-dev-bundler only reads version
  • next-typegen throws the result away

warnings is also always empty. It looks for diagnostics with the Warning category, but I checked, and TypeScript 6.0.2 has no messages in that category. Deprecation messages use Suggestion instead.

So on every build, we filtered and formatted every diagnostic to build a list that was always empty, and that nobody read.

So I'm suggesting removing it instead, as it is clearly not being used. I also checked the GitHub code search across all public repositories and couldn't find anyone using either of them. That aside, it also never really worked correctly, as it would always return hasWarnings: true even if warnings was empty.

No test added since the fields are being removed. Also since this is such a small change I didn't create an issue to link here, I'd be happy to file one if you prefer me to.

Thanks for the hard work and taking the time for reviewing this PR! 😊

@martinfrancois

martinfrancois commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

I reran validation at afe7c8ecd8f2 on September 19. The workspace build, build-all, root TypeScript check, and formatting and lint checks for both changed files pass.

All 14 tests across the basic TypeScript build, CLI backend, and API error-handling suites pass in Webpack production mode. The removed fields are still present in current canary, and both affected source files match this PR's base there.

@lukesandberg, can you please rerun CI and review this cleanup of the TypeScript API and CLI results? The old failed run no longer exposes job details, so the local checks are the current evidence.

@lukesandberg
lukesandberg force-pushed the remove-unused-has-warnings branch from afe7c8e to 480da9d Compare September 20, 2026 17:29
@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 6a05386

@lukesandberg

Copy link
Copy Markdown
Contributor

@martinfrancois merging is blocked due to missing commit signatures. can you sign the commits

Nothing reads these two fields on `TypeCheckResult`.

`verifyAndRunTypeScript` has four callers:

- `build/type-check.ts` reads only `inputFilesCount`, `totalFilesCount` and
  `incremental`
- `next-test` reads only `version`
- `setup-dev-bundler` reads only `version`
- `next-typegen` throws the result away

`warnings` is also always empty. It looks for diagnostics with the category
`Warning`, but I checked, TypeScript 6.0.2 has no messages in that category.
Deprecation messages use `Suggestion` instead.

So on every build we filtered and formatted every diagnostic to build a list
that was always empty, and that nobody read.
@martinfrancois
martinfrancois force-pushed the remove-unused-has-warnings branch from 480da9d to 6a05386 Compare September 21, 2026 00:08
@martinfrancois

Copy link
Copy Markdown
Contributor Author

Sure @lukesandberg done, thanks for the quick review!

@lukesandberg
lukesandberg enabled auto-merge (squash) September 21, 2026 00:35
@lukesandberg
lukesandberg merged commit 57eb2b3 into vercel:canary Sep 21, 2026
117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants