feat: enable type-aware no-floating-promises rule, fix all 177 violations (#22741)

This commit is contained in:
Kit Langton
2026-04-15 23:27:32 -04:00
committed by GitHub
parent 343a564183
commit 80f1f1b5b8
103 changed files with 212 additions and 187 deletions

View File

@@ -100,7 +100,7 @@ export function BasicTool(props: BasicToolProps) {
if (isOpen) {
contentRef.style.overflow = "hidden"
heightAnim = animate(contentRef, { height: "auto" }, SPRING)
heightAnim.finished.then(() => {
void heightAnim.finished.then(() => {
if (!contentRef || !open()) return
contentRef.style.overflow = "visible"
contentRef.style.height = "auto"

View File

@@ -107,7 +107,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
// Force a refetch even if the value is unchanged.
// This is important for programmatic changes like Tab completion.
if (prev === value) {
refetch()
void refetch()
return
}
queueMicrotask(() => refetch())

View File

@@ -1158,7 +1158,7 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp
onMouseDown={(e) => e.preventDefault()}
onClick={(event) => {
event.stopPropagation()
handleCopy()
void handleCopy()
}}
aria-label={copied() ? i18n.t("ui.message.copied") : i18n.t("ui.message.copyMessage")}
/>

View File

@@ -6,7 +6,8 @@ import { IconButton } from "./icon-button"
import { Tooltip } from "./tooltip"
export interface TextFieldProps
extends ComponentProps<typeof Kobalte.Input>,
extends
ComponentProps<typeof Kobalte.Input>,
Partial<
Pick<
ComponentProps<typeof Kobalte>,
@@ -75,7 +76,7 @@ export function TextField(props: TextFieldProps) {
}
function handleClick() {
if (local.copyable) handleCopy()
if (local.copyable) void handleCopy()
}
return (

View File

@@ -102,7 +102,7 @@ export function TextReveal(props: {
requestAnimationFrame(() => setState("ready", true))
return
}
fonts.ready.finally(() => {
void fonts.ready.finally(() => {
widen(win())
requestAnimationFrame(() => setState("ready", true))
})

View File

@@ -442,7 +442,7 @@ function AnimatedHeading(props) {
onMount(() => {
measure()
document.fonts?.ready.finally(() => {
void document.fonts?.ready.finally(() => {
measure()
requestAnimationFrame(() => setState("ready", true))
})

View File

@@ -128,7 +128,7 @@ export function ToolErrorCard(props: ToolErrorCardProps) {
onMouseDown={(e) => e.preventDefault()}
onClick={(e) => {
e.stopPropagation()
copy()
void copy()
}}
aria-label={copied() ? i18n.t("ui.message.copied") : i18n.t("ui.toolErrorCard.copyError")}
/>

View File

@@ -86,7 +86,7 @@ export function ToolStatusTitle(props: {
finish()
return
}
fonts.ready.finally(() => {
void fonts.ready.finally(() => {
measure()
finish()
})

View File

@@ -25,7 +25,7 @@ function createPool(lineDiffType: "none" | "word-alt") {
},
)
pool.initialize()
void pool.initialize()
return pool
}