Skip to content

Remove unused hasWarnings and warnings - #96956

Open
martinfrancois wants to merge 1 commit into
vercel:canaryfrom
martinfrancois:remove-unused-has-warnings
Open

Remove unused hasWarnings and warnings#96956
martinfrancois wants to merge 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! 😊

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.
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.

1 participant