Skip to content

Commit

Permalink
fix(@ngtools/webpack): update formatDiagnostics call
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva committed Oct 19, 2017
1 parent 46530b9 commit 3ee8fbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/@ngtools/webpack/src/angular_compiler_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,12 @@ export class AngularCompilerPlugin implements Tapable {
.filter((diag) => diag.category === ts.DiagnosticCategory.Warning);

if (errors.length > 0) {
const message = formatDiagnostics(this._angularCompilerOptions, errors);
const message = formatDiagnostics(errors);
this._compilation.errors.push(message);
}

if (warnings.length > 0) {
const message = formatDiagnostics(this._angularCompilerOptions, warnings);
const message = formatDiagnostics(warnings);
this._compilation.warnings.push(message);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@ngtools/webpack/src/ngtools_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export interface CreateCompilerHostInterface {
}): CompilerHost;
}
export interface FormatDiagnosticsInterface {
(options: CompilerOptions, diags: Diagnostics): string;
(diags: Diagnostics): string;
}

// Manually check for Compiler CLI availability and supported version.
Expand Down
4 changes: 2 additions & 2 deletions packages/@ngtools/webpack/src/type_checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ class TypeChecker {
const warnings = allDiagnostics.filter((d) => d.category === ts.DiagnosticCategory.Warning);

if (errors.length > 0) {
const message = formatDiagnostics(this._angularCompilerOptions, errors);
const message = formatDiagnostics(errors);
console.error(bold(red('ERROR in ' + message)));
}

if (warnings.length > 0) {
const message = formatDiagnostics(this._angularCompilerOptions, warnings);
const message = formatDiagnostics(warnings);
console.log(bold(yellow('WARNING in ' + message)));
}
}
Expand Down

0 comments on commit 3ee8fbc

Please sign in to comment.