Skip to content

Update TypeScript to v6 - #6451

Draft
VPS-Obi wants to merge 4 commits into
claude/beautiful-dijkstra-7vuc7ifrom
claude/typescript-6
Draft

VPS-Obi wants to merge 4 commits into
claude/beautiful-dijkstra-7vuc7ifrom
claude/typescript-6

Conversation

@VPS-Obi

@VPS-Obi VPS-Obi commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

TypeScript 6 is the last release before the native TypeScript 7 compiler. It changes several compiler defaults and turns options that stop working in TypeScript 7 into errors. Upgrading now keeps us current and lets us deal with the deprecations one step at a time, instead of all at once with TypeScript 7. We stay on 6.0.x because typescript-eslint doesn't support anything newer yet.

To keep the upgrade itself low risk, the configs switch the new defaults back to the previous behavior instead of changing code: strict stays off where it wasn't enabled explicitly, types: ["*"] keeps including all @types packages, and noUncheckedSideEffectImports stays disabled for CSS imports. The only exception is one story, where TypeScript now infers a narrower type argument, so it uses an explicit type argument, like the tests and Demo already do.

TypeScript no longer infers rootDir from the input files, so the packages whose output layout depends on it set it explicitly. This also moves the default .tsbuildinfo location out of the output directory, where the clean scripts no longer delete it and incremental builds would skip emitting. Therefore, tsBuildInfoFile is pinned back into the output directory.

Instead of silencing the deprecations with ignoreDeprecations, the deprecated options are removed. Dropping baseUrl showed that a few imports only resolved through it, and that they leaked into the published declaration files of @dextinity/admin and @dextinity/cms-api, where consumers can't resolve them and get any instead. These imports are now relative. brevo-api has the same issue, but resolving its imports surfaces type errors in its scope-dependent config callbacks, so it keeps them through an equivalent paths entry for now.

Session: https://claude.ai/code/session_013zxFti9SLHtiSFEDzZy1L3

TypeScript 6 changes several compiler defaults and turns deprecated
options into errors. To keep the current behavior, restore the previous
defaults instead of adapting the code:

- `strict: false` where a config doesn't enable it explicitly
- `types: ["*"]` to keep including all `@types` packages
- `noUncheckedSideEffectImports: false` for CSS side-effect imports
- `ignoreDeprecations: "6.0"` for `baseUrl`, `target: ES5` and
  `moduleResolution: node10`

`rootDir` is no longer inferred from the input files, so set it
explicitly wherever the output layout depends on it. As a result the
default `.tsbuildinfo` location moves out of the output directory,
which the clean scripts delete. Pin `tsBuildInfoFile` into the output
directory so that a clean build still emits.

Allow TypeScript 6 as a peer dependency of the unmaintained `tsconfck`,
which only uses it optionally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013zxFti9SLHtiSFEDzZy1L3
The deprecated options it silenced stop working in TypeScript 7, so
replace them now instead of carrying the escape hatch:

- Remove `baseUrl`, which was only needed to resolve `paths` and a few
  bare `src/...` and `helpers/...` imports. Convert these imports to
  relative ones: they leaked into the published declaration files of
  `@dextinity/admin` and `@dextinity/cms-api`, where consumers can't
  resolve them. brevo-api keeps its `src/...` imports through an
  equivalent `paths` entry, as resolving them surfaces type errors in
  its scope-dependent config callbacks.
- Raise `target: ES5` in demo/site and storybook, which don't emit
  with TypeScript anyway.
- Replace `moduleResolution: node` in the docs ts-node config with
  `bundler`, which TypeScript 6 supports together with CommonJS.
- Update tsconfig-paths in demo/api to v4, as v3 ignores `paths`
  without `baseUrl`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013zxFti9SLHtiSFEDzZy1L3
ts-node compiles with an implicit outDir, so TypeScript 6 requires an
explicit rootDir and otherwise fails with TS5011 when generating the
component docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013zxFti9SLHtiSFEDzZy1L3
@VPS-Obi VPS-Obi changed the title Upgrade TypeScript to v6 and fix import paths in type declarations Update TypeScript to v6 Sep 24, 2026
knip reads each `types` entry of a tsconfig as a package import and
doesn't know TypeScript 6's `"*"` wildcard yet, so it reported the
configs using it as unresolved imports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013zxFti9SLHtiSFEDzZy1L3

This branch has not been deployed

No deployments
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.

2 participants