Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export class AotCompilation extends AngularCompilation {

const syntactic = modes & DiagnosticModes.Syntactic;
const semantic = modes & DiagnosticModes.Semantic;
const skipLibCheck = typeScriptProgram.getCompilerOptions().skipLibCheck;

// Collect program level diagnostics
if (modes & DiagnosticModes.Option) {
Expand Down Expand Up @@ -265,13 +266,19 @@ export class AotCompilation extends AngularCompilation {
continue;
}

// When skipLibCheck is enabled (the default), declaration files are not
// type-checked, so getSemanticDiagnostics() would return nothing for them.
if (sourceFile.isDeclarationFile && skipLibCheck) {
continue;
}

yield* profileSync(
'NG_DIAGNOSTICS_SEMANTIC',
() => typeScriptProgram.getSemanticDiagnostics(sourceFile),
true,
);

// Declaration files cannot have template diagnostics
// Declaration files cannot have template diagnostics.
if (sourceFile.isDeclarationFile) {
continue;
}
Expand Down
Loading