From 8fa8c25851efb42b19847de266086fe1c7be7c44 Mon Sep 17 00:00:00 2001 From: Puru Vijay Date: Fri, 14 Apr 2023 23:07:34 +0530 Subject: [PATCH] Fix actions logic --- sites/svelte.dev/src/lib/server/docs/index.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sites/svelte.dev/src/lib/server/docs/index.js b/sites/svelte.dev/src/lib/server/docs/index.js index 069e1c6531..d7b5fc20c4 100644 --- a/sites/svelte.dev/src/lib/server/docs/index.js +++ b/sites/svelte.dev/src/lib/server/docs/index.js @@ -128,8 +128,9 @@ export async function get_parsed_docs(docs_data, slug) { injected.push('// @esModuleInterop'); } + // Actions JSDoc examples are invalid. Too many errors, edge cases if (page.file.includes('svelte-action')) { - injected.push("import type { Action, ActionReturn } from 'svelte/action';"); + injected.push('// @noErrors'); } if (injected.length) { @@ -139,13 +140,7 @@ export async function get_parsed_docs(docs_data, slug) { } else { source = source.replace( /^(?!\/\/ @)/m, - - `${injected_str}\n\n// @filename: index.${language}\n` + - injected.filter((val) => val.startsWith('import ')).join('\n') + - // This exists only for the JSDoc examples for svelte action types - 'interface Parameter {}; \n' + - '// @errors: 2695 7006 2304 1128 1109 1005' + - ` // ---cut---\n` + `${injected_str}\n\n// @filename: index.${language}\n` + ` // ---cut---\n` ); } }