From 9102bc0de6efc40c5553b84a1989280b2381f909 Mon Sep 17 00:00:00 2001 From: Loldator <34237517+Loldator@users.noreply.github.com> Date: Sun, 23 Oct 2022 01:43:52 +0200 Subject: [PATCH] Whitespace in docs code snippets (#7356) Fixes #7330 Co-authored-by: John Doe --- packages/kit/scripts/extract-types.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/kit/scripts/extract-types.js b/packages/kit/scripts/extract-types.js index 36a95b78d257..9554b00cb3a2 100644 --- a/packages/kit/scripts/extract-types.js +++ b/packages/kit/scripts/extract-types.js @@ -56,13 +56,15 @@ function get_types(code, statements) { const i = code.indexOf('export', start); start = i + 6; - const snippet = prettier.format(code.slice(start, statement.end).trim(), { - parser: 'typescript', - printWidth: 80, - useTabs: true, - singleQuote: true, - trailingComma: 'none' - }); + const snippet = prettier + .format(code.slice(start, statement.end), { + parser: 'typescript', + printWidth: 80, + useTabs: true, + singleQuote: true, + trailingComma: 'none' + }) + .trim(); const collection = ts.isVariableStatement(statement) || ts.isFunctionDeclaration(statement)