Skip to content

Commit

Permalink
[Fix] first attempt to fix no-access-state-in-setstate
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 3, 2018
1 parent 6f2ac7a commit d0f6675
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rules/no-access-state-in-setstate.js
Expand Up @@ -5,6 +5,7 @@

'use strict';

const Components = require('../util/Components');
const docsUrl = require('../util/docsUrl');

// ------------------------------------------------------------------------------
Expand All @@ -21,7 +22,7 @@ module.exports = {
}
},

create: function(context) {
create: Components.detect(context => {
function isSetStateCall(node) {
return node.type === 'CallExpression' &&
node.callee.property &&
Expand Down Expand Up @@ -168,5 +169,5 @@ module.exports = {
});
}
};
}
})
};

0 comments on commit d0f6675

Please sign in to comment.