-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Babel 8] fix: Improve traverse types
#17574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
path.is*traverse types
| import { scope as scopeCache } from "../cache.ts"; | ||
| import type { ExplodedVisitor, Visitor } from "../types.ts"; | ||
|
|
||
| export type { BindingKind }; |
There was a problem hiding this comment.
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.
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60233 |
| 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>>(); | ||
| }, | ||
| }); | ||
| }); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest checking for open issues first, I'm worried that it's "by design".
57d3038 to
ba68a2c
Compare
|
commit: |
1b042b0 to
97b289e
Compare
Fixes #1, Fixes #2These are issues I encountered when upgrading
babel-plugin-react-compiler.