sveltejs / prettier-plugin-svelte

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

V3 is throwing errors on svelte:element when this is "slot" #395

Closed JoaoVictorLouro closed 11 months ago

JoaoVictorLouro commented 11 months ago

I am having some issues with the new v3 implementation. Putting it simple:

Oops! Something went wrong! :(

ESLint: 8.45.0

TypeError: Cannot create property 'isJS' on string 'slot'
    at printJS$1 (/home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier-plugin-svelte@3.0.2_prettier@3.0.0_svelte@4.1.1/node_modules/prettier-plugin-svelte/plugin.js:2184:25)
    at embed (/home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier-plugin-svelte@3.0.2_prettier@3.0.0_svelte@4.1.1/node_modules/prettier-plugin-svelte/plugin.js:1987:13)
    at recurse (file:///home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier@3.0.0/node_modules/prettier/index.mjs:18002:20)
    at AstPath.each (file:///home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier@3.0.0/node_modules/prettier/index.mjs:17303:9)
    at recurse (file:///home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier@3.0.0/node_modules/prettier/index.mjs:17997:15)
    at AstPath.each (file:///home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier@3.0.0/node_modules/prettier/index.mjs:17303:9)
    at recurse (file:///home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier@3.0.0/node_modules/prettier/index.mjs:17997:15)
    at AstPath.each (file:///home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier@3.0.0/node_modules/prettier/index.mjs:17303:9)
    at recurse (file:///home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier@3.0.0/node_modules/prettier/index.mjs:17997:15)
    at AstPath.call (file:///home/kite/Git/f8notes/node_modules/.pnpm/registry.npmjs.org+prettier@3.0.0/node_modules/prettier/index.mjs:17265:14)

Why am I using "svelte:element" to create a slot?

My code base uses:

I debugged the code a bit and reached the following conclusions:

Happy to submit a PR, but again, I am not familiar with these projects, I only use them, never worked on them.

JoaoVictorLouro commented 11 months ago

@dummdidumm just wanted to say, thank you! :) keep up the good work! really appreciate it! :+1: