Skip to content

Commit fb2fefd

Browse files
authored
Merge pull request #1675 from yuri-sakharov/fix/react-no-unused-prop-types
Fixed "PropType is defined but prop is never used react/no-unused-prop-types"
2 parents 2839b5d + 3d83d13 commit fb2fefd

File tree

2 files changed

+361
-16
lines changed

2 files changed

+361
-16
lines changed

lib/rules/no-unused-prop-types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ module.exports = {
266266
* @return {Boolean} True if the node is inside a lifecycle method
267267
*/
268268
function isInLifeCycleMethod(node) {
269-
if (node.type === 'MethodDefinition' && isNodeALifeCycleMethod(node)) {
269+
if ((node.type === 'MethodDefinition' || node.type === 'Property') && isNodeALifeCycleMethod(node)) {
270270
return true;
271271
}
272272

0 commit comments

Comments
 (0)