-
-
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
retainLines
breaks no LineTerminator
requirements in single-arg async arrows and decorated methods
#7275
Comments
The latest version of Jest is supposed to have source map support; maybe babel-jest can be fixed to use that instead and we can finally get rid of |
Maybe. Basically all I ever knew was "something in Facebook relies on it". Was that specifically Jest? Maybe @kittens would know? |
Hey, is it related to jestjs/jest#5326 ? |
Opened up a PR in Jest removing I have no idea if other parts of FB requires it, though |
Summary: - Node 7.9.x has a stable native async/await implementation, so we can drop those transforms. - Unfortunately `retainLines` has a bug where it incorrectly splits lines with `async`, so I had to disable it :( babel/babel#7275 - The "use strict" transform isn't necessary as it's automatically done by the inline-imports transform. Reviewed By: zertosh, aaronabramov Differential Revision: D7864751 fbshipit-source-id: 7bf92ef5397d563d4e646af8e29445ee4849a518
Summary: - Node 7.9.x has a stable native async/await implementation, so we can drop those transforms. - Unfortunately `retainLines` has a bug where it incorrectly splits lines with `async`, so I had to disable it :( babel/babel#7275 - The "use strict" transform isn't necessary as it's automatically done by the inline-imports transform. Reviewed By: zertosh, aaronabramov Differential Revision: D7864751 fbshipit-source-id: 7bf92ef5397d563d4e646af8e29445ee4849a518
Jest has now removed all its usage of |
retainLines
breaks no LineTerminator
requirements in single-arg async arrowsretainLines
breaks no LineTerminator
requirements in single-arg async arrows and decorated methods
with
retainLines: true
becomeswhich is a syntax error since
async
andarg
need to be on the same line when there aren't parens.We need to detect that
retainLines
is enabled, and that the identifier will insert new lines, and if so, wrap parens around the argument. We've got some existing logic in place for noLineTerminator but I don't think it would apply very well to this case. :(Edit: A second example of this issue can also be found in #8650, so if we fix this issue, we should fix that one at the same time.
The text was updated successfully, but these errors were encountered: