Skip to content

refactor(useButtonType): simplify and some related docs#8994

Merged
dyc3 merged 1 commit intonextfrom
dyc3/use-button-type-tweaks
Feb 8, 2026
Merged

refactor(useButtonType): simplify and some related docs#8994
dyc3 merged 1 commit intonextfrom
dyc3/use-button-type-tweaks

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Feb 8, 2026

Summary

Some trivially minor changes to the rule and related docs. Planning to make a bug fix in a follow up PR, and I don't want these changes to clog up that PR.

No changeset because the rule hasn't been released yet, and its purely a refactor.

Test Plan

snapshots changed only because of adjusted whitespace in the diagnostic.

Docs

@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2026

⚠️ No Changeset found

Latest commit: f36549b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added A-Linter Area: linter A-Parser Area: parser L-HTML Language: HTML and super languages labels Feb 8, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

Walkthrough

Refactors the diagnostic construction in crates/biome_html_analyze/src/lint/a11y/use_button_type.rs to inline the range and conditional message logic (removing intermediate span/message variables). Adds find_attribute_by_name(&self, name_to_lookup: &str) -> Option<HtmlAttribute> to AnyHtmlElement in crates/biome_html_syntax/src/element_ext.rs, performing a case-insensitive attribute lookup across HtmlElement and HtmlSelfClosingElement variants and returning None for variants without attributes.

Possibly related PRs

Suggested reviewers

  • ematipico
  • Netail
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main refactoring work—simplifying the useButtonType diagnostic construction and adjusting related documentation.
Description check ✅ Passed The description clearly explains the motivation (trivial refactoring changes to keep a follow-up bug fix PR clean) and context (no changeset needed), relating directly to the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dyc3/use-button-type-tweaks

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

@dyc3 dyc3 force-pushed the dyc3/use-button-type-tweaks branch from 571f69b to f36549b Compare February 8, 2026 02:25
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 8, 2026

CodSpeed Performance Report

Merging this PR will degrade performance by 8.03%

Comparing dyc3/use-button-type-tweaks (f36549b) with next (b5dd9ce)

Summary

❌ 2 regressed benchmarks
✅ 1 untouched benchmark
🆕 1 new benchmark
⏩ 152 skipped benchmarks1

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

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 html_analyzer[index_1033418810622582172.html] N/A 411.1 µs N/A
index_1033418810622582172.html[uncached] 118.2 µs 128.5 µs -8.03%
index_1033418810622582172.html[cached] 102 µs 110.5 µs -7.67%

Footnotes

  1. 152 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@dyc3 dyc3 merged commit 821c417 into next Feb 8, 2026
16 of 17 checks passed
@dyc3 dyc3 deleted the dyc3/use-button-type-tweaks branch February 8, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter A-Parser Area: parser L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants