Feature/typescript v6#287
Conversation
Upgrades TypeScript from 5.1.6 to 6.0.2 and ts-jest from 29.1.1 to 29.4.9 to align the build toolchain with the TypeScript 6 release. The ts-jest upgrade was required because 29.1.1 enforced a `typescript < 6` peer dependency constraint; 29.4.9 relaxes this to `< 7`. Lockfiles for both module and storybook workspaces are updated accordingly. BREAKING CHANGE: consumers using TypeScript < 6 may encounter type incompatibilities if emitted declaration files rely on TypeScript 6 type semantics
Adds @types/node to provide TypeScript type definitions for Node.js built-in modules. This ensures correct typings are available for Node APIs used during build and tooling scripts.
# Conflicts: # module/package.json # module/pnpm-lock.yaml # storybook/package.json # storybook/pnpm-lock.yaml
Updates `import React from 'react'` to `import * as React from 'react'` across select component, useChildForm hook, and useSSRLayoutEffect spec. This aligns with the TypeScript ESM-compatible import style required for the TypeScript v6 upgrade, where default imports from React may not resolve correctly under stricter module resolution settings.
There was a problem hiding this comment.
Pull request overview
Updates the repo’s TypeScript toolchain to TypeScript 6.0.2 (and ts-jest 29.4.9 in module/), with accompanying lockfile refreshes and TS config tweaks to align with bundler-style module resolution.
Changes:
- Bump TypeScript to
6.0.2inmodule/andstorybook/package manifests and lockfiles. - Upgrade
ts-jestto29.4.9inmodule/and update the lockfile dependency graph accordingly. - Adjust
module/TypeScript configuration (notablymoduleResolution: "bundler"and removal of interop flags).
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| storybook/pnpm-lock.yaml | Refresh Storybook lockfile to reflect TypeScript 6.0.2 throughout resolved dependency snapshots. |
| storybook/package.json | Bump Storybook workspace TypeScript dependency to 6.0.2. |
| module/tsconfig.node.json | Switch node tsconfig to bundler resolution and remove synthetic default import setting. |
| module/tsconfig.json | Remove several compiler options (including interop-related ones) and keep bundler module resolution. |
| module/pnpm-lock.yaml | Refresh module lockfile for TypeScript 6.0.2 + ts-jest 29.4.9; update peer/optional deps snapshots. |
| module/package.json | Bump typescript to 6.0.2 and ts-jest to 29.4.9. |
Files not reviewed (2)
- module/pnpm-lock.yaml: Language not supported
- storybook/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "preserveConstEnums": false, | ||
| "module": "ESNext", | ||
| "moduleResolution": "bundler", | ||
| "resolveJsonModule": true, |
There was a problem hiding this comment.
module/tsconfig.json removes esModuleInterop / allowSyntheticDefaultImports, but the codebase contains default imports from CommonJS-style modules (e.g. multiple import React from 'react' usages). With these flags removed, TypeScript will typically error on those imports. Either restore one of these interop options (preferred if you want to keep default-import style), or update the affected imports to namespace imports (e.g. import * as React from 'react') consistently across the module.
| "resolveJsonModule": true, | |
| "resolveJsonModule": true, | |
| "esModuleInterop": true, |
| "module": "ESNext", | ||
| "moduleResolution": "Node", | ||
| "allowSyntheticDefaultImports": true | ||
| "moduleResolution": "bundler" |
There was a problem hiding this comment.
module/tsconfig.node.json drops allowSyntheticDefaultImports, but vite.config.ts uses default imports like import path from 'path'. Without allowSyntheticDefaultImports or esModuleInterop, this commonly fails type-checking in TS. Consider re-adding the interop option for the node tsconfig, or change the imports in vite.config.ts to namespace imports.
| "moduleResolution": "bundler" | |
| "moduleResolution": "bundler", | |
| "allowSyntheticDefaultImports": true |
| - supports-color | ||
|
|
||
| typescript@5.8.2: {} | ||
|
|
||
| typescript@5.9.3: {} | ||
| typescript@6.0.2: {} |
There was a problem hiding this comment.
The PR description says the lockfile has been updated so transitive dependencies use TypeScript 6.0.2 for toolchain consistency, but pnpm-lock.yaml still includes typescript@5.8.2 (pulled in via @microsoft/api-extractor). If this is intentional, the description should be adjusted; otherwise consider upgrading the relevant tooling so it can depend on TypeScript 6 to avoid multiple compiler versions in the install.
Converts all `import * as React from 'react'` statements to `import React from 'react'` across components, hooks, form, and type files. Also disables the `import-x/default` ESLint rule and enables `esModuleInterop`-compatible resolution in tsconfig to support the new import style. This aligns with React 19 conventions and the ongoing TypeScript v6 upgrade.
…t line Merges separate named type imports (HTMLInputTypeAttribute, LabelHTMLAttributes, act) onto the same line as the default React import across components and tests. Reduces import verbosity and aligns with idiomatic TypeScript import style.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 70 out of 72 changed files in this pull request and generated 3 comments.
Files not reviewed (2)
- module/pnpm-lock.yaml: Language not supported
- storybook/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import React from 'react'; | ||
| import { LabelHTMLAttributes } from 'react'; |
There was a problem hiding this comment.
There are two separate imports from 'react' in this file (a default import plus a named import), which will violate the configured import-x/no-duplicates rule. Combine them into a single import (and consider marking LabelHTMLAttributes as type-only) to satisfy the linter.
| import React from 'react'; | |
| import { LabelHTMLAttributes } from 'react'; | |
| import React, { type LabelHTMLAttributes } from 'react'; |
| import React from 'react'; | ||
| import { HTMLInputTypeAttribute } from 'react'; |
There was a problem hiding this comment.
This file now imports from 'react' twice (import React ... and a separate named import). With import-x/no-duplicates enabled, this will fail linting. Please merge these into a single import (and make HTMLInputTypeAttribute type-only if applicable).
| import React from 'react'; | |
| import { HTMLInputTypeAttribute } from 'react'; | |
| import React, { type HTMLInputTypeAttribute } from 'react'; |
| import React from 'react'; | ||
| import { act } from 'react'; |
There was a problem hiding this comment.
There are two imports from 'react' here (import React ... and import { act } ...), which will trip import-x/no-duplicates. Merge into a single import from 'react' to keep lint passing.
What's new?
This pull request updates the project's TypeScript tooling and related dependencies to use TypeScript 6.0.2, along with an upgrade of
ts-jestto 29.4.9. The changes affect bothpackage.jsonand thepnpm-lock.yamllockfile, ensuring all dependencies and peer dependencies are aligned with the new TypeScript version.Dependency upgrades:
typescriptfrom 5.1.6 to 6.0.2 in bothpackage.jsonandpnpm-lock.yaml, updating all related references and peer dependencies throughout the lockfile. [1] [2] [3] [4] [5]ts-jestfrom 29.1.1 to 29.4.9, including its peer dependencies and compatibility with TypeScript 6.0.2. [1] [2] [3]Lockfile consistency:
pnpm-lock.yamlto use TypeScript 6.0.2, ensuring consistency across the toolchain (including ESLint, Storybook, semantic-release, and related plugins). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]These updates ensure the project uses the latest TypeScript features and maintains compatibility with the ecosystem.
Ticket number(s) in JIRA (if internal)
ARM-XX
board
Checklist