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(lint/useJsxKeyInIterable): fix a false positive when key is in parenthesized return statement #3205

Merged
merged 3 commits into from
Jun 14, 2024

Conversation

unvalley
Copy link
Member

Summary

Closes #3084 by fixing the cast when the returned component is parenthesized.

[].map((el) => {
  const content = <p>Paragraph</p>
  return (<div key={el}>{content}</div>); // will cast successfully
});

Test Plan

Added a snapshot case.

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels Jun 13, 2024
Copy link

codspeed-hq bot commented Jun 13, 2024

CodSpeed Performance Report

Merging #3205 will not alter performance

Comparing unvalley:fix-use-jsx-key-in-iterable (f1c7601) with main (9e8addd)

Summary

✅ 90 untouched benchmarks

@unvalley unvalley merged commit b70f405 into biomejs:main Jun 14, 2024
12 checks passed
@unvalley unvalley deleted the fix-use-jsx-key-in-iterable branch June 14, 2024 03:23
@Sec-ant Sec-ant linked an issue Jun 15, 2024 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Linter Area: linter L-JavaScript Language: JavaScript and super languages
Projects
None yet
2 participants