feat(eslint): add prefer-info-text lint rule and migrate existing usages#116211
Conversation
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.59% |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2ae69a3. Configure here.
| 'time', | ||
| 'u', | ||
| ]); | ||
| const TOOLTIP_PROPS_SUPPORTED_BY_INFO_TEXT = new Set(['title', 'showUnderline']); |
There was a problem hiding this comment.
ESLint rule missing position in supported props set
Low Severity
TOOLTIP_PROPS_SUPPORTED_BY_INFO_TEXT doesn't include position, even though InfoText explicitly declares it in its type (Pick<TooltipProps, 'position'>) and forwards it to the underlying Tooltip. This means a <Tooltip title="x" position="left">text</Tooltip> gets flagged as an error but receives no autofix suggestion, despite the conversion being straightforward and safe. Since isHoverable and skipWrapper are also implicitly handled by InfoText, they could be added to both this set and TOOLTIP_PROPS_TO_STRIP.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 2ae69a3. Configure here.


Adds a new
@sentry/scraps/prefer-info-textESLint rule that detects<Tooltip>wrapping text-like elements withshowUnderlineand suggests using<InfoText>instead. The rule ships with an autofix that rewrites simple cases automatically.Alongside the rule, this PR migrates existing violations across the codebase to use
<InfoText>and enhances theInfoTextcomponent itself.InfoTextcomponent enhancementsInfoTextnow accepts apositionprop (forwarded to the underlyingTooltip) and avariantprop that controls the underline color to match the text style (e.g. muted text gets a muted underline).variant="inherit"falls back to the default tooltip underline color.ESLint rule:
prefer-info-textDetects
<Tooltip showUnderline>wrapping a single text-like child (intrinsic elements like<span>,<abbr>,<Text>, or i18n calls) and reports with an autofix that rewrites to<InfoText>. The rule is conservative — it skips Tooltips with unsupported props, multiple children, or non-text content.Codebase migrations
Migrates ~15 files from the manual
<Tooltip showUnderline>pattern to<InfoText>, including spend allocations, customer admin views, replay columns, and various settings pages. Also fixes a tooltip on the detectors assignee view that could never actually display, and updates test files to use<button>instead of<span>for tooltip trigger elements (accessibility).