x-tooltip is the target of the codemod's largest and only auto-fixable rule, and it does nothing at runtime. The attribute reaches the DOM, no runtime is ever installed, so no tooltip appears.
Found while migrating a downstream tree's 169 tooltip findings. Reverted the migration rather than land it, because every site would have been a no-op.
The chain
builtins/tooltip.js defines the runtime and it looks complete: creates #stx-tooltip, positions with flip handling, wires the listeners.
builtins/index.js:9 re-exports it:
export { getTooltipRuntime } from "./tooltip.js"and that is the last thing that ever mentions it.
$ grep -rn "getTooltipRuntime" node_modules/@stacksjs/stx/dist node_modules/bun-plugin-stx/dist
dist/builtins/tooltip.js:1:export function getTooltipRuntime() {
dist/builtins/index.js:9:export { getTooltipRuntime } from "./tooltip.js";Two definitions, zero call sites, in stx and in bun-plugin-stx.
registerBuiltins() registers ten builtins and tooltip is not one of them:
export function registerBuiltins() {
registry.registerBuiltin(StxLinkBuiltin)
registry.registerBuiltin(StxImageBuiltin)
registry.registerBuiltin(SafeImageBuiltin)
registry.registerBuiltin(StxLoadingIndicatorBuiltin)
registry.registerBuiltin(StxToastBuiltin)
registry.registerBuiltin(StxModalBuiltin)
registry.registerBuiltin(StxDrawerBuiltin)
registry.registerBuiltin(IconBuiltin)
registry.registerBuiltin(SuspenseBuiltin)
registry.registerBuiltin(TransitionGroupBuiltin)
}Reproduction
<!-- pages/index.stx -->
<div class="p-10">
<button x-tooltip="Bold" title="Bold">B</button>
<a href="#" x-tooltip="View errors" title="View errors">errors</a>
</div>$ stx build --pages pages --out out --no-minify
$ grep -o 'x-tooltip="[^"]*"' out/index.html
x-tooltip="Bold"
x-tooltip="View errors"
$ grep -c 'stx-tooltip\|getTooltipRuntime' out/index.html
0The attributes are preserved. Nothing that would act on them is emitted. Hovering shows only the native title tooltip, which is what would have shown anyway.
Note the .stx-tooltip CSS and #stx-tooltips teleport target that also appear in cli.js belong to the separate @tooltip directive (<span class="stx-tooltip" data-tooltip="…">), not to this attribute. Two different features with similar names; only the directive one is wired.
Why this matters more than an unused export
codemod.d.ts already records the symptom without connecting it to the cause:
stxConfirmandx-tooltipwere both delivered and used zero times.
That was read as an adoption problem, and the tooltip rule exists to drive adoption. But x-tooltip has zero uses because it has never worked. The codemod is currently pointing every title= in every consuming codebase at a dead attribute, and it is the highest-count rule by an order of magnitude.
The damage is bounded, and worth stating plainly: the rewrite is additive and keeps title, so nobody who ran --fix broke anything or lost the native tooltip or the screen-reader announcement. They just got no styled tooltip and no error explaining why.
Two smaller things found alongside
--fix is correctly idempotent and I want that on the record, since I initially misread the report output as a re-offer. A site that already has the attribute is moved to a separate bucket rather than double-inserted:
Needs a human — 1 site(s):
B.stx:1 [tooltip] <button x-tooltip="Bold" title="Bold">B</button>
already has x-tooltipuseClipboard and useShare are not in STX_RUNTIME_GLOBALS. The clipboard rule tells you to "use useClipboard() / useShare()", and both are implemented (browser-composables.js, composables/use-share.js), but neither is in the injected-globals list, so following the advice verbatim in an .stx script block yields a ReferenceError. The other six names the codemod recommends (useDebounce, useThrottle, useFetch, useAsyncData, useClickOutside, useSearchParams) are all in the list. Either the globals list is missing two entries or the rule message needs to mention the import.
Suggested fix
Register the tooltip runtime the way the other builtins are registered, or emit getTooltipRuntime() into the page whenever a compiled template contains an x-tooltip attribute. Until then the tooltip rule is recommending a no-op, and it might be worth gating it behind that.
Found with stx 0.2.171.