eslint-plugin-react icon indicating copy to clipboard operation
eslint-plugin-react copied to clipboard

[Fix] `destructuring-assignment`: Handle destructuring of useContext in SFC

Open ed-jinyoung-park opened this issue 5 years ago • 3 comments

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.

ed-jinyoung-park avatar Sep 16 '20 18:09 ed-jinyoung-park

@Zinyon are you still interested in completing this PR?

ljharb avatar Sep 20 '21 05:09 ljharb

The isDestructuredFromPragmaImport helper might be useful here.

ljharb avatar Sep 20 '21 19:09 ljharb

@ljharb sure, i will look around isDestructuredFromPragmaImport helper and complete PR soon!

ed-jinyoung-park avatar Sep 22 '21 15:09 ed-jinyoung-park

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.

codecov[bot] avatar Dec 27 '22 22:12 codecov[bot]

I went ahead and added the react version dependence; i'll leave "make sure it's destructured from the pragma" as a followup.

ljharb avatar Dec 27 '22 23:12 ljharb