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): handle ternaries outside jsx expressions #2749

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented May 6, 2024

Summary

This is similar to #2701, in that it now handles ternaries a bit better. Cases like this are now caught:

[].map((item) => {
	return item.condition ? <div /> : <div>foo</div>;
});

related to: #2590

Test Plan

Added snapshot tests

cargo test -p biome_js_analyze use_jsx_key_in_iterable

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels May 6, 2024
Copy link

codspeed-hq bot commented May 6, 2024

CodSpeed Performance Report

Merging #2749 will not alter performance

Comparing dyc3:05-06-fix_lint_usejsxkeyiniterable_handle_ternaries_outside_jsx_expressions (0825077) with main (c269016)

Summary

✅ 85 untouched benchmarks

@ematipico ematipico merged commit ed7509c into biomejs:main May 8, 2024
12 checks passed
@dyc3 dyc3 deleted the 05-06-fix_lint_usejsxkeyiniterable_handle_ternaries_outside_jsx_expressions branch May 8, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants