Skip to content
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 TS types for AST nodes #5175

Merged
merged 2 commits into from
Jul 12, 2022
Merged

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Jul 11, 2022

Description:

This PR fixes various inaccuracies in the TS type definitions for AST nodes. They seem to have got out of sync over time.

These discrepancies were identified programmatically based on the model of the Rust types I've made for #2175. So this PR should be definitive and bring the TS types completely up to date.

NB Some of the changes just re-order fields and enum options. This doesn't make a difference to correctness of the types. But now they're all consistent with field order in the Rust types, which will maybe make it easier to spot when further changes are required in future.

Related issue (if exists):

n/a

@kdy1 kdy1 added this to the Planned milestone Jul 11, 2022
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

CI failed

@overlookmotel
Copy link
Contributor Author

Yes, the types are now correct, but their usage in node-swc/src/Visitor.ts is now wrong!

@overlookmotel
Copy link
Contributor Author

I've made changes to Visitor.ts to use the updated types, so TS check now passes.

There are likely a lot of inaccuracies remaining in Visitor.ts, but I'll try to fix them another time. At least the types are correct now.

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Thank you!


swc-bump:

  • ''

@kdy1 kdy1 merged commit afd5171 into swc-project:main Jul 12, 2022
@kdy1 kdy1 modified the milestones: Planned, v1.2.213 Jul 13, 2022
GiveMe-A-Name pushed a commit to GiveMe-A-Name/swc that referenced this pull request Jul 23, 2022
@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants