File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
packages/@ngtools/webpack/src Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,22 @@ export class TypeScriptFileRefactor {
48
48
this . _sourceString = new MagicString ( this . _sourceText ) ;
49
49
}
50
50
51
+ /**
52
+ * Collates the diagnostic messages for the current source file
53
+ */
51
54
getDiagnostics ( ) : ts . Diagnostic [ ] {
52
55
if ( ! this . _program ) {
53
56
return [ ] ;
54
57
}
58
+ let diagnostics :ts . Diagnostic [ ] = this . _program . getSyntacticDiagnostics ( this . _sourceFile )
59
+ . concat ( this . _program . getSemanticDiagnostics ( this . _sourceFile ) ) ;
60
+ // only concat the declaration diagnostics if the tsconfig config sets it to true.
61
+ if ( this . _program . getCompilerOptions ( ) . declaration == true ) {
62
+ diagnostics = diagnostics . concat ( this . _program . getDeclarationDiagnostics ( this . _sourceFile ) ) ;
63
+ }
64
+ return diagnostics ;
65
+
55
66
56
- return this . _program . getSyntacticDiagnostics ( this . _sourceFile )
57
- . concat ( this . _program . getSemanticDiagnostics ( this . _sourceFile ) )
58
- . concat ( this . _program . getDeclarationDiagnostics ( this . _sourceFile ) ) ;
59
67
}
60
68
61
69
/**
You can’t perform that action at this time.
0 commit comments