Skip to content

Commit 6fc0b64

Browse files
committed
fix: handle static tag attribute on svelte:element
fixes #395
1 parent 90ef305 commit 6fc0b64

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# prettier-plugin-svelte changelog
22

3+
## 3.0.3
4+
5+
- (fix) handle static `tag` attributes on `<svelte:element>`
6+
37
## 3.0.2
48

59
- (fix) add `package.json` to exports map

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prettier-plugin-svelte",
3-
"version": "3.0.2",
3+
"version": "3.0.3",
44
"description": "Svelte plugin for prettier",
55
"main": "plugin.js",
66
"files": [

src/embed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function printJS(
352352
removeParentheses: boolean,
353353
name: string,
354354
) {
355-
if (!node[name]) {
355+
if (!node[name] || typeof node[name] !== 'object') {
356356
return;
357357
}
358358
node[name].isJS = true;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<svelte:element this="slot" bind:this={slot} />

0 commit comments

Comments
 (0)