Skip to content

Commit

Permalink
fix: handle static tag attribute on svelte:element
Browse files Browse the repository at this point in the history
fixes #395
  • Loading branch information
dummdidumm committed Jul 27, 2023
1 parent 90ef305 commit 6fc0b64
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# prettier-plugin-svelte changelog

## 3.0.3

- (fix) handle static `tag` attributes on `<svelte:element>`

## 3.0.2

- (fix) add `package.json` to exports map
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prettier-plugin-svelte",
"version": "3.0.2",
"version": "3.0.3",
"description": "Svelte plugin for prettier",
"main": "plugin.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ function printJS(
removeParentheses: boolean,
name: string,
) {
if (!node[name]) {
if (!node[name] || typeof node[name] !== 'object') {
return;
}
node[name].isJS = true;
Expand Down
1 change: 1 addition & 0 deletions test/printer/samples/svelte-element-static-tag.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svelte:element this="slot" bind:this={slot} />

0 comments on commit 6fc0b64

Please sign in to comment.