diff --git a/packages/svelte/src/compiler/migrate/index.js b/packages/svelte/src/compiler/migrate/index.js index 5ce56f687b87..b0867766e3d0 100644 --- a/packages/svelte/src/compiler/migrate/index.js +++ b/packages/svelte/src/compiler/migrate/index.js @@ -213,11 +213,11 @@ export function migrate(source, { filename } = {}) { } type += `\n${indent}}`; } else { - type = `/**\n${indent}* @typedef {Object} ${type_name}${state.props + type = `/**\n${indent} * @typedef {Object} ${type_name}${state.props .map((prop) => { - return `\n${indent}* @property {${prop.type}} ${prop.optional ? `[${prop.exported}]` : prop.exported}${prop.comment ? ` - ${prop.comment}` : ''}`; + return `\n${indent} * @property {${prop.type}} ${prop.optional ? `[${prop.exported}]` : prop.exported}${prop.comment ? ` - ${prop.comment}` : ''}`; }) - .join(``)}\n${indent}*/`; + .join(``)}\n${indent} */`; } let props_declaration = `let {${props_separator}${props}${has_many_props ? `\n${indent}` : ' '}}`; if (uses_ts) { @@ -1260,7 +1260,6 @@ function extract_type_and_comment(declarator, str, path) { // Try to find jsdoc above the declaration let comment_node = /** @type {Node} */ (parent)?.leadingComments?.at(-1); - //if (comment_node?.type !== 'Block') comment_node = undefined; const comment_start = /** @type {any} */ (comment_node)?.start; const comment_end = /** @type {any} */ (comment_node)?.end; diff --git a/packages/svelte/tests/migrate/samples/$$slots-used-as-variable-$$props/output.svelte b/packages/svelte/tests/migrate/samples/$$slots-used-as-variable-$$props/output.svelte index 4dbd50f5ebeb..c1a3e8d6363f 100644 --- a/packages/svelte/tests/migrate/samples/$$slots-used-as-variable-$$props/output.svelte +++ b/packages/svelte/tests/migrate/samples/$$slots-used-as-variable-$$props/output.svelte @@ -1,9 +1,9 @@