-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Code clean up #1526
Code clean up #1526
Conversation
Since the oldest supported version of `babel-eslint` (6.x) has the key property on ClassProperty nodes, the workarounds aren't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, thanks!
lib/util/props.js
Outdated
/** | ||
* Checks if the PropTypes MemberExpression node passed in declares a required propType. | ||
* @param {ASTNode} propTypeExpression node to check. Must be a `PropTypes` MemberExpression. | ||
* @returns {Boolean} `true` if this PropType is required, `false` if not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we can remove all these extra spaces; it's not aligned anyways
lib/util/props.js
Outdated
/** | ||
* Checks if the Identifier node passed in looks like a defaultProps declaration. | ||
* @param {ASTNode} node The node to check. Must be an Identifier node. | ||
* @returns {Boolean} `true` if the node is a defaultProps declaration, `false` if not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
This is really great. There's a lot of duplicate code between prop-types and no-unused-prop-types rules that should be extracted out. I think this is a good first step. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thanks so much for the submission.
In the previous times I have made changes, I have noticed some duplication in code and wanted to deduplicate it. I have started that in this PR, and I wanted to open it up for some feedback. Is this desired? Should I go further?