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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class static properties semi #944

Closed
egorovli opened this issue Jul 3, 2017 · 8 comments

Comments

@egorovli
Copy link

commented Jul 3, 2017

Static class properties with trailing semi are not reported as Extra semicolon, example:

class MyComponent extends PureComponent {
  static propTypes = {
    isVisible: PropTypes.bool.isRequired
  }; // <-- right here

  render () {
    return (
      <div />
    )
  }
}
@eddiemonge

This comment has been minimized.

Copy link

commented Jul 3, 2017

But you don't get a complaint about static propTypes?

@egorovli

This comment has been minimized.

Copy link
Author

commented Jul 4, 2017

@eddiemonge no, I've seen your issue; my config of standard in package.json:

"standard": {
  "parser": "babel-eslint"
}

And also I have a .babelrc file in the project root directory:

{
  "presets": [
    "env",
    "react",
    "stage-2"
  ],
  "plugins": [
    "transform-decorators-legacy"
  ]
}

Also, standard is ^10.0.2. Hope that helps.

@RobertPaul01

This comment has been minimized.

Copy link

commented Jul 25, 2017

I have this same issue with the added "parser": "babel-eslint" setting

@feross

This comment has been minimized.

Copy link
Member

commented Apr 26, 2018

Confirmed this is an issue. Unclear what the cause is. If anyone has additional info, please share it!

@stale

This comment has been minimized.

Copy link

commented Jul 25, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jul 25, 2018

@stale stale bot closed this Aug 1, 2018

@eddiemonge

This comment has been minimized.

Copy link

commented Aug 1, 2018

Maybe this should get a label so it isnt auto closed or something

@eddiemonge

This comment has been minimized.

Copy link

commented Oct 19, 2018

@feross can this be reopened? It is still an issue that I just ran across in a new project

@eddiemonge

This comment has been minimized.

Copy link

commented Oct 19, 2018

Nevermind. After tons of research, it appears semicolons are required. The static keyword however is not. https://github.com/tc39/proposal-class-fields

@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 2019

@standard standard unlocked this conversation Aug 5, 2019

@standard standard locked and limited conversation to collaborators Aug 5, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.