The tooltip rule treats every title="…" as an HTML attribute. On a component invocation, title is usually a prop, and --fix rewrites it anyway — producing x-tooltip on a component, which is the exact construct #1830 was filed about.
Repro
A component that declares title as a prop and renders it as heading text:
<!-- ValueCard.stx -->
<script server>
interface ValueCardProps {
icon: string
title: string
description: string
}
const { icon, title, description } = withDefaults(defineProps<ValueCardProps>(), {})
</script>
<template>
<div class="p-6">
<h3 class="mt-5 font-semibold">{{ title }}</h3>
<p class="mt-2 text-sm">{{ description }}</p>
</div>
</template>There is no title= attribute anywhere in that component.
Call site before:
<ValueCard icon="source-code" title="MIT licensed" description="Read every line, fork it, and ship your own." />After stx codemod --fix:
<ValueCard icon="source-code" x-tooltip="MIT licensed" title="MIT licensed" description="Read every line, fork it, and ship your own." />Why this is wrong three times over
The rule's stated premise does not hold. The docblock justifies keeping
titlebecause "title=is announced by screen readers" and dropping it would "remove the accessible description". Heretitleis a prop rendered into an<h3>— there is no native tooltip and no accessible description to preserve. Nothing is being migrated; a second thing is being invented.It produces the construct from #1830 —
x-tooltipon a component, rewritten to:tooltipand evaluated as an expression. The autofix now generates it.The result duplicates visible text. The card's own heading reappears as a tooltip on hover.
Scale
In one app, 3 of 14 tooltip findings were component props (<ValueCard title=…>); the other 11 were genuine <a>/<button> elements where the rule is correct and useful. So this is not "mute the rule" — it is one missing guard.
Suggested fix
Skip the rewrite when the tag name is a component rather than a known HTML element — the capitalised-first-letter convention already distinguishes them, same test the compiler uses to resolve <ValueCard> against a component file. Lowercase tags keep current behaviour.
Reporting these sites is still reasonable; it is only --fix that should hold off, in the same spirit as the confirm rule's "needs a human" bucket.