We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b457375 commit 5d9d6f2Copy full SHA for 5d9d6f2
lib/rules/no-unused-prop-types.js
@@ -66,7 +66,14 @@ const propsUsedInRedux = function (context) {
66
const usedInReactRedux = context.getAncestors()
67
.some(ancestor => belongsToReduxReact(ancestor, null, node));
68
if (usedInReactRedux) {
69
- node.properties.forEach(prop => context.report(node, `exclude:${prop.key.name}`));
+ node.properties.forEach((prop) => {
70
+ if (prop.type === 'Property' && prop.key && prop.key.name) {
71
+ return context.report(node, `exclude:${prop.key.name}`);
72
+ } else if (prop.type === 'ExperimentalRestProperty' && prop.argument && prop.argument.name) {
73
+ return context.report(node, `exclude:${prop.argument.name}`);
74
+ }
75
+ return undefined;
76
+ });
77
}
78
},
79
};
0 commit comments