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

"'propTypes' is already defined" #561

Closed
agilgur5 opened this issue Jul 8, 2016 · 2 comments

Comments

@agilgur5
Copy link

commented Jul 8, 2016

I happen to have a file with two classes in it:

class MyClass1 extends Component {
 static propTypes = { ... }
 ...
}

class MyClass2 extends Component {
  static propTypes = { ... }
  ...
}

and standard is throwing "'propTypes' is already defined" on the second declaration, even though they're only defined within the scope of the class, not globally, so this seems like a bug to me

Not 100% sure which dependency/rule may be causing this
Edit: seems like this occurs for any file with multiple classes in it that have static properties with the same name (like propTypes)

@dcousens dcousens added the bug label Jul 11, 2016

@dcousens

This comment has been minimized.

Copy link
Member

commented Jul 11, 2016

Sounds like eslint?

@agilgur5

This comment has been minimized.

Copy link
Author

commented Jul 12, 2016

Seems like it wasn't eslint (eslint/eslint#6635), but a regression in babel-eslint (babel/babel-eslint#337) that was fixed 2 days ago with 6.1.2; so not a direct dependency

@agilgur5 agilgur5 closed this Jul 12, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

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