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): flag jsx in variable declarations #2803

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented May 10, 2024

Summary

The rule will now catch snippets like below:

// invalid
[].map((item) => {
	const div = <div>{item}</div>;
	return div;
});

fully resolves #2590

Test Plan

Added more 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 10, 2024
Copy link

codspeed-hq bot commented May 10, 2024

CodSpeed Performance Report

Merging #2803 will not alter performance

Comparing dyc3:05-06-fix_lint_usejsxkeyiniterable_flag_jsx_in_variable_declarations (3931156) with main (7245146)

Summary

✅ 97 untouched benchmarks

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Awesome! Just left some comments to polish the code, but the logic looks good

@ematipico
Copy link
Member

I forgot to submit the comments... -.- hold on

@dyc3 dyc3 force-pushed the 05-06-fix_lint_usejsxkeyiniterable_flag_jsx_in_variable_declarations branch from 86f230f to 0fb63bb Compare May 10, 2024 15:46
@dyc3 dyc3 requested a review from ematipico May 10, 2024 15:46
@dyc3 dyc3 force-pushed the 05-06-fix_lint_usejsxkeyiniterable_flag_jsx_in_variable_declarations branch from 0fb63bb to 3931156 Compare May 10, 2024 16:29
@ematipico ematipico merged commit 50c270e into biomejs:main May 11, 2024
12 checks passed
@dyc3 dyc3 deleted the 05-06-fix_lint_usejsxkeyiniterable_flag_jsx_in_variable_declarations branch May 11, 2024 10:44
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.

💅 useJsxKeyInIterable bugs
2 participants