You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: