fix: preserve nested rest patterns in {#each} destructuring context - #537
Merged
dummdidumm merged 2 commits intoJun 15, 2026
Merged
Conversation
`{#each items as [a, b, ...[c, d]]}` and `{#each items as [a, ...{ length }]}`
were printed as `...undefined`, silently dropping the nested bindings.
`expandNode`'s `RestElement` case read `node.argument.name`, which is `undefined`
when the rest argument is itself an `ArrayPattern` / `ObjectPattern` rather than a
plain `Identifier`. Recurse into the argument instead so nested destructuring
rest patterns round-trip.
dummdidumm
approved these changes
Jun 15, 2026
Merged
Migan178
pushed a commit
to Migan178/miganart
that referenced
this pull request
Jul 28, 2026
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte) | devDependencies | major | [`^3.5.0` → `^4.0.0`](https://renovatebot.com/diffs/npm/prettier-plugin-svelte/3.5.2/4.1.1) | --- ### Release Notes <details> <summary>sveltejs/prettier-plugin-svelte (prettier-plugin-svelte)</summary> ### [`v4.1.1`](https://github.com/sveltejs/prettier-plugin-svelte/blob/HEAD/CHANGELOG.md#411) [Compare Source](https://github.com/sveltejs/prettier-plugin-svelte/compare/prettier-plugin-svelte@4.1.0...prettier-plugin-svelte@4.1.1) ##### Patch Changes - fix: preserve nested rest patterns in `{#each}` destructuring ([#​537](sveltejs/prettier-plugin-svelte#537)) - fix: preserve whitespace inside `<textarea>` (its content is whitespace-sensitive, like `<pre>`) ([#​540](sveltejs/prettier-plugin-svelte#540)) - fix: don't drop `<script>`/`<style>` content when the closing tag has whitespace (`</script >`) ([#​539](sveltejs/prettier-plugin-svelte#539)) ### [`v4.1.0`](https://github.com/sveltejs/prettier-plugin-svelte/blob/HEAD/CHANGELOG.md#410) [Compare Source](https://github.com/sveltejs/prettier-plugin-svelte/compare/prettier-plugin-svelte@4.0.1...prettier-plugin-svelte@4.1.0) ##### Minor Changes - feat: support Svelte 5 declaration tags ([#​533](sveltejs/prettier-plugin-svelte#533)) ### [`v4.0.1`](https://github.com/sveltejs/prettier-plugin-svelte/blob/HEAD/CHANGELOG.md#401) [Compare Source](https://github.com/sveltejs/prettier-plugin-svelte/compare/prettier-plugin-svelte@4.0.0...prettier-plugin-svelte@4.0.1) ##### Patch Changes - fix: print `@const` correctly ([#​530](sveltejs/prettier-plugin-svelte#530)) ### [`v4.0.0`](https://github.com/sveltejs/prettier-plugin-svelte/blob/HEAD/CHANGELOG.md#400) [Compare Source](https://github.com/sveltejs/prettier-plugin-svelte/compare/v3.5.2...prettier-plugin-svelte@4.0.0) - (breaking) Require Svelte 5 - (breaking) Remove `svelteBracketNewLine` option - (breaking) Remove `svelteStrictMode` option - (fix) Keep trailing `<!-- #endregion -->` comments below `svelte:options` / scripts / styles </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODEuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.miganbox.com/migan/miganart/pulls/7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
{#each items as [a, b, ...[c, d]]}and{#each items as [a, ...{ length }]}were printed as...undefined, silently dropping the nested bindings.expandNode'sRestElementcase readnode.argument.name, which isundefinedwhen the rest argument is itself anArrayPattern/ObjectPatternrather than a plainIdentifier. Recurse into the argument instead so nested destructuring rest patterns round-trip.