Skip to content

Commit a78c94c

Browse files
authored
chore: bump prettier-plugin-svelte 3.5.2 -> 4.0.0 (#234)
The 4.0.0 plugin crashes during `prettier --check` when an `{@const}` contains a ternary whose expressions involve a `BinaryExpression` (`Error: unknown node type: BinaryExpression`). Move the `totalProgress` computation out of the `{@const}` in SendButton.svelte into a script-level `$derived` so prettier can format the file again, then take the major bump. Breaking-change audit for 4.0.0: - Requires Svelte 5 (have ^5.55.9). - Drops `svelteBracketNewLine` and `svelteStrictMode` options — repo uses neither in `package.json#prettier`. Verified locally: `npm run lint`, `svelte-check`, `npm run build` clean.
1 parent 84633aa commit a78c94c

3 files changed

Lines changed: 18 additions & 13 deletions

File tree

package-lock.json

Lines changed: 8 additions & 5 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
@@ -32,7 +32,7 @@
3232
"lint-staged": "^17.0.5",
3333
"mdsvex": "^0.12.7",
3434
"prettier": "^3.8.3",
35-
"prettier-plugin-svelte": "^3.5.2",
35+
"prettier-plugin-svelte": "^4.0.0",
3636
"rollup": "^4.60.4",
3737
"sass": "^1.99.0",
3838
"svelte": "^5.55.9",

src/lib/components/filesharing/SendButton.svelte

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,15 @@
308308
let buttonRef: HTMLButtonElement | null = $state(null)
309309
let dialogRef: HTMLDialogElement | null = $state(null)
310310
311+
let totalProgress = $derived(
312+
encryptState.percentages.length > 0
313+
? Math.round(
314+
encryptState.percentages.reduce((a, b) => a + b, 0) /
315+
encryptState.percentages.length
316+
)
317+
: 0
318+
)
319+
311320
$effect(() => {
312321
if (!browser || !dialogRef) return
313322
if (showValidationModal) {
@@ -337,13 +346,6 @@
337346
{/if}
338347
{#if encryptState.encryptionState === EncryptionState.Encrypting}
339348
<!-- Loading info box during upload -->
340-
{@const totalProgress =
341-
encryptState.percentages.length > 0
342-
? Math.round(
343-
encryptState.percentages.reduce((a, b) => a + b, 0) /
344-
encryptState.percentages.length
345-
)
346-
: 0}
347349
<div class="upload-info-box">
348350
<div
349351
class="progress-bar"

0 commit comments

Comments
 (0)