eslint-plugin-react
eslint-plugin-react copied to clipboard
[Fix] `destructuring-assignment`: Handle destructuring of useContext in SFC
i reopen PR on resolve issue - #2309 cause i did a lot of commits while editing.
- add rule of handling destructuring of useContext in SFC
- delete detecting variable named 'context' in SFC
Fixes #2309. Closes #2787.
@Zinyon are you still interested in completing this PR?
The isDestructuredFromPragmaImport helper might be useful here.
@ljharb sure, i will look around isDestructuredFromPragmaImport helper and complete PR soon!
Codecov Report
Merging #2797 (a60f020) into master (a60f020) will not change coverage. The diff coverage is
n/a.
:exclamation: Current head a60f020 differs from pull request most recent head 523db20. Consider uploading reports for the commit 523db20 to get more accurate results
@@ Coverage Diff @@
## master #2797 +/- ##
=======================================
Coverage 97.58% 97.58%
=======================================
Files 130 130
Lines 9223 9223
Branches 3349 3349
=======================================
Hits 9000 9000
Misses 223 223
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
I went ahead and added the react version dependence; i'll leave "make sure it's destructured from the pragma" as a followup.