-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[preset-typescript] Fix private members type annotations #11315
[preset-typescript] Fix private members type annotations #11315
Conversation
Ignore the CI failure, it is caused by an outdated base branch. |
@@ -325,13 +330,16 @@ export default declare( | |||
// class transform would transform the class, causing more specific | |||
// visitors to not run. | |||
path.get("body.body").forEach(child => { | |||
if (child.isClassMethod()) { | |||
if (child.isClassMethod() || child.isClassPrivateMethod()) { |
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.
Note: this doesn't actually fix anything, but I'm ok with keeping it since we could add new things to the method
handler, which could be also allowed with private methods.
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.
Yes, I left it for consistency and for possible further changes
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.
Thanks!
This PR fixes the bug when typescript transformer leaves type annotations for private properties. It does two main things: