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

feat(analyzer): useAltText don't check object spread #4935

Merged
merged 4 commits into from
Feb 11, 2025
Merged

Conversation

fireairforce
Copy link
Member

Summary

closes: #3977

Ignore the object spread when lint/a11y/useAltText check element's attribute, the following code can pass check:

<img src="test.png" alt={alt} {...restProps}></img>

Test Plan

Add test case

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Jan 21, 2025
@ematipico
Copy link
Member

Thank you, @fireairforce, for taking care of this. As I mentioned in my comment, other rules follow the same logic, and we should update them. Unfortunately, I don't recall all of them, that's why I suggested creating an issue, so we can track them.

Copy link

codspeed-hq bot commented Jan 21, 2025

CodSpeed Performance Report

Merging #4935 will not alter performance

Comparing fix-3977 (4ce3fa2) with next (846e4a4)

Summary

✅ 94 untouched benchmarks

@fireairforce
Copy link
Member Author

ok,I will check in my pr.

@fireairforce
Copy link
Member Author

@ematipico i just check the rules in biome_js_analyze, i don't find any rules except useAltText following the same rule, like

All the rules above can pass the spread object check.

@ematipico
Copy link
Member

Thank you @fireairforce for taking the time to look at that! Sorry for losing precious time of yours, I incorrectly remember that.

@ematipico ematipico merged commit 112d43e into next Feb 11, 2025
11 checks passed
@ematipico ematipico deleted the fix-3977 branch February 11, 2025 09:20
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.

2 participants