Repository navigation
fix(core): createConfigItem allows cb as 2nd arg - #18254
Merged
Merged
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/62193 |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The exported TypeScript signature still rejects the newly supported callback-only form.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes the callback-only overload of createConfigItem.
Changes:
- Passes the second argument as the callback.
- Adds regression coverage for this invocation form.
| File | Description |
|---|---|
packages/babel-core/src/config/index.ts |
Corrects callback forwarding. |
packages/babel-core/test/config-loading.js |
Tests the callback-only form. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
commit: |
JLHwung
force-pushed
the
fix-create-config-item-callback
branch
from
September 27, 2026 18:39
1e371b9 to
92ea7f0
Compare
nicolo-ribaudo
approved these changes
Sep 28, 2026
liuxingbaoyu
approved these changes
Sep 28, 2026
JLHwung
force-pushed
the
fix-create-config-item-callback
branch
from
September 28, 2026 18:40
92ea7f0 to
27b697e
Compare
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.

This issue is reported by Copilot code review. Currently,
createConfigItem(plugin, cb)will throwThe current behaviour was introduced since day 1 of the
createConfigItemfunction (#12852). No one has reported since then but I believe this is still a bug and the new behaviour aligns to expectations of other Babel/core APIs.