From d94370b6b96311b7dd1596186e0fc274a1a1d3e1 Mon Sep 17 00:00:00 2001 From: Yoav Balasiano Date: Thu, 11 Jul 2024 00:29:22 +0300 Subject: [PATCH] Fix issue #82 - ts(4113), ts(4117) --- src/format/formatDiagnosticMessage.ts | 4 ++-- src/test/suite/errorMessageMocks.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/format/formatDiagnosticMessage.ts b/src/format/formatDiagnosticMessage.ts index 2d2d766..446d9cf 100644 --- a/src/format/formatDiagnosticMessage.ts +++ b/src/format/formatDiagnosticMessage.ts @@ -69,7 +69,7 @@ export const formatDiagnosticMessage = ( ) // Format types .replaceAll( - /(type|type alias|interface|module|file|file name|method's|subtype of constraint) ['“](.*?)['“](?=[\s(.|,)]|$)/gi, + /(type|type alias|interface|module|file|file name|class|method's|subtype of constraint) ['“](.*?)['“](?=[\s(.|,)]|$)/gi, (_, p1: string, p2: string) => formatTypeBlock(p1, p2, format) ) // Format reversed types @@ -96,6 +96,6 @@ export const formatDiagnosticMessage = ( ) // Format regular code blocks .replaceAll( - /(? ` ${unStyledCodeBlock(p1)} ` ); diff --git a/src/test/suite/errorMessageMocks.ts b/src/test/suite/errorMessageMocks.ts index e0f4391..d067152 100644 --- a/src/test/suite/errorMessageMocks.ts +++ b/src/test/suite/errorMessageMocks.ts @@ -99,3 +99,11 @@ const ts2322ErrorWithPrivateProperty = d` Type 'Ref<{ name: string; readonly type: "json"; mm: (px: T) => T; px: (mm: T) => T; ... 18 more ...; toJson: () => string; }>' is not assignable to type 'Ref'. Type '{ name: string; readonly type: "json"; mm: (px: T) => T; px: (mm: T) => T; ... 18 more ...; toJson: () => string; }' is missing the following properties from type 'MpcdiConfiguration': ratio, #overlaps, download `; + +const ts4113Error = d` +This member cannot have an 'override' modifier because it is not declared in the base class 'A'. +`; + +const ts4117Error = d` +This member cannot have an 'override' modifier because it is not declared in the base class 'A'. Did you mean 'testA'? +`;