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

Rule for no optional props without default values? #673

Closed
EdwardDrapkin opened this issue Jul 11, 2016 · 1 comment
Closed

Rule for no optional props without default values? #673

EdwardDrapkin opened this issue Jul 11, 2016 · 1 comment

Comments

@EdwardDrapkin
Copy link

EdwardDrapkin commented Jul 11, 2016

Hello friends,

I was looking for a way to enforce a code quality guideline with eslint and seem to be unable. Basically, we have a bunch of React components that define optional properties. I'd like eslint to guarantee that all non required properties are required to have default values (e.g. if propTypes has a value of foo: React.propTypes.string, defaultProps has to have a key of foo set too). Is this currently possible?

TIA!

@ljharb
Copy link
Member

ljharb commented Jul 11, 2016

This seems like the same as #305, and is definitely a duplicate of #528.

@ljharb ljharb closed this as completed Jul 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants