Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@liuxingbaoyu
Copy link
Member

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

These are issues I encountered when upgrading babel-plugin-react-compiler.

@liuxingbaoyu liuxingbaoyu changed the title fix: type errors for path.is* [Babel 8] fix: Improve traverse types Oct 27, 2025
import { scope as scopeCache } from "../cache.ts";
import type { ExplodedVisitor, Visitor } from "../types.ts";

export type { BindingKind };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Export this type because DefinitelyTyped exports it and it is used by users.

@babel-bot
Copy link
Collaborator

babel-bot commented Oct 27, 2025

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60233

Comment on lines 17 to 25
it("assert", () => {
traverse({} as any, {
Expression(path: NodePath<t.Expression>) {
// @ts-expect-error Assertions require every name in the call target to be declared with an explicit type annotation.
path.assertIdentifier();
expect(path).type.toBe<NodePath<t.Identifier>>();
},
});
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how to fix this, DefinitelyTyped doesn't use the asserts keyword, it just returns void.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 19, 2025

Open in StackBlitz

commit: 97b289e

@nicolo-ribaudo nicolo-ribaudo merged commit 65c4a6b into babel:main Nov 25, 2025
76 checks passed
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.

4 participants