## Upgrade TypeScript 5.3.3 → 6.0.x Tracking issue for upgrading the project's TypeScript compiler from `5.3.3` to the `6.0.x` line. This supersedes the Dependabot PR #1019, which could not be merged as a standalone version bump — TypeScript 6 requires coordinated changes to the lint toolchain, the compiler target, and the built `dist/` output (see below). ### Why the Dependabot PR couldn't merge as-is 1. **Peer conflict with the old `@typescript-eslint` stack.** On the previous lint toolchain, `@typescript-eslint/eslint-plugin@8.48.0` declares `peerDependencies.typescript: ">=4.8.4 <6.0.0"`, which **hard-excludes** TypeScript `6.0.3` and produces an `ERESOLVE` at install time. 2. **Compiler target too old.** The current `tsconfig.json` uses `target: "es6"`. Modern TypeScript errors on the source as-is: `TS1503: Named capturing groups are only available when targeting 'ES2018' or later.` The build (`ncc build ...`) fails until the target is raised. 3. **`dist/` must be rebuilt.** Raising the target changes the emitted/bundled output, so `dist/setup/index.js` and `dist/cleanup/index.js` must be regenerated and committed (the `Check dist/` workflow enforces this). ### Prerequisites - [ ] **#1045 (ESLint v10 + flat config) must be merged first.** It replaces the old `@typescript-eslint/*` packages with `typescript-eslint@8.62.0`, whose parser peer range is `typescript: ">=4.8.4 <6.1.0"` — this is the version that actually permits TypeScript 6.0.x. Without it, the upgrade hits the `ERESOLVE` peer conflict described above. ### Work required (after #1045 lands) - [ ] Rebase onto `main` (post-#1045) and bump `typescript` `^5.3.3` → `^6.0.3` in `package.json`; regenerate `package-lock.json`. - [ ] Raise the compiler target in `tsconfig.json` from `es6` to at least `ES2018` (recommend `ES2022` to also unlock `Error(msg, { cause })` and modern lib features). Reconcile `lib`/`module` settings as needed. - [ ] Re-run `npm run build` and **commit the regenerated `dist/`** (the bundle will change). - [ ] Audit TypeScript 6.0 breaking changes against the codebase (stricter checks, removed/changed flags, `lib` differences). See the [TypeScript 6.0 announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/). - [ ] Confirm `@typescript-eslint`/`typescript-eslint` supports the chosen TS 6.0.x (peer is `<6.1.0`); bump if a newer line is needed. - [ ] Re-run the full validation matrix: `npm ci`, `npm run lint`, `npm run format-check`, `npm run build` (verify `dist/` matches), `npm test`, `npm audit --audit-level=high`. ### Optional follow-up (enabled by the higher target) - [ ] Once `target` is `ES2022`, adopt ESLint 10's `preserve-caught-error` rule (disabled in #1045 for parity) by attaching `{ cause }` to re-thrown errors (e.g. in `src/distributions/graalvm/installer.ts`). ### Notes - `tsconfig.json` is auto-synced from [actions/reusable-workflows](https://github.com/actions/reusable-workflows); coordinate the target change with upstream where applicable. - Recommended sequencing: **merge #1045 → rebase → tsconfig target bump → rebuild `dist/` → full validation.** Closes the effort tracked by #1019.