Skip to content

Commit 80f1f1b

Browse files
authored
feat: enable type-aware no-floating-promises rule, fix all 177 violations (#22741)
1 parent 343a564 commit 80f1f1b

103 files changed

Lines changed: 212 additions & 187 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.oxlintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
// postMessage target origin not relevant for this codebase
3131
"unicorn/require-post-message-target-origin": "off",
3232
// Side-effectful constructors are intentional in some places
33-
"no-new": "off"
33+
"no-new": "off",
34+
35+
// Type-aware: catch unhandled promises
36+
"typescript/no-floating-promises": "warn"
37+
},
38+
"options": {
39+
"typeAware": true
3440
},
3541
"ignorePatterns": ["**/node_modules", "**/dist", "**/.build", "**/.sst", "**/*.d.ts"]
3642
}

bun.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ async function subscribeSessionEvents() {
513513
const decoder = new TextDecoder()
514514

515515
let text = ""
516-
;(async () => {
516+
void (async () => {
517517
while (true) {
518518
try {
519519
const { done, value } = await reader.read()

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"glob": "13.0.5",
8888
"husky": "9.1.7",
8989
"oxlint": "1.60.0",
90+
"oxlint-tsgolint": "0.21.0",
9091
"prettier": "3.6.2",
9192
"semver": "^7.6.0",
9293
"sst": "3.18.10",

packages/app/src/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ function ConnectionGate(props: ParentProps<{ disableHealthCheck?: boolean }>) {
197197
fallback={
198198
<ConnectionError
199199
onRetry={() => {
200-
if (checkMode() === "background") healthCheckActions.refetch()
200+
if (checkMode() === "background") void healthCheckActions.refetch()
201201
}}
202202
onServerSelected={(key) => {
203203
setCheckMode("blocking")
204204
server.setActive(key)
205-
healthCheckActions.refetch()
205+
void healthCheckActions.refetch()
206206
}}
207207
/>
208208
}

packages/app/src/components/dialog-connect-provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export function DialogConnectProvider(props: { provider: string }) {
327327
if (loading()) return
328328
if (methods().length === 1) {
329329
auto = true
330-
selectMethod(0)
330+
void selectMethod(0)
331331
}
332332
})
333333

@@ -373,7 +373,7 @@ export function DialogConnectProvider(props: { provider: string }) {
373373
key={(m) => m?.label}
374374
onSelect={async (selected, index) => {
375375
if (!selected) return
376-
selectMethod(index)
376+
void selectMethod(index)
377377
}}
378378
>
379379
{(i) => (

packages/app/src/components/dialog-select-file.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil
348348

349349
const open = (path: string) => {
350350
const value = file.tab(path)
351-
tabs().open(value)
352-
file.load(path)
351+
void tabs().open(value)
352+
void file.load(path)
353353
if (!view().reviewPanel.opened()) view().reviewPanel.open()
354354
layout.fileTree.setTab("all")
355355
props.onOpenFile?.(path)

packages/app/src/components/dialog-select-server.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export function DialogSelectServer() {
344344

345345
createEffect(() => {
346346
items()
347-
refreshHealth()
347+
void refreshHealth()
348348
const interval = setInterval(refreshHealth, 10_000)
349349
onCleanup(() => clearInterval(interval))
350350
})
@@ -498,7 +498,7 @@ export function DialogSelectServer() {
498498
async function handleRemove(url: ServerConnection.Key) {
499499
server.remove(url)
500500
if ((await platform.getDefaultServer?.()) === url) {
501-
platform.setDefaultServer?.(null)
501+
void platform.setDefaultServer?.(null)
502502
}
503503
}
504504

@@ -536,7 +536,7 @@ export function DialogSelectServer() {
536536
items={sortedItems}
537537
key={(x) => x.http.url}
538538
onSelect={(x) => {
539-
if (x) select(x)
539+
if (x) void select(x)
540540
}}
541541
divider={true}
542542
class="px-5 [&_[data-slot=list-search-wrapper]]:w-full [&_[data-slot=list-scroll]]h-[300px] [&_[data-slot=list-scroll]]:overflow-y-auto [&_[data-slot=list-items]]:bg-surface-base [&_[data-slot=list-items]]:rounded-md [&_[data-slot=list-item]]:min-h-14 [&_[data-slot=list-item]]:p-3 [&_[data-slot=list-item]]:!bg-transparent"

packages/app/src/components/prompt-input.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
212212
if (!view().reviewPanel.opened()) view().reviewPanel.open()
213213
layout.fileTree.setTab("all")
214214
const tab = files.tab(item.path)
215-
tabs().open(tab)
215+
void tabs().open(tab)
216216
tabs().setActive(tab)
217-
Promise.resolve(files.load(item.path)).finally(() => queueCommentFocus())
217+
void Promise.resolve(files.load(item.path)).finally(() => queueCommentFocus())
218218
}
219219

220220
const recent = createMemo(() => {
@@ -1139,7 +1139,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
11391139
}
11401140

11411141
if (working()) {
1142-
abort()
1142+
void abort()
11431143
event.preventDefault()
11441144
event.stopPropagation()
11451145
return
@@ -1205,7 +1205,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
12051205
return
12061206
}
12071207
if (working()) {
1208-
abort()
1208+
void abort()
12091209
event.preventDefault()
12101210
}
12111211
return
@@ -1245,7 +1245,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
12451245
) {
12461246
return
12471247
}
1248-
handleSubmit(event)
1248+
void handleSubmit(event)
12491249
}
12501250
}
12511251

packages/app/src/components/prompt-input/submit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export function createPromptSubmit(input: PromptSubmitInput) {
295295
const mode = input.mode()
296296

297297
if (text.trim().length === 0 && images.length === 0 && input.commentCount() === 0) {
298-
if (input.working()) abort()
298+
if (input.working()) void abort()
299299
return
300300
}
301301

0 commit comments

Comments
 (0)