fix(tsconfig): support TypeScript 7 options#394
Conversation
TypeScript 7 removes the classic `node`/`Node` module resolution and the `esModuleInterop: false` override, which broke every preset except `base` and `astro`. Replace the legacy Node resolution with `bundler` in `commonjs`, `esm`, `nextjs`, and `react`, drop the disallowed `esModuleInterop: false` from `react`, and align enum casing, target/lib levels, and display names across all presets for consistency.
🦋 Changeset detectedLatest commit: c8f070c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
WalkthroughThe TypeScript configuration presets are aligned with TypeScript 7 requirements, including bundler module resolution, updated targets and libraries, normalized casing, revised display names, and removal of React’s ChangesTypeScript configuration updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @mheob/tsconfig@3.0.0 ### Major Changes - [#394](#394) ([@mheob](https://github.com/mheob)): Update all tsconfig presets to work with TypeScript 7. TS7 hard-removes the classic `node`/`Node` module resolution and the `esModuleInterop: false` override, which broke every preset except `base` and `astro`. Replace the legacy Node resolution with `bundler` in `commonjs`, `esm`, `nextjs`, and `react`, drop the disallowed `esModuleInterop: false` from `react`, and align enum casing, target/lib levels, and display names across all presets for consistency.
## Summary Remove the hardcoded `include: ["src"]` that ended up in the `react` preset (`@mheob/tsconfig`) during the TypeScript 7 update. ## Changes - Drop `include: ["src"]` from `packages/tsconfig/react.json`. - Add a `patch` changeset for `@mheob/tsconfig`. ## Motivation Every other preset (`base`, `commonjs`, `esm`, `astro`) leaves `include` unset so consumers control which files get compiled. The `react` preset picked up a stray `src`-only restriction as part of the prior TypeScript 7 fix (#394), which would silently exclude any consumer project that doesn't keep its sources under `src`. This restores the preset to the same extensible behavior as the others.



Summary
Update every
@mheob/tsconfigpreset so it stays valid under TypeScript 7, whose native compilerhard-removes several options the presets relied on.
Changes
node/Nodemodule resolution withbundlerincommonjs.json,esm.json,nextjs.json, andreact.json(base.jsonandastro.jsonalready usedbundler).esModuleInterop: falsefromreact.json— TS7 no longer allows disabling it.target/liblevels toES2023and normalize compiler-option value casing (e.g.esnext,bundler) for consistency across presets.displaynames (base.json,astro.json) and add a missingincludetoreact.json.majorchangeset for@mheob/tsconfigsince consumers relying on the old resolutionbehavior may see different module-resolution results.
Motivation
With
typescript@7installed,tscfailed outright oncommonjs.json,esm.json,nextjs.json,and
react.jsonwithTS5108: Option 'moduleResolution=node10' has been removed(and, forreact.json, the same error foresModuleInterop=false). Every preset now type-checks cleanlyagainst TypeScript 7.
Summary by CodeRabbit
New Features
Breaking Changes