From ab6e713aa6588cfeed31cfa9641c7e17ad5adb98 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Thu, 21 Nov 2024 20:39:06 +0100 Subject: [PATCH] feat: support `bind:value={get, set}` --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/embed.ts | 1 + test/printer/samples/binding-get-set.html.skip | 3 +++ 5 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 test/printer/samples/binding-get-set.html.skip diff --git a/CHANGELOG.md b/CHANGELOG.md index c3973e3..755de01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # prettier-plugin-svelte changelog +## 3.3.1 + +- (feat) Svelte 5: support upcoming `bind:value={get, set}` + ## 3.3.0 - (feat) Svelte 5: support upcoming `` diff --git a/package-lock.json b/package-lock.json index bdd78b1..12d7d41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "prettier-plugin-svelte", - "version": "3.3.0", + "version": "3.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "prettier-plugin-svelte", - "version": "3.3.0", + "version": "3.3.1", "license": "MIT", "devDependencies": { "@rollup/plugin-alias": "^5.1.0", diff --git a/package.json b/package.json index ce44c7e..3b1058b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prettier-plugin-svelte", - "version": "3.3.0", + "version": "3.3.1", "description": "Svelte plugin for prettier", "main": "plugin.js", "files": [ diff --git a/src/embed.ts b/src/embed.ts index 237736e..de49469 100644 --- a/src/embed.ts +++ b/src/embed.ts @@ -128,6 +128,7 @@ export function embed(path: FastPath, _options: Options) { printJS(parent, 'expression', {}); break; case 'ConstTag': + case 'Binding': printJS(parent, 'expression', { removeParentheses: true }); break; case 'RenderTag': diff --git a/test/printer/samples/binding-get-set.html.skip b/test/printer/samples/binding-get-set.html.skip new file mode 100644 index 0000000..1b070b8 --- /dev/null +++ b/test/printer/samples/binding-get-set.html.skip @@ -0,0 +1,3 @@ + value, (v) => (value = v)} /> + +