Skip to content

Commit

Permalink
fix: add more extensive migration export regex (#8537)
Browse files Browse the repository at this point in the history
* change export regex to be more extensive

* add changeset
  • Loading branch information
eltigerchino authored Jan 15, 2023
1 parent f934ade commit 00e58d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/olive-cars-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte-migrate': patch
---

fix: correctly check for old load props
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function migrate_scripts(content, is_error, moved) {
return '';
}

if (!is_error && /export/.test(contents)) {
if (!is_error && /export let [\w]+[^"`'\w\s]/.test(contents)) {
contents = `\n${indent}${error('Add data prop', TASKS.PAGE_DATA_PROP)}\n${contents}`;
// Possible TODO: migrate props to data.prop, or suggest $: ({propX, propY, ...} = data);
}
Expand Down

0 comments on commit 00e58d6

Please sign in to comment.