Skip to content

Commit

Permalink
Merge pull request #1502 from SimenB/dupe-assertion
Browse files Browse the repository at this point in the history
Remove duplicate assertion
  • Loading branch information
ljharb committed Oct 27, 2017
2 parents 995b258 + 3260811 commit 329857d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rules/destructuring-assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ module.exports = {

function handleClassUsage(node) {
// this.props.Aprop || this.context.aProp || this.state.aState
const isPropUsed = (node.object.type === 'MemberExpression' && node.object.object.type === 'ThisExpression' &&
(node.object.property.name === 'props' || node.object.property.name === 'context' || node.object.property.name === 'state') &&
node.object.type === 'MemberExpression'
const isPropUsed = (
node.object.type === 'MemberExpression' && node.object.object.type === 'ThisExpression' &&
(node.object.property.name === 'props' || node.object.property.name === 'context' || node.object.property.name === 'state')
);

if (isPropUsed && configuration === 'always') {
Expand Down

0 comments on commit 329857d

Please sign in to comment.