From 00a8316275d57570a15e41f13a8c1fd1d8d7ddfd Mon Sep 17 00:00:00 2001 From: Jeremy Wickersheimer Date: Sun, 17 Jul 2022 18:03:11 +0800 Subject: [PATCH 1/2] Fix the alignment of errors when the source code used tab for indentation. Signed-off-by: Jeremy Wickersheimer --- packages/astro/src/cli/check.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/cli/check.ts b/packages/astro/src/cli/check.ts index 65995d0e52a7..000b99b559d8 100644 --- a/packages/astro/src/cli/check.ts +++ b/packages/astro/src/cli/check.ts @@ -93,7 +93,7 @@ export async function check(astroConfig: AstroConfig) { let str = diag.text.substring(startOffset, endOffset - 1); const lineNumStr = d.range.start.line.toString(); const lineNumLen = lineNumStr.length; - console.error(`${bgWhite(black(lineNumStr))} ${str}`); + console.error(`${bgWhite(black(lineNumStr))} ${str.replaceAll('\t', ' ')}`); let tildes = generateString('~', d.range.end.character - d.range.start.character); let spaces = generateString(' ', d.range.start.character + lineNumLen - 1); console.error(` ${spaces}${bold(red(tildes))}\n`); From e87f4623778e7efd994e10def6b92d18634c3ee5 Mon Sep 17 00:00:00 2001 From: Jeremy Wickersheimer Date: Sun, 17 Jul 2022 18:05:44 +0800 Subject: [PATCH 2/2] Add changeset Signed-off-by: Jeremy Wickersheimer --- .changeset/warm-frogs-vanish.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/warm-frogs-vanish.md diff --git a/.changeset/warm-frogs-vanish.md b/.changeset/warm-frogs-vanish.md new file mode 100644 index 000000000000..baa6e3c8bcb5 --- /dev/null +++ b/.changeset/warm-frogs-vanish.md @@ -0,0 +1,5 @@ +--- +'astro': minor +--- + +Fix the alignment of errors when the source code used tab for indentation