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

semi rule doesn't check class properties #210

Closed
mikaello opened this issue Mar 27, 2017 · 2 comments
Closed

semi rule doesn't check class properties #210

mikaello opened this issue Mar 27, 2017 · 2 comments

Comments

@mikaello
Copy link

I seems like eslint-plugin-flowtype does not detect props: <PropsObject> or the state / defaultProps Flow annotations inside ES6 classes.

Excerpt from React section in Flow-docs:

type Props = {
  title: string,
  visited: boolean,
  onClick: () => void,
};

class Button extends React.Component {
  props: Props;

  state: {
    display: 'static' | 'hover' | 'active',
  };

  static defaultProps: { visited: boolean };

  /* clipped */
}

.eslintrc

// ...
"flowtype/semi": [2, "never"],
// ...

I get (correct) error on type Props = { ... };, Extra semicolon. (flowtype/semi), but no errors on props: Props; or any of the other Flow annotations inside Button-class.

Is this intentional, or not part of what eslint-plugin-flowtype is supposed to cover?

@danharper danharper changed the title Failing to detect components props, default props and state Flow annotation semi rule doesn't check class properties Mar 27, 2017
@danharper danharper added the bug label Mar 27, 2017
@danharper
Copy link
Collaborator

Yep, this is a bug and not intentional.

@gajus gajus closed this as completed in 6015308 May 26, 2020
@gajus
Copy link
Owner

gajus commented May 26, 2020

🎉 This issue has been resolved in version 5.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants