-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
fix: provide legacy typings for TS < 4.1 #16638
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: provide legacy typings for TS < 4.1 #16638
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57334 |
|
When I paste https://unpkg.com/@babel/[email protected]/lib/index-legacy.d.ts into TypeScript playground with TS 3.6.3, there are parser errors for // Function implementation is missing or not immediately following the declaration.
export function booleanLiteralTypeAnnotation(value: boolean): BooleanLiteralTypeAnnotation;Same errors with 3.7 or 4.0 I think we should add a test job for legacy typings. |
|
I get no errors -- did you set the language to "TypeScrpt Declaration"? |
Indeed, thanks! Merging it as-is. |
FWIW, Jest uses |
In #16570 we improved the typings for
getBindingIdentifiersvia Key Remapping in Mapped Types, which is a TypeScript 4.1 feature. Note that TypeScript 4.1 was released in November 2020 (almost 4 years ago).As we already provide legacy typings for TS < 3.7, here we bump the legacy typing condition to TS < 4.1. Hopefully this should address the @babel/types type check errors on TS < 4.1.