Remove unused `hasWarnings` and `warnings` (#96956)
### 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!😊
Showing
Please
register
or
sign in
to comment