-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Perform ASI for class properties #1682
Comments
I think an earlier version of the class properties proposal required semicolons, but I believe updated versions allow for automatic semicolon insertion. You still need to be careful about starting a line with Kicking this over to Jeff, since he's the authority on this proposal. Thanks, Jeff! |
Yep, you are right, but this is easily forced by linting (and it's not that common). P.S.: Thanks, the title sounds definitely better now. |
Semicolons are good for your health. |
Hello there! The following snippet works: /** @flow */
import React, { Component } from 'react'
import { View } from 'react-native'
export default class Test extends Component {
_testFunction = () => {
return null
}; // !!!
render (): ReactElement {
return <View />
}
} The following snippet returns /** @flow */
import React, { Component } from 'react'
import { View } from 'react-native'
export default class Test extends Component {
_testFunction = () => {
return null
}
render (): ReactElement {
return <View />
}
} Thank you again guys, have a nice day |
Ah. My Commit was only for Class Properties. Not in general. |
@marudor ouch, thank you anyway |
Summary: tests arrow functions followed by an implicit semicolon this was an example included in #1682 that I didn't add a test for Reviewed By: gabelevi Differential Revision: D3415236 fbshipit-source-id: 93220d910b8bacb6dc7d0da5b5451fea755a602f
FYI it works fine now on :) |
Hello there,
it seems that semicolons are required by Flow for class methods and variables (#825 , #1517) and maybe even in other statements.
Is there any plan for dropping the need of semicolons in the future?
Babel doesn't need them (it has already been discussed in the past) and unfortunately semicolons clash with StandardJS and other common standards/linter configs.
Thank you in advance.
The text was updated successfully, but these errors were encountered: