This repository has been archived by the owner on Oct 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Select flux dependenices defined in file should be analyzed as well (#21
) The flux dependencies should be considered the same as imports. So you should be notified when you are using selector in other selector or connect without listening on it. close #20
- Loading branch information
Showing
4 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
test/rules/check-unused-flux-dependencies/test.10.tsx.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { show, hide } from 'selectors/some'; | ||
|
||
const superSelect = select([show, hide], () => { | ||
return { | ||
a: show(), | ||
b: hide(), | ||
} | ||
}) | ||
|
||
export default connect([show, hide, superSelect], () => ({ | ||
~~~~~~~~~~~ [The "superSelect" dependency is unused. This has performance impact!] | ||
a: show(), | ||
b: hide(), | ||
}))(component); | ||
|
||
export default connect([show, hide], () => ({ | ||
a: show(), | ||
b: hide(), | ||
b: superSelect() | ||
~~~~~~~~~~~ [You forgot to listen for the "superSelect" dependency!] | ||
}))(component); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { show, hide } from 'selectors/some'; | ||
|
||
const anotherSelect = select([show, hide], () => { | ||
return { | ||
a: show(), | ||
b: hide(), | ||
} | ||
}) | ||
|
||
export default select([anotherSelect], () => { | ||
return { | ||
magic: anotherSelect(), | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { show, hide } from 'selectors/some'; | ||
|
||
const anotherSelect = select([show, hide], () => { | ||
return { | ||
a: show(), | ||
b: hide(), | ||
} | ||
}) | ||
|
||
export default select([], () => { | ||
return { | ||
magic: anotherSelect(), | ||
~~~~~~~~~~~~~ [You forgot to listen for the "anotherSelect" dependency!] | ||
} | ||
}) |