@@ -5,7 +5,7 @@ const isReactReduxConnect = require('../isReactReduxConnect');
5
5
6
6
const noUnusedPropTypesReact = require ( 'eslint-plugin-react' ) . rules [ 'no-unused-prop-types' ] ;
7
7
8
- const belongsToReduxReact = ( node , objectName , destrArg ) => {
8
+ const belongsToReduxReact = ( node , objectName , destrArg , context ) => {
9
9
const checkProp = ( secondArgument ) => {
10
10
const secondArgumentName = secondArgument && secondArgument . type === 'Identifier' && secondArgument . name ;
11
11
return ( secondArgumentName === objectName // ownProps.myProp
@@ -57,14 +57,14 @@ const propsUsedInRedux = function (context) {
57
57
MemberExpression ( node ) {
58
58
const nodeName = node . object . name ;
59
59
const usedInReactRedux = context . getSourceCode ( ) . getAncestors ( node )
60
- . some ( ancestor => belongsToReduxReact ( ancestor , nodeName ) ) ;
60
+ . some ( ancestor => belongsToReduxReact ( ancestor , nodeName , null , context ) ) ;
61
61
if ( usedInReactRedux ) {
62
62
context . report ( node , `exclude:${ node . property . name } ` ) ;
63
63
}
64
64
} ,
65
65
ObjectPattern ( node ) {
66
66
const usedInReactRedux = context . getSourceCode ( ) . getAncestors ( node )
67
- . some ( ancestor => belongsToReduxReact ( ancestor , null , node ) ) ;
67
+ . some ( ancestor => belongsToReduxReact ( ancestor , null , node , context ) ) ;
68
68
if ( usedInReactRedux ) {
69
69
node . properties . forEach ( ( prop ) => {
70
70
if ( prop . type === 'Property' && prop . key && prop . key . name ) {
0 commit comments