@@ -31,7 +31,7 @@ import {StandaloneComponentScopeReader} from '../../scope/src/standalone';
3131import { aliasTransformFactory , CompilationMode , declarationTransformFactory , DecoratorHandler , DtsTransformRegistry , ivyTransformFactory , TraitCompiler } from '../../transform' ;
3232import { TemplateTypeCheckerImpl } from '../../typecheck' ;
3333import { OptimizeFor , TemplateTypeChecker , TypeCheckingConfig } from '../../typecheck/api' ;
34- import { ALL_DIAGNOSTIC_FACTORIES , ExtendedTemplateCheckerImpl } from '../../typecheck/extended' ;
34+ import { ALL_DIAGNOSTIC_FACTORIES , ExtendedTemplateCheckerImpl , SUPPORTED_DIAGNOSTIC_NAMES } from '../../typecheck/extended' ;
3535import { ExtendedTemplateChecker } from '../../typecheck/extended/api' ;
3636import { getSourceFileOrNull , isDtsPath , toUnredirectedSourceFile } from '../../util/src/typescript' ;
3737import { Xi18nContext } from '../../xi18n' ;
@@ -782,6 +782,8 @@ export class NgCompiler {
782782 // (providing the full TemplateTypeChecker API) and if strict mode is not enabled. In strict
783783 // mode, the user is in full control of type inference.
784784 suggestionsForSuboptimalTypeInference : this . enableTemplateTypeChecker && ! strictTemplates ,
785+ controlFlowPreventingContentProjection :
786+ this . options . extendedDiagnostics ?. defaultCategory || DiagnosticCategoryLabel . Warning ,
785787 } ;
786788 } else {
787789 typeCheckingConfig = {
@@ -810,6 +812,8 @@ export class NgCompiler {
810812 // In "basic" template type-checking mode, no warnings are produced since most things are
811813 // not checked anyways.
812814 suggestionsForSuboptimalTypeInference : false ,
815+ controlFlowPreventingContentProjection :
816+ this . options . extendedDiagnostics ?. defaultCategory || DiagnosticCategoryLabel . Warning ,
813817 } ;
814818 }
815819
@@ -848,6 +852,11 @@ export class NgCompiler {
848852 if ( this . options . strictLiteralTypes !== undefined ) {
849853 typeCheckingConfig . strictLiteralTypes = this . options . strictLiteralTypes ;
850854 }
855+ if ( this . options . extendedDiagnostics ?. checks ?. controlFlowPreventingContentProjection !==
856+ undefined ) {
857+ typeCheckingConfig . controlFlowPreventingContentProjection =
858+ this . options . extendedDiagnostics . checks . controlFlowPreventingContentProjection ;
859+ }
851860
852861 return typeCheckingConfig ;
853862 }
@@ -1285,18 +1294,16 @@ ${allowedCategoryLabels.join('\n')}
12851294 } ) ;
12861295 }
12871296
1288- const allExtendedDiagnosticNames =
1289- ALL_DIAGNOSTIC_FACTORIES . map ( ( factory ) => factory . name ) as string [ ] ;
12901297 for ( const [ checkName , category ] of Object . entries ( options . extendedDiagnostics ?. checks ?? { } ) ) {
1291- if ( ! allExtendedDiagnosticNames . includes ( checkName ) ) {
1298+ if ( ! SUPPORTED_DIAGNOSTIC_NAMES . has ( checkName ) ) {
12921299 yield makeConfigDiagnostic ( {
12931300 category : ts . DiagnosticCategory . Error ,
12941301 code : ErrorCode . CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK ,
12951302 messageText : `
12961303Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${ checkName } ".
12971304
12981305Allowed check names are:
1299- ${ allExtendedDiagnosticNames . join ( '\n' ) }
1306+ ${ Array . from ( SUPPORTED_DIAGNOSTIC_NAMES ) . join ( '\n' ) }
13001307 ` . trim ( ) ,
13011308 } ) ;
13021309 }
0 commit comments