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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AST changed in v7.18.9 #14777

Closed
1 task
fisker opened this issue Jul 21, 2022 · 4 comments
Closed
1 task

[Bug]: AST changed in v7.18.9 #14777

fisker opened this issue Jul 21, 2022 · 4 comments
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@fisker
Copy link
Contributor

fisker commented Jul 21, 2022

馃捇

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

new A < B >
C

Configuration file name

No response

Configuration

No response

Current and expected behavior

Not sure when it changed, but after 7.18.5, I'm not familiar with this syntax, not sure what's correct. But Prettier format it different than typescript parser.

// `typescript` parser and older babel
new A() < B > C;
// new 
new A<B>();
C;

I think B is a type parameter now.

Same as @typescript-eslint/eslint-plugin parser?

Environment

N/A

Possible solution

No response

Additional context

Prettier PR prettier/prettier#13065

@babel-bot
Copy link
Collaborator

Hey @fisker! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@JLHwung
Copy link
Contributor

JLHwung commented Jul 21, 2022

The new behaviour is intended: microsoft/TypeScript#49353, Babel aligns to the new behaviour in #14636.

See also the TS playground with TS nightly.

I think we can also add tests/format/typescript to our prettier-e2e tests.

@fisker
Copy link
Contributor Author

fisker commented Jul 21, 2022

Thank you!

@fisker
Copy link
Contributor Author

fisker commented Jul 21, 2022

I think we can also add tests/format/typescript

tests/format/flow tests/format/flow-repo too?

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

3 participants