Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] jsx-no-constructed-context-values: fix false positive for usage in non-components #3448

Merged
merged 1 commit into from Oct 3, 2022

Conversation

golopot
Copy link
Contributor

@golopot golopot commented Oct 3, 2022

Fixes #3295

@codecov
Copy link

codecov bot commented Oct 3, 2022

Codecov Report

Merging #3448 (d0da6bf) into master (645966a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3448   +/-   ##
=======================================
  Coverage   97.62%   97.62%           
=======================================
  Files         123      123           
  Lines        8974     8976    +2     
  Branches     3278     3279    +1     
=======================================
+ Hits         8761     8763    +2     
  Misses        213      213           
Impacted Files Coverage Δ
lib/rules/jsx-no-constructed-context-values.js 93.26% <100.00%> (+0.13%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@golopot golopot force-pushed the fix-3295 branch 2 times, most recently from 56c2b73 to 6f12ee6 Compare October 3, 2022 18:26
code: '<Context.Provider value="Some string"></Context.Provider>',
code: 'const Component = () => <Context.Provider value="Some string"></Context.Provider>',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presumably all of these existing test cases would still pass with this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I change it because otherwise these test cases would pass because they are not in components, not because other any reason which is supposed to be tested.

@ljharb ljharb merged commit d0da6bf into jsx-eslint:master Oct 3, 2022
@ljharb ljharb added the hacktoberfest-accepted If you're interested in a free shirt, this PR counts towards it. label Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted If you're interested in a free shirt, this PR counts towards it.
Development

Successfully merging this pull request may close these issues.

jsx-no-constructed-context-values: class instance false positive
2 participants