-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Restore @babel/types
support for old TS versions
#12521
Restore @babel/types
support for old TS versions
#12521
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/35653/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit a8143af:
|
might be a bit more light weight option to try - would it fix the problem if we just add |
Oh that's a good idea |
just tried it locally with typescript 3.1 - it works 😄 |
Updated to use |
"<3.7": { | ||
"lib/index.d.ts": [ | ||
"lib/index-ts3.7.d.ts" | ||
">=3.7": { |
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.
should this be <
?
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: types
points to the index-legacy.d.ts
file for old TS versions. For new TS versions, (>= 3.7), we remap it back to index.d.ts
.
This PR swaps
lib/index.d.ts
andlib/index-ts3.7.d.ts
in@babel/types
. By doning so, older TS version that don't support thetypesVersion
option inpackage.json
(it has been introduced in 3.1, but it seems not to work correctly in 3.2) will still get a working.d.ts
file.