Skip to content

fix(deps): preserve type-only import elision under babel 8 - #7239

Merged
hevele-moda merged 1 commit into
mainfrom
fix/preset-typescript-elision
Sep 17, 2026
Merged

hevele-moda merged 1 commit into
mainfrom
fix/preset-typescript-elision

Conversation

@hevele-moda

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #7238. Babel 8's preset-typescript defaults onlyRemoveTypeImports to true, so it only elides import type {...} and stops auto-detecting plain import {...} of type-only bindings. Found this in vendor-portal-x (broke its build with 20+ "module not found" errors) and tsconfigs while migrating the rest of the ecommerce-squad repos to babel 8 — applying the same fix here defensively, since it depends on which files use import type vs plain import.

Test plan

  • npm run build, npm run test (40 suites / 88 tests) still pass
  • CI (ci/circleci: test) — pending

🤖 Generated with Claude Code

Babel 8's preset-typescript defaults onlyRemoveTypeImports to true,
so it only elides `import type {...}` and stops auto-detecting plain
`import {...}` of type-only bindings. Files that import purely-typed
bindings without the `type` keyword would otherwise get those
imports left in the compiled output, breaking module resolution for
any import pointing at a type-only module.

Found and verified in ModaOperandi/tsconfigs#271 and
ModaOperandi/vendor-portal-x#3455. Applying the same fix here
defensively even though this repo's build didn't hit the failure
mode, since it depends on which files use `import type` vs plain
`import` for type-only bindings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 17, 2026 15:02
@hevele-moda
hevele-moda requested a review from a team as a code owner September 17, 2026 15:02

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.

🟢 Approval recommended

The focused configuration change correctly preserves prior compilation behavior.

Pull request overview

Preserves Babel 7-style type-only import elision after the Babel 8 upgrade.

Changes:

  • Explicitly sets onlyRemoveTypeImports: false.
  • Documents the Babel 8 default behavior.
File summaries
File Description
babel.config.js Restores automatic elision of plain type-only imports.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced (auto)

Note

Copilot is running an experiment and ran this review at Balanced.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@hevele-moda
hevele-moda merged commit 88c63ec into main Sep 17, 2026
4 checks passed
@hevele-moda
hevele-moda deleted the fix/preset-typescript-elision branch September 17, 2026 15:17
moda-automation-devops pushed a commit that referenced this pull request Sep 17, 2026
## [22.0.1](22.0.0...22.0.1) (2026-09-17)

### Bug Fixes

* **deps:** preserve type-only import elision under babel 8 ([#7239](#7239)) ([88c63ec](88c63ec)), closes [ModaOperandi/tsconfigs#271](https://github.com/ModaOperandi/tsconfigs/issues/271)
@moda-automation-ci

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 22.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants