Skip to content

Commit d939e8d

Browse files
chore(deps): bump vitest 4, vite 8, vite-plugin-svelte 7, typescript 6 (with adaptations) (#849)
## What Bundles the four breaking major-version dependency bumps together with the code adaptations they require, so they can land green as one unit: | Package | From | To | |---|---|---| | `vitest` | 3.2.4 | 4.1.9 | | `vite` | 7.x | 8.0.16 | | `@sveltejs/vite-plugin-svelte` | 6.x | 7.1.2 | | `typescript` | 5.3.3 | 6.0.3 | | `svelte2tsx` | 0.7.x | 0.7.56 _(TS6 support)_ | | `svelte-check` | 4.2.x | 4.6.0 _(TS6 support)_ | `esbuild` drops out of the lockfile — Vite 8 replaces esbuild/Rollup with Oxc/Rolldown, so it's no longer a transitive dependency. ## Code adaptations - **`infinitescroll.mock.ts`** — `IntersectionObserverPassive` is now a class. Vitest 4 forbids invoking a `vi.fn()` configured via `mockReturnValue` with `new`. Also added `scrollMargin` to the observer mocks (now required by the TS 6 `lib.d.ts` `IntersectionObserver` interface). - **`ScrollSentinel.spec.ts`** — the mock observer is stubbed via `vi.stubGlobal`; Vitest 4 cannot construct an arrow-function mock implementation with `new`. Added `scrollMargin` to the mock. - **`vitest.setup.ts`** — cast Node's `TextEncoder` to the DOM type; TS 6 made `Uint8Array` generic, breaking the previous direct assignment. - **`i18n.types.mjs`** — read the JSON file as `utf-8`; TS 6 types `readFileSync` without an encoding as a `Buffer`, not a `string`. ## `overrides` - `@dfinity/eslint-config-oisy-wallet` → `typescript: $typescript` — the config still declares a `typescript@^5` peer; it works fine with TS 6, so this satisfies the peer without `--legacy-peer-deps` (which would break auto-install of the `svelte` peer). - `@typescript-eslint/eslint-plugin` pinned to `8.58.1` (main's version) so the refreshed lockfile doesn't change lint behavior. ## Verification All gates that pass on `main` still pass locally: - ✅ `tsc -p tsconfig.spec.json` — 0 errors - ✅ tests — **331 passed** (60 files) - ✅ `npm run check` (svelte-check + TS6) — 0 errors - ✅ `npm run build` (Vite 8) and `npm run package` (svelte-package) - ✅ formatting — clean - ⚠️ `lint` shows the **same 19 pre-existing errors as `main`** (`vitest/no-conditional-expect`, `svelte/no-navigation-without-resolve`) — this PR adds **zero** new lint errors. `lint` and `e2e` are already red on `main`, independent of this change. ## Note This does **not** close the existing Dependabot PRs (#845, #843, #824) — they're left untouched. This PR is an alternative that bundles the bumps with the necessary adaptations. --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 76e1924 commit d939e8d

9 files changed

Lines changed: 1632 additions & 1377 deletions

File tree

9.89 KB
Loading
11.6 KB
Loading

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,12 @@ export default [
2828
"vitest/expect-expect": ["off"],
2929
},
3030
},
31+
{
32+
files: ["**/*.svelte"],
33+
rules: {
34+
// Svelte reactive declarations (`$:`) reassign `let` bindings, which
35+
// eslint's static analysis misreads as a useless initial assignment.
36+
"no-useless-assignment": ["off"],
37+
},
38+
},
3139
];

0 commit comments

Comments
 (0)