From 56dd3e77acdccd73c015069e456f1e3bc1bff155 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 15 Jul 2020 20:53:32 +0100 Subject: [PATCH] refactor(localize): remove unnecessary ! operator (#38082) The messages property always exists so there is no need for the ! operator. PR Close #38082 --- packages/localize/src/tools/src/diagnostics.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/localize/src/tools/src/diagnostics.ts b/packages/localize/src/tools/src/diagnostics.ts index 4afadcdb76..9e2152853b 100644 --- a/packages/localize/src/tools/src/diagnostics.ts +++ b/packages/localize/src/tools/src/diagnostics.ts @@ -35,8 +35,8 @@ export class Diagnostics { this.messages.push(...other.messages); } formatDiagnostics(message: string): string { - const errors = this.messages!.filter(d => d.type === 'error').map(d => ' - ' + d.message); - const warnings = this.messages!.filter(d => d.type === 'warning').map(d => ' - ' + d.message); + const errors = this.messages.filter(d => d.type === 'error').map(d => ' - ' + d.message); + const warnings = this.messages.filter(d => d.type === 'warning').map(d => ' - ' + d.message); if (errors.length) { message += '\nERRORS:\n' + errors.join('\n'); }