Skip to content

Commit

Permalink
Merge pull request #1675 from yuri-sakharov/fix/react-no-unused-prop-…
Browse files Browse the repository at this point in the history
…types

Fixed "PropType is defined but prop is never used  react/no-unused-prop-types"
  • Loading branch information
ljharb authored Feb 6, 2018
2 parents 2839b5d + 3d83d13 commit fb2fefd
Show file tree
Hide file tree
Showing 2 changed files with 361 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/rules/no-unused-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ module.exports = {
* @return {Boolean} True if the node is inside a lifecycle method
*/
function isInLifeCycleMethod(node) {
if (node.type === 'MethodDefinition' && isNodeALifeCycleMethod(node)) {
if ((node.type === 'MethodDefinition' || node.type === 'Property') && isNodeALifeCycleMethod(node)) {
return true;
}

Expand Down
Loading

0 comments on commit fb2fefd

Please sign in to comment.