Repository: sveltejs/prettier-plugin-svelte (ts)

Issue:
Await then block destructuring syntax being reformatted to invalid syntax
When I have an await then block, that looks like this and I'm trying to destructure that data, the plugin seems to be removing the data part automatically.
![image](https://user-images.githubusercontent.com/7412443/141674261-86837d11-6a3b-4d93-955a-43151bcd82d8.png)

On saving the data gets removed
![image](https://user-images.githubusercontent.com/7412443/141674273-4fb99935-e01a-45bb-888d-ddfd1639b21a.png)

The response object looks like this
![image](https://user-images.githubusercontent.com/7412443/141674284-71d4b44a-427a-47c2-b132-08ecd0a821d5.png)
![image](https://user-images.githubusercontent.com/7412443/141674287-62d30754-1260-4d66-811b-2148a6639655.png)

The data property is an array of objects

This syntax should work as illustrated here:
https://replit.com/join/qwwgddonou-saikatdas3

![image](https://user-images.githubusercontent.com/7412443/141674398-5a78e38f-44fd-4b2e-a922-9f1e6bf554bb.png)


**System (please complete the following information):**
 - OS: Windows with WSL 2 and Ubuntu
 - IDE: VSCode
 - Plugin/Package: Svelte for VSCode

Pull request description:
(fix) properly format nested array patterns
Fixes #259

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 685b51a..d3885fc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
 
 * (feat) Support `bracketSameLine` option and deprecate `svelteBracketNewLine` ([#251](https://github.com/sveltejs/prettier-plugin-svelte/pull/251))
 * (fix) Prevent script/style contents from being erased in certain cases ([#255](https://github.com/sveltejs/prettier-plugin-svelte/issues/255))
+* (fix) Properly format nested array patterns ([#259](https://github.com/sveltejs/prettier-plugin-svelte/issues/259))
 
 ## 2.4.0
 
diff --git a/src/print/index.ts b/src/print/index.ts
index e3a6a5b..6fcb09d 100644
--- a/src/print/index.ts
+++ b/src/print/index.ts
@@ -1066,7 +1066,7 @@ function expandNode(node: any): string {
         case 'ObjectPattern':
             return ' {' + node.properties.map(expandNode).join(',') + ' }';
         case 'Property':
-            if (node.value.type === 'ObjectPattern') {
+            if (node.value.type === 'ObjectPattern' || node.value.type === 'ArrayPattern') {
                 return ' ' + node.key.name + ':' + expandNode(node.value);
             } else if (node.value.type === 'Identifier' && node.key.name !== node.value.name) {
                 return expandNode(node.key) + ':' + expandNode(node.value);


Test patch:
diff --git a/test/printer/samples/nested-destructuring.html b/test/printer/samples/nested-destructuring.html
new file mode 100644
index 0000000..a908791
--- /dev/null
+++ b/test/printer/samples/nested-destructuring.html
@@ -0,0 +1,7 @@
+{#await thePromise}
+    <p>loading...</p>
+{:then { data: [theValue] }}
+    <p>the value is {theValue}</p>
+{:catch { data: [{ data: [theError] }] }}
+    <p>oh no! {theError.message}</p>
+{/await}