fix(deps): preserve type-only import elision under babel 8 - #7239
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 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.
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)
Contributor
|
🎉 This PR is included in version 22.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #7238. Babel 8's
preset-typescriptdefaultsonlyRemoveTypeImportstotrue, so it only elidesimport type {...}and stops auto-detecting plainimport {...}of type-only bindings. Found this invendor-portal-x(broke its build with 20+ "module not found" errors) andtsconfigswhile migrating the rest of the ecommerce-squad repos to babel 8 — applying the same fix here defensively, since it depends on which files useimport typevs plainimport.Test plan
npm run build,npm run test(40 suites / 88 tests) still passci/circleci: test) — pending🤖 Generated with Claude Code