prefer-icon-button-tooltip
Warns when IconButton does not pass the tooltip argument.
Without a tooltip, screen readers like VoiceOver or TalkBack announce only "Button" or read out an unhelpful internal icon glyph code (e.g. "e14c, button").
This violates WCAG SC 4.1.2 because the control lacks an accessible name, rendering the button unusable for blind or low-vision users.
Example
❌ Bad:
// LINT: Tooltip is not specified.
// Try adding it or wrapping this widget into 'ExcludeSemantics'.
IconButton();
// LINT: Tooltip is not specified.
// Try adding it or wrapping this widget into 'ExcludeSemantics'.
IconButton(tooltip: '');
✅ Good:
IconButton(tooltip: 'some tooltip');
ExcludeSemantics(child: IconButton());
Additional Resources
- WCAG SG 1.1.1: Non-text Content (Level A)
- WCAG SG 2.4.6: Headings and Labels (Level AA)
- WCAG SG 4.1.2: Name, Role, Value (Level A)