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 prettier test compat with Babel 8 #14612
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52067/ |
This fixes the E2E breaking prettier test. The remaining failures are fixed by #14592. cc @sosukesuzuki I would love your review, since you know how prettier tests work! Also, I wonder if prettier could format |
Is this a temporary fix? |
No, this is not temporary! JSX text cannot contain |
babel/packages/babel-parser/src/plugins/typescript/index.js Lines 3200 to 3218 in e8c4b78
It seems we can modify this to make it recoverable. Instead of the current behavior SyntaxError: Unexpected token .
|
I opened #14616 to make it recoverable, which is way better. Thanks! 😄 |
This tests contains invalid JSX that is disallowed in Babel 8. https://github.com/prettier/prettier/blob/main/tests/format/typescript/optional-variance/with-jsx.tsx