Skip to content

Commit

Permalink
Uses don't need to be on this
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Apr 23, 2018
1 parent 9361753 commit 06912c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build-system/eslint-rules/unused-private-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ module.exports = function(context) {
}


function shouldCheckMember(node) {
function shouldCheckMember(node, needsThis = true) {
const {computed, object, property} = node;
if (computed ||
object.type !== 'ThisExpression' ||
(needsThis && object.type !== 'ThisExpression') ||
property.type !== 'Identifier') {
return false;
}
Expand Down Expand Up @@ -116,7 +116,7 @@ module.exports = function(context) {

'ClassBody MemberExpression': function(node) {
if (shouldIgnoreFile() ||
!shouldCheckMember(node) ||
!shouldCheckMember(node, false) ||
isAssignment(node)) {
return;
}
Expand Down

0 comments on commit 06912c3

Please sign in to comment.