From dc74cb7e197f6cf75c50ab17fb4f2c6ed678a3fb Mon Sep 17 00:00:00 2001 From: Sasha Mysak Date: Fri, 22 Dec 2023 14:25:14 +0100 Subject: [PATCH] fix(parser): fix newline --- readme-parser/parse.test.ts | 12 ++++++------ readme-parser/parse.ts | 2 +- readme-parser/sync.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/readme-parser/parse.test.ts b/readme-parser/parse.test.ts index 23da9192..1513c69a 100644 --- a/readme-parser/parse.test.ts +++ b/readme-parser/parse.test.ts @@ -101,9 +101,9 @@ describe('parse/yaml', function () { 'This is an amazing codemod which does `the thing`\n\n### WARNING\n\nThis codemod does the thing\n' + 'Following the original msw [upgrade guide](https://mswjs.io/docs/migrations/1.x-to-2.x/#imports), ' + 'there are certain imports that changed their location and/or naming. This codemod will adjust your imports to the new location and naming.\n' + - '- `setupWorker` is now imported from `msw/browser`\n' + - '- `rest` from `msw` is now named `http`\n' + - '- `RestHandler` from `msw` is now named `HttpHandler`', + ' - `setupWorker` is now imported from `msw/browser`\n' + + ' - `rest` from `msw` is now named `http`\n' + + ' - `RestHandler` from `msw` is now named `HttpHandler`', examples: '\n### `tsconfig.json`\n\n' + '### Before\n\n' + @@ -177,9 +177,9 @@ f_long-description: >- This codemod does the thing Following the original msw [upgrade guide](https://mswjs.io/docs/migrations/1.x-to-2.x/#imports), there are certain imports that changed their location and/or naming. This codemod will adjust your imports to the new location and naming. - - \`setupWorker\` is now imported from \`msw/browser\` - - \`rest\` from \`msw\` is now named \`http\` - - \`RestHandler\` from \`msw\` is now named \`HttpHandler\` + - \`setupWorker\` is now imported from \`msw/browser\` + - \`rest\` from \`msw\` is now named \`http\` + - \`RestHandler\` from \`msw\` is now named \`HttpHandler\` diff --git a/readme-parser/parse.ts b/readme-parser/parse.ts index 8987edfd..2f1ae41c 100644 --- a/readme-parser/parse.ts +++ b/readme-parser/parse.ts @@ -178,7 +178,7 @@ const getTextByHeader = ( if (child.type === 'listItem') { if (isDescription) { - return `- ${getTextFromNode( + return ` - ${getTextFromNode( child.children[0] ?? null, true, )}${delimiter}`; diff --git a/readme-parser/sync.ts b/readme-parser/sync.ts index 53ea0e92..0bcdcf59 100644 --- a/readme-parser/sync.ts +++ b/readme-parser/sync.ts @@ -206,7 +206,7 @@ export const sync = async () => { } const websiteLeftoverDescription = websiteContentSplit.at(2)?.trim(); - updatedYaml = `---\n${updatedYaml}---\n${ + updatedYaml = `---\n${updatedYaml}\n---\n${ websiteLeftoverDescription ?? newFileShortDescription }`;