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

Prettier Plugin Svelte does not format typescript code inside on* handlers #447

Closed
lts20050703 opened this issue Jun 18, 2024 · 0 comments
Closed

Comments

@lts20050703
Copy link

lts20050703 commented Jun 18, 2024

It looks like Prettier does not format typescript code inside on* handlers

For example, prettier will successfully format the code below

<button onclick={() => {
  let i = 0
}}>

But it does not format the code below

<button onclick={() => {
  let i: number
}}>

Workaround: Move the code to a function in the <script> tag, then assign that function to the on* handler.

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

No branches or pull requests

1 participant