Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No formatting inside #each destructuring #265

Closed
janosh opened this issue Nov 27, 2021 · 0 comments · Fixed by #269
Closed

No formatting inside #each destructuring #265

janosh opened this issue Nov 27, 2021 · 0 comments · Fixed by #269

Comments

@janosh
Copy link

janosh commented Nov 27, 2021

Code inside #each destructuring doesn't appear to be formatted. Using

"prettier": "^2.5.0",
"prettier-plugin-svelte": "^2.5.0",
"svelte": "^3.44.2",

Expected after formatting

<script>
  let arr = [{ a: 1 }]
</script>

{#each arr as { a, b = '' }}
  {a}
  {b}
{/each}

Actual

<script>
  let arr = [{a:1}]
</script>

{#each arr as {a,b =''}}
  {a}
  {b}
{/each}
dummdidumm pushed a commit to dummdidumm/prettier-plugin-svelte that referenced this issue Dec 3, 2021
- use expandNode for each context
- support array and object expressions in expandNode
sveltejs#265
dummdidumm added a commit that referenced this issue Dec 3, 2021
- use expandNode for each context
- support array and object expressions in expandNode

#265
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant