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 the return statement, but not any variable declarations #3031

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented May 31, 2024

Summary

This PR fixes a false positive where the rule would flag variable declaration statements even if the return statement had a component with the key prop set.

fixes #3020

Test Plan

Added snapshot test

…e return statement, but not any variable declarations
@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels May 31, 2024
Copy link

codspeed-hq bot commented May 31, 2024

CodSpeed Performance Report

Merging #3031 will degrade performances by 6.04%

Comparing dyc3:05-31-fix_lint_usejsxkeyiniterable_fix_a_false_positive_when_key_is_in_the_return_statement_but_not_any_variable_declarations (9f2def5) with dyc3:05-31-fix_lint_usejsxkeyiniterable_fix_a_false_positive_when_key_is_in_the_return_statement_but_not_any_variable_declarations (b3f9a2d)

Summary

❌ 1 regressions
✅ 91 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark dyc3:05-31-fix_lint_usejsxkeyiniterable_fix_a_false_positive_when_key_is_in_the_return_statement_but_not_any_variable_declarations dyc3:05-31-fix_lint_usejsxkeyiniterable_fix_a_false_positive_when_key_is_in_the_return_statement_but_not_any_variable_declarations Change
dojo.js[cached] 8 ms 8.5 ms -6.04%

@ematipico
Copy link
Member

Are the names of your branches automatically generated? They are very long! 😆

Copy link
Contributor

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

looks good after applying @ematipico's recommendation

@dyc3
Copy link
Contributor Author

dyc3 commented May 31, 2024

Are the names of your branches automatically generated? They are very long! 😆

Yeah. I use graphite on my end to stack branches. It helps keep my PRs smaller (in general) to make it easier to review them, without necessarily having to wait for reviews to continue working on stuff.

@ematipico ematipico merged commit 71fe04e into biomejs:main Jun 1, 2024
11 checks passed
@dyc3 dyc3 deleted the 05-31-fix_lint_usejsxkeyiniterable_fix_a_false_positive_when_key_is_in_the_return_statement_but_not_any_variable_declarations branch June 1, 2024 14:10
@Conaclos Conaclos added the A-Changelog Area: changelog label Sep 10, 2024
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
Development

Successfully merging this pull request may close these issues.

💅 useJsxKeyInIterable shows warning even key is specified
4 participants