Skip to content

refactor(compiler-cli): share template diagnostic filtering with NGP language service - #72355

Draft
atscott wants to merge 1 commit into
angular:mainfrom
atscott:ngp-share-diagnostic-filter
Draft

atscott wants to merge 1 commit into
angular:mainfrom
atscott:ngp-share-diagnostic-filter

Conversation

@atscott

@atscott atscott commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Extract shouldReportTemplateDiagnostic(code, tcbText, startOffset) from shouldReportDiagnostic in packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.ts (keeping shouldReportDiagnostic as a thin wrapper) and export it from @angular/compiler-cli/private/hybrid_analysis.

Previously, packages/compiler-cli/preprocessor/language-service/src/diagnostic_mapping.ts duplicated a hardcoded IGNORED_DIAGNOSTIC_CODES set and did not filter TS2341 private member reads on this. Delegating shouldReportDiagnostic to shouldReportTemplateDiagnostic and passing tcbCode and startOffset from mapDiagnostics removes the duplicate code list and aligns TS2341 filtering with ngtsc, suppressing errors on this. or (this). private member reads while still reporting them on other receivers. Includes a behavioral test in diagnostics_spec.ts covering both cases.

…language service

Extract shouldReportTemplateDiagnostic(code, tcbText, startOffset) from shouldReportDiagnostic in packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.ts (keeping shouldReportDiagnostic as a thin wrapper) and export it from @angular/compiler-cli/private/hybrid_analysis.

Previously, packages/compiler-cli/preprocessor/language-service/src/diagnostic_mapping.ts duplicated a hardcoded IGNORED_DIAGNOSTIC_CODES set and did not filter TS2341 private member reads on this. Delegating shouldReportDiagnostic to shouldReportTemplateDiagnostic and passing tcbCode and startOffset from mapDiagnostics removes the duplicate code list and aligns TS2341 filtering with ngtsc, suppressing errors on this. or (this). private member reads while still reporting them on other receivers.
@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Dec 4, 2026
@ngbot ngbot Bot added this to the Backlog milestone Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler Issues related to `ngc`, Angular's template compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant