From e74dac5b529bb2dcbe7992567148286b5826fe4f Mon Sep 17 00:00:00 2001 From: Jakub Benes Date: Thu, 9 May 2019 13:20:01 +0200 Subject: [PATCH] Dont treat PropertyAssignments -> Indentifier as Flux Identifier --- src/rules/checkUnusedFluxDependenciesRule.ts | 1 + test/rules/check-unused-flux-dependencies/test.8.tsx.lint | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/rules/checkUnusedFluxDependenciesRule.ts b/src/rules/checkUnusedFluxDependenciesRule.ts index 25517e4..709c515 100644 --- a/src/rules/checkUnusedFluxDependenciesRule.ts +++ b/src/rules/checkUnusedFluxDependenciesRule.ts @@ -160,6 +160,7 @@ class NoUnusedDependenciesWalker extends Lint.RuleWalker { if ( ts.isIdentifier(startNode) && !ts.isTypeReferenceNode(startNode.parent) && + !ts.isPropertyAssignment(startNode.parent) && !ts.isPropertyAccessExpression(startNode.parent) ) { const identifier = startNode.text; diff --git a/test/rules/check-unused-flux-dependencies/test.8.tsx.lint b/test/rules/check-unused-flux-dependencies/test.8.tsx.lint index 5ce9436..07ddb95 100755 --- a/test/rules/check-unused-flux-dependencies/test.8.tsx.lint +++ b/test/rules/check-unused-flux-dependencies/test.8.tsx.lint @@ -12,3 +12,10 @@ export default select([anotherSelect], () => { magic: anotherSelect(), } }) + +export default select([anotherSelect], () => { + return { + show: "must go on", + magic: anotherSelect(), + } +})