From 7e8bd7637f8a60114a4bf0bcf27fe9cb5f329029 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sat, 3 Oct 2020 10:39:50 -0600 Subject: [PATCH 1/2] fix: Hats in twoslash errors should be commented --- src/modules/twoslash.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/twoslash.ts b/src/modules/twoslash.ts index 0f9f6b72..2c2a0a37 100644 --- a/src/modules/twoslash.ts +++ b/src/modules/twoslash.ts @@ -105,7 +105,9 @@ export class TwoslashModule extends Module { linkWithHats += ' '.repeat(spaceBefore); linkWithHats += '^'.repeat(e.length || 0); }); - resultLines.push(linkWithHats); + if (linkWithHats.length > 0) { + resultLines.push('//' + linkWithHats.substr(2)); + } resultLines.push(...errors); } From 2e3632893cd0ffacd57b22b36afc303655c85432 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sat, 3 Oct 2020 11:23:12 -0600 Subject: [PATCH 2/2] review comment --- src/modules/twoslash.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/twoslash.ts b/src/modules/twoslash.ts index 2c2a0a37..edf8f891 100644 --- a/src/modules/twoslash.ts +++ b/src/modules/twoslash.ts @@ -105,9 +105,11 @@ export class TwoslashModule extends Module { linkWithHats += ' '.repeat(spaceBefore); linkWithHats += '^'.repeat(e.length || 0); }); + if (linkWithHats.length > 0) { resultLines.push('//' + linkWithHats.substr(2)); } + resultLines.push(...errors); }