sveltejs / prettier-plugin-svelte

Format your svelte components using prettier.
MIT License
714 stars 95 forks source link

ParseError when using object in generics #434

Closed mroforolhc closed 2 months ago

mroforolhc commented 2 months ago
["ERROR" - 4:35:30 PM] Error formatting document.
["ERROR" - 4:35:30 PM] Expected }
> 1 | <script lang="ts" generics="C extends ComponentType<SvelteComponent<{data: any}>>">
    |                                                                         ^
  2 |     import {
  3 |         onMount,
  4 |         type ComponentType,
ParseError: Expected }
> 1 | <script lang="ts" generics="C extends ComponentType<SvelteComponent<{data: any}>>">
    |                                                                         ^
  2 |     import {
  3 |         onMount,
  4 |         type ComponentType,
    at error (/node_modules/svelte/compiler.js:13213:20)
    at Parser$1.error (/node_modules/svelte/compiler.js:13291:10)
    at Parser$1.eat (/node_modules/svelte/compiler.js:13305:19)
    at read_sequence (/node_modules/svelte/compiler.js:12540:21)
    at read_attribute_value (/node_modules/svelte/compiler.js:12475:18)
    at read_attribute (/node_modules/svelte/compiler.js:12368:18)
    at tag (/node_modules/svelte/compiler.js:12207:26)
    at new Parser$1 (/node_modules/svelte/compiler.js:13250:22)
    at Object.parse$b [as parse] (/node_modules/svelte/compiler.js:13390:21)
    at Object.parse (/node_modules/prettier-plugin-svelte/plugin.js:2287:65)
["INFO" - 4:35:30 PM] Formatting completed in 13ms.
dummdidumm commented 2 months ago

What version of Svelte are you using? Make sure you're using the latest 4.x (or 5.0-next) version.

mroforolhc commented 2 months ago

You're right, thanks!

dummdidumm commented 2 months ago

I'm assuming this means this fixed it, therefore closing.