Skip to content

feat: upgrade to typescript 5.9 - #1847

Closed
pradel wants to merge 2 commits into
stx-labs:mainfrom
pradel:feat/upgrade-typescript-5-9
Closed

feat: upgrade to typescript 5.9#1847
pradel wants to merge 2 commits into
stx-labs:mainfrom
pradel:feat/upgrade-typescript-5-9

Conversation

@pradel

@pradel pradel commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Upgrade TypeScript from 5.1.6 to 5.9.3 across the monorepo, along with updating typescript-eslint to v8 for compatibility. In this pr I tried to keep the same code as before to avoid any breaking changes.

Breaking change?

No

Checklist

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the monorepo’s TypeScript toolchain to TS 5.9.3 and updates typescript-eslint to v8 to maintain lint/typecheck compatibility, alongside small code adjustments needed to satisfy new typings/lint rules.

Changes:

  • Bump TypeScript from 5.1.6 → 5.9.3 and update @typescript-eslint/* to v8 (plus related lockfile updates).
  • Add targeted type assertions and eslint rule suppressions where new TS/ESLint rules flag existing patterns.
  • Minor async/Promise refactors and small type tightening to satisfy updated inference/overload resolution.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
packages/wallet-sdk/src/models/account.ts Adjust overload signature and add eslint suppression for throwing non-Error.
packages/transactions/src/clarity/parser.ts Add eslint suppressions around non-Error throws in parsing helpers.
packages/transactions/src/builders.ts Suppress no-empty-object-type for a deprecated alias interface.
packages/storage/src/hub.ts Cast upload body to BodyInit to satisfy updated fetch typings.
packages/storage/src/fileContentLoader.ts Suppress promise rejection lint rule in FileReader error handler.
packages/stacking/src/index.ts Simplify Promise.all usage with await destructuring.
packages/profile/src/profile.ts Suppress promise rejection lint rule in multiple reject paths.
packages/encryption/src/sha2Hash.ts Add any cast for WebCrypto digest input typing.
packages/encryption/src/pbkdf2.ts Add any casts for WebCrypto PBKDF2/HMAC argument typing.
packages/encryption/src/ec.ts Suppress only-throw-error when throwing a validation object.
packages/encryption/src/cryptoUtils.ts Update eslint suppression rule name for require usage.
packages/encryption/src/aesCipher.ts Add any casts for WebCrypto AES encrypt/decrypt argument typing.
packages/common/src/utils.ts Add eslint suppressions for stringification/throwing non-Error values.
packages/common/src/fetch.ts Slightly tighten RequestInit optional parameter typing.
packages/cli/src/utils.ts Update eslint suppression rule name; tighten Object → object.
packages/cli/src/network.ts Refactor JSON + tuple return to avoid Promise.all misuse/typing friction.
packages/cli/src/keys.ts Update eslint suppression rule name for require.
packages/cli/src/data.ts Update eslint suppression rule name for require.
packages/cli/src/cli.ts Tighten fetch response typing, add rejection lint suppressions, and use Buffer.isBuffer.
packages/cli/src/auth.ts Tighten Object → object in an interface field.
packages/auth/src/verification.ts Refactor async/Promise.all usage to direct boolean evaluation wrapped in a Promise.
packages/auth/src/messages.ts Align payload typing with jsontokens Json type and tighten profile param type.
package.json Bump TypeScript/ESLint-related devDependencies to new versions.
package-lock.json Lockfile updates for TS/ESLint dependency tree changes.
Comments suppressed due to low confidence (1)

packages/encryption/src/pbkdf2.ts:83

  • Several WebCrypto calls are coerced with as any (e.g., importKey input and deriveBits salt). Prefer updating the helper signatures/types to use the WebCrypto-expected types (BufferSource, AlgorithmIdentifier, etc.) so the code remains type-safe without any.
    const passwordBytes = utf8ToBytes(password);
    try {
      const key = await this.subtleCrypto.importKey('raw', passwordBytes as any, 'PBKDF2', false, [
        'deriveBits',
      ]);
      const result = await this.subtleCrypto.deriveBits(
        {
          name: 'PBKDF2',
          salt: salt as any,
          iterations,
          hash: { name: algo },
        },
        key,
        keyLength * 8
      );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/transactions/src/clarity/parser.ts
Comment thread packages/common/src/utils.ts
Comment thread packages/encryption/src/sha2Hash.ts
Comment thread packages/transactions/src/clarity/parser.ts
Comment thread packages/transactions/src/builders.ts
Comment thread packages/encryption/src/ec.ts
Comment thread packages/cli/src/cli.ts
Comment thread packages/cli/src/cli.ts
Comment thread packages/storage/src/hub.ts
Comment thread packages/encryption/src/aesCipher.ts
@jannik-stacks

Copy link
Copy Markdown
Collaborator

love this effort, but i've also been thinking about moving to oxlint or similar faster tooling (biome?). have you tried any of them? i have used oxlint in another project and will test out the switch in another branch. eslint configs have become painful and the migration to v9 is also a bit clunky

@pradel

pradel commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

@jannik-stacks I've tried both tools and I prefer oxlint/oxfmt, since they can be used with existing ESLint plugins if needed.
Regarding this pr, I haven’t updated ESLint to version 9, and in my opinion, the best solution is to migrate directly to oxlint. In this pr, I tried not to change the code’s behavior, and I think a migration to oxlint should be done in a separate follow-up pr, what do you think?

Comment thread packages/cli/src/network.ts
@jannik-stacks
jannik-stacks enabled auto-merge (squash) April 2, 2026 13:19
auto-merge was automatically disabled April 6, 2026 15:23

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants