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-key: detect keys in logical expression and conditional expression #3490


Copy link

Fixes #3481
I've also updated the docs to stay consistent with the comment from below In the last example the key is being spread...

Copy link

codecov bot commented Nov 15, 2022

Codecov Report

Merging #3490 (d350a48) into master (865ed16) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3490   +/-   ##
  Coverage   97.57%   97.57%           
  Files         129      129           
  Lines        9192     9200    +8     
  Branches     3331     3336    +5     
+ Hits         8969     8977    +8     
  Misses        223      223           
Impacted Files Coverage Δ
lib/rules/jsx-key.js 99.15% <100.00%> (+0.06%) ⬆️

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

ljharb approved these changes Nov 16, 2022
Copy link

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

This looks great!

lib/rules/jsx-key.js Outdated Show resolved Hide resolved
@ljharb ljharb force-pushed the jsx-key-fix-logical-and-conditional-expressions branch from b3aac5f to d350a48 Compare November 16, 2022 06:23
@ljharb ljharb changed the title [Fix] jsx-key: detect keys in logical expression and conditional expression [Fix] jsx-key: detect keys in logical expression and conditional expression Nov 16, 2022
@ljharb ljharb merged commit d350a48 into jsx-eslint:master Nov 16, 2022
263 checks passed
ljharb pushed a commit to ljharb/eslint-plugin-react that referenced this pull request Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

react/jsx-key Does not report errors when child is optional
2 participants