Skip to content

feat: upgrade TypeScript to 6.0.2#730

Open
yoannfleurydev wants to merge 5 commits intomainfrom
yoannfleurydev/ts-6-rc-update
Open

feat: upgrade TypeScript to 6.0.2#730
yoannfleurydev wants to merge 5 commits intomainfrom
yoannfleurydev/ts-6-rc-update

Conversation

@yoannfleurydev
Copy link
Copy Markdown
Member

@yoannfleurydev yoannfleurydev commented Mar 19, 2026

Summary

  • Upgrade TypeScript from 5.9.3 to 6.0.1-rc
  • Extract ComboboxProps type alias for improved type safety
  • Add module declarations for CSS and font imports
  • Update tsconfig.json with e2e path alias

Test plan

  • TypeScript compilation passes without errors
  • Pre-commit hooks pass (oxlint)
  • Type fixes applied to combobox components

Summary by CodeRabbit

  • Chores

    • Updated TypeScript compiler from 5.9.3 to 6.0.2.
    • Adjusted build/config to add an e2e import alias and related resolution changes.
    • Added type support for importing CSS and font packages.
  • Refactor

    • Improved combobox and form field typings for stronger type safety and more consistent multi-select/null handling.

Update TypeScript from 5.9.3 to 6.0.1-rc with type fixes for combobox components. Extracted ComboboxProps type alias for better type safety and added module declarations for CSS and fonts.

Co-authored-by: Claude <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
start-ui-web-v3 Ready Ready Preview, Comment Mar 23, 2026 6:37pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Bump TypeScript to 6.0.2, introduce/export a ComboboxProps alias and adopt it across Combobox + form components with nullable single-selection handling, add ambient module declarations for CSS and fontsource imports, and adjust tsconfig path aliases (remove baseUrl, add e2e/*).

Changes

Cohort / File(s) Summary
Dependencies
package.json
Bump typescript devDependency from 5.9.36.0.2.
TSConfig / Paths
tsconfig.json
Removed baseUrl; added e2e/* path alias alongside existing @/*.
Ambient Types
src/globals.d.ts
Added ambient module declarations: declare module '*.css';, declare module '@fontsource/*' {}, and declare module '@fontsource-variable/*' {}.
UI: Combobox
src/components/ui/combobox.tsx
Exported new ComboboxProps<Value, Multiple> type alias and switched the Combobox component signature to use it (type-only change).
Form: Combobox (single & multiple)
src/components/form/field-combobox/index.tsx, src/components/form/field-combobox-multiple/index.tsx
Replaced ComponentProps<typeof Combobox> with ComboboxProps<...> generics; FieldCombobox now treats single selection as `TItem

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

enhancement, components

Suggested reviewers

  • ivan-dalmet
  • ntatoud
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: upgrading TypeScript from 5.9.3 to 6.0.2, which is the primary dependency update in package.json.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yoannfleurydev/ts-6-rc-update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/form/field-combobox-multiple/index.tsx (1)

80-83: ⚠️ Potential issue | 🟠 Major

Same type mismatch in onValueChange as the single-select variant.

Similar to FieldCombobox, rest.onValueChange is typed to receive TItem[] but is being called with items?.map((i) => i.value) (an array of raw values). This inconsistency should be addressed in the same way as the single-select component.

🐛 Option: Pass the full items array to match the expected type
        onValueChange={(items: TItem[], event) => {
          field.onChange(items?.map((i) => i.value) ?? [], event);
-          rest.onValueChange?.(items?.map((i) => i.value) ?? [], event);
+          rest.onValueChange?.(items, event);
        }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/form/field-combobox-multiple/index.tsx` around lines 80 - 83,
The onValueChange handler in FieldComboboxMultiple is passing items?.map(i =>
i.value) to rest.onValueChange (and to field.onChange), causing a type mismatch
because rest.onValueChange expects TItem[] while map produces an array of raw
values; fix by passing the full items array to rest.onValueChange (i.e.,
rest.onValueChange?.(items, event)) and only pass the mapped values to
field.onChange if field expects raw values, or alternatively update the prop
typing for rest.onValueChange to accept the value array—adjust the handler
around onValueChange to ensure rest.onValueChange receives TItem[] and
field.onChange receives the expected value shape.
🧹 Nitpick comments (2)
package.json (1)

155-155: TypeScript 6.0.1-rc is a release candidate—evaluate stability requirements.

Using an RC version means the project is exposed to potential instability and breaking changes before the stable release. Verify that using this version is intentional and aligns with the team's risk tolerance. If a stable 6.0.1 release becomes available, consider upgrading.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 155, The package.json currently pins TypeScript to the
release-candidate version "typescript": "6.0.1-rc"; decide whether an RC is
intentional and either replace that entry with the stable published version
(e.g., "typescript": "6.0.1" or the latest stable) or document/approve the RC
usage in the repo policy. Update the package.json dependency value for the
"typescript" key accordingly, run the package manager to refresh lockfiles
(npm/yarn/pnpm install), and run the test/build scripts to verify compatibility;
if you must keep the RC, add a short note in the repo (README or dev docs)
explaining the rationale and risk acceptance.
src/global.d.ts (1)

2-4: Consider removing the redundant declare module '*.css' declaration.

The codebase explicitly imports vite/client types and uses CSS imports with query parameters like ?url (seen in src/routes/__root.tsx:26). The bare declare module '*.css' in src/global.d.ts is unnecessary since vite/client already provides proper typing for CSS modules. With noImplicitAny: true in tsconfig and the code type-checking cleanly without errors, the bare declaration doesn't weaken type safety in practice, but it's redundant. Remove it unless there's a specific reason it was added.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/global.d.ts` around lines 2 - 4, Remove the redundant top-level CSS
module declaration: delete the `declare module '*.css';` entry from
src/global.d.ts so that the project relies on the CSS typings provided by the
imported `vite/client` types; keep the other declarations (`declare module
'@fontsource/*' {}` and `declare module '@fontsource-variable/*' {}`) intact and
ensure no other files rely on the bare `*.css` declaration before committing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/form/field-combobox/index.tsx`:
- Around line 70-73: The onValueChange handler is forwarding only item?.value to
rest.onValueChange but rest.onValueChange expects the full TItem | null (per
ComboboxProps<TItem>), causing a type mismatch; update the handler so
field.onChange still receives item?.value ?? null while rest.onValueChange is
called with the full item and event (i.e. rest.onValueChange?.(item, event));
alternatively, if you intend consumers not to receive the full item, remove
onValueChange from the component props type instead of passing a value-only
argument.

In `@src/global.d.ts`:
- Line 1: Update the top-of-file comment to match the actual filename: replace
the incorrect reference "globals.d.ts" with "global.d.ts" in the comment at the
start of the file (the comment currently reads "// ./src/globals.d.ts"); this
ensures the header comment in src/global.d.ts correctly reflects the file name.

---

Outside diff comments:
In `@src/components/form/field-combobox-multiple/index.tsx`:
- Around line 80-83: The onValueChange handler in FieldComboboxMultiple is
passing items?.map(i => i.value) to rest.onValueChange (and to field.onChange),
causing a type mismatch because rest.onValueChange expects TItem[] while map
produces an array of raw values; fix by passing the full items array to
rest.onValueChange (i.e., rest.onValueChange?.(items, event)) and only pass the
mapped values to field.onChange if field expects raw values, or alternatively
update the prop typing for rest.onValueChange to accept the value array—adjust
the handler around onValueChange to ensure rest.onValueChange receives TItem[]
and field.onChange receives the expected value shape.

---

Nitpick comments:
In `@package.json`:
- Line 155: The package.json currently pins TypeScript to the release-candidate
version "typescript": "6.0.1-rc"; decide whether an RC is intentional and either
replace that entry with the stable published version (e.g., "typescript":
"6.0.1" or the latest stable) or document/approve the RC usage in the repo
policy. Update the package.json dependency value for the "typescript" key
accordingly, run the package manager to refresh lockfiles (npm/yarn/pnpm
install), and run the test/build scripts to verify compatibility; if you must
keep the RC, add a short note in the repo (README or dev docs) explaining the
rationale and risk acceptance.

In `@src/global.d.ts`:
- Around line 2-4: Remove the redundant top-level CSS module declaration: delete
the `declare module '*.css';` entry from src/global.d.ts so that the project
relies on the CSS typings provided by the imported `vite/client` types; keep the
other declarations (`declare module '@fontsource/*' {}` and `declare module
'@fontsource-variable/*' {}`) intact and ensure no other files rely on the bare
`*.css` declaration before committing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0b406244-03d2-4ff8-975f-c5ac4e7ce258

📥 Commits

Reviewing files that changed from the base of the PR and between fd1afaa and f48d851.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • package.json
  • src/components/form/field-combobox-multiple/index.tsx
  • src/components/form/field-combobox/index.tsx
  • src/components/ui/combobox.tsx
  • src/global.d.ts
  • tsconfig.json

Comment thread src/components/form/field-combobox/index.tsx
Comment thread src/global.d.ts Outdated
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
yoannfleurydev and others added 2 commits March 23, 2026 19:06
@sonarqubecloud
Copy link
Copy Markdown

@yoannfleurydev yoannfleurydev changed the title feat: upgrade TypeScript to 6.0.1-rc feat: upgrade TypeScript to 6.0.2 Mar 24, 2026
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.

1 participant