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
fix typescript for babel-types #10098
fix typescript for babel-types #10098
Conversation
tanhauhau
commented
Jun 14, 2019
•
edited by JLHwung
edited by JLHwung
Q | A |
---|---|
Fixed Issues? | Fixes #10065, Fixes #10075, Fixes #8375 |
Patch: Bug Fix? | |
Major: Breaking Change? | |
Minor: New Feature? | |
Tests Added + Pass? | Yes |
Documentation PR Link | |
Any Dependency Changes? | |
License | MIT |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10956/ |
43d2917
to
5b83530
Compare
LGTM. I'd obviously prefer Babel used TS over Flow, as it's far more popular, but this PR should fix the issues I've found, at least. Edit: Looking at CI, there's one instance where you put |
5b83530
to
4b39d4b
Compare
Oops, because I copied over from |
4b39d4b
to
6467cd1
Compare
} else { | ||
const functionName = toFunctionName(type); | ||
lines.push( | ||
`declare function _${functionName}(${args.join( |
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.
Maybe this should be export declare function ${type}
? They always start with an uppercase letter (thus are valid identifiers), and it would match https://github.com/babel/babel/blob/6467cd1e27ffe2a3a1cfe97bc8c67b407cb1e7c4/packages/babel-types/src/builders/generated/index.js
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.
no. this is for the edge case of super()
and import()
where you can't export declare function super(): SuperNode;
but instead I made it:
declare function _super(): SuperNode;
declare export { _super as super };
to workaround of not being able to export super
and import
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.
@nicolo-ribaudo what do you think?
CircleCI failure is unrelated. |