GeezerVison is showing github.com — feat: enable type-aware no-floating-promises rule, fix all 177 violat… · anomalyco/opencode@3e427bb
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .oxlintrc.json +7-1Lines changed: 7 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 30 | 30 | // postMessage target origin not relevant for this codebase | 31 | 31 | "unicorn/require-post-message-target-origin": "off", | 32 | 32 | // 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 | 34 | 40 | }, | 35 | 41 | "ignorePatterns": ["**/node_modules", "**/dist", "**/.build", "**/.sst", "**/*.d.ts"] | 36 | 42 | } |
Collapse file Copy file name to clipboardExpand all lines: bun.lock +15Lines changed: 15 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: github/index.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -513,7 +513,7 @@ async function subscribeSessionEvents() { | 513 | 513 | const decoder = new TextDecoder() | 514 | 514 |
| 515 | 515 | let text = "" | 516 | | - ;(async () => { | | 516 | + void (async () => { | 517 | 517 | while (true) { | 518 | 518 | try { | 519 | 519 | const { done, value } = await reader.read() | |
Collapse file Copy file name to clipboardExpand all lines: package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 87 | 87 | "glob": "13.0.5", | 88 | 88 | "husky": "9.1.7", | 89 | 89 | "oxlint": "1.60.0", | | 90 | + "oxlint-tsgolint": "0.21.0", | 90 | 91 | "prettier": "3.6.2", | 91 | 92 | "semver": "^7.6.0", | 92 | 93 | "sst": "3.18.10", | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/app.tsx +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -197,12 +197,12 @@ function ConnectionGate(props: ParentProps<{ disableHealthCheck?: boolean }>) { | 197 | 197 | fallback={ | 198 | 198 | <ConnectionError | 199 | 199 | onRetry={() => { | 200 | | - if (checkMode() === "background") healthCheckActions.refetch() | | 200 | + if (checkMode() === "background") void healthCheckActions.refetch() | 201 | 201 | }} | 202 | 202 | onServerSelected={(key) => { | 203 | 203 | setCheckMode("blocking") | 204 | 204 | server.setActive(key) | 205 | | - healthCheckActions.refetch() | | 205 | + void healthCheckActions.refetch() | 206 | 206 | }} | 207 | 207 | /> | 208 | 208 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/components/dialog-connect-provider.tsx +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -327,7 +327,7 @@ export function DialogConnectProvider(props: { provider: string }) { | 327 | 327 | if (loading()) return | 328 | 328 | if (methods().length === 1) { | 329 | 329 | auto = true | 330 | | - selectMethod(0) | | 330 | + void selectMethod(0) | 331 | 331 | } | 332 | 332 | }) | 333 | 333 |
| @@ -373,7 +373,7 @@ export function DialogConnectProvider(props: { provider: string }) { | 373 | 373 | key={(m) => m?.label} | 374 | 374 | onSelect={async (selected, index) => { | 375 | 375 | if (!selected) return | 376 | | - selectMethod(index) | | 376 | + void selectMethod(index) | 377 | 377 | }} | 378 | 378 | > | 379 | 379 | {(i) => ( | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/components/dialog-select-file.tsx +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -348,8 +348,8 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil | 348 | 348 |
| 349 | 349 | const open = (path: string) => { | 350 | 350 | const value = file.tab(path) | 351 | | - tabs().open(value) | 352 | | - file.load(path) | | 351 | + void tabs().open(value) | | 352 | + void file.load(path) | 353 | 353 | if (!view().reviewPanel.opened()) view().reviewPanel.open() | 354 | 354 | layout.fileTree.setTab("all") | 355 | 355 | props.onOpenFile?.(path) | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/components/dialog-select-server.tsx +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -344,7 +344,7 @@ export function DialogSelectServer() { | 344 | 344 |
| 345 | 345 | createEffect(() => { | 346 | 346 | items() | 347 | | - refreshHealth() | | 347 | + void refreshHealth() | 348 | 348 | const interval = setInterval(refreshHealth, 10_000) | 349 | 349 | onCleanup(() => clearInterval(interval)) | 350 | 350 | }) | @@ -498,7 +498,7 @@ export function DialogSelectServer() { | 498 | 498 | async function handleRemove(url: ServerConnection.Key) { | 499 | 499 | server.remove(url) | 500 | 500 | if ((await platform.getDefaultServer?.()) === url) { | 501 | | - platform.setDefaultServer?.(null) | | 501 | + void platform.setDefaultServer?.(null) | 502 | 502 | } | 503 | 503 | } | 504 | 504 |
| @@ -536,7 +536,7 @@ export function DialogSelectServer() { | 536 | 536 | items={sortedItems} | 537 | 537 | key={(x) => x.http.url} | 538 | 538 | onSelect={(x) => { | 539 | | - if (x) select(x) | | 539 | + if (x) void select(x) | 540 | 540 | }} | 541 | 541 | divider={true} | 542 | 542 | 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" | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/components/prompt-input.tsx +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -212,9 +212,9 @@ export const PromptInput: Component<PromptInputProps> = (props) => { | 212 | 212 | if (!view().reviewPanel.opened()) view().reviewPanel.open() | 213 | 213 | layout.fileTree.setTab("all") | 214 | 214 | const tab = files.tab(item.path) | 215 | | - tabs().open(tab) | | 215 | + void tabs().open(tab) | 216 | 216 | tabs().setActive(tab) | 217 | | - Promise.resolve(files.load(item.path)).finally(() => queueCommentFocus()) | | 217 | + void Promise.resolve(files.load(item.path)).finally(() => queueCommentFocus()) | 218 | 218 | } | 219 | 219 |
| 220 | 220 | const recent = createMemo(() => { | @@ -1139,7 +1139,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => { | 1139 | 1139 | } | 1140 | 1140 |
| 1141 | 1141 | if (working()) { | 1142 | | - abort() | | 1142 | + void abort() | 1143 | 1143 | event.preventDefault() | 1144 | 1144 | event.stopPropagation() | 1145 | 1145 | return | @@ -1205,7 +1205,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => { | 1205 | 1205 | return | 1206 | 1206 | } | 1207 | 1207 | if (working()) { | 1208 | | - abort() | | 1208 | + void abort() | 1209 | 1209 | event.preventDefault() | 1210 | 1210 | } | 1211 | 1211 | return | @@ -1245,7 +1245,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => { | 1245 | 1245 | ) { | 1246 | 1246 | return | 1247 | 1247 | } | 1248 | | - handleSubmit(event) | | 1248 | + void handleSubmit(event) | 1249 | 1249 | } | 1250 | 1250 | } | 1251 | 1251 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/components/prompt-input/submit.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -295,7 +295,7 @@ export function createPromptSubmit(input: PromptSubmitInput) { | 295 | 295 | const mode = input.mode() | 296 | 296 |
| 297 | 297 | if (text.trim().length === 0 && images.length === 0 && input.commentCount() === 0) { | 298 | | - if (input.working()) abort() | | 298 | + if (input.working()) void abort() | 299 | 299 | return | 300 | 300 | } | 301 | 301 |
| |
|