GeezerVison is showing github.com — feat: enable type-aware no-misused-spread rule, fix 8 violations (#22… · madflow/opencode@bd29004
File treeExpand file treeCollapse file tree Open diff view settings console/app/src/routes/download/[channel]
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .opencode/tool/github-pr-search.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ async function githubFetch(endpoint: string, options: RequestInit = {}) { | 7 | 7 | Authorization: `Bearer ${process.env.GITHUB_TOKEN}`, | 8 | 8 | Accept: "application/vnd.github+json", | 9 | 9 | "Content-Type": "application/json", | 10 | | - ...options.headers, | | 10 | + ...(options.headers instanceof Headers ? Object.fromEntries(options.headers.entries()) : options.headers), | 11 | 11 | }, | 12 | 12 | }) | 13 | 13 | if (!response.ok) { | |
Collapse file Copy file name to clipboardExpand all lines: .opencode/tool/github-triage.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -28,7 +28,7 @@ async function githubFetch(endpoint: string, options: RequestInit = {}) { | 28 | 28 | Authorization: `Bearer ${process.env.GITHUB_TOKEN}`, | 29 | 29 | Accept: "application/vnd.github+json", | 30 | 30 | "Content-Type": "application/json", | 31 | | - ...options.headers, | | 31 | + ...(options.headers instanceof Headers ? Object.fromEntries(options.headers.entries()) : options.headers), | 32 | 32 | }, | 33 | 33 | }) | 34 | 34 | if (!response.ok) { | |
Collapse file Copy file name to clipboardExpand all lines: .oxlintrc.json +7-2Lines changed: 7 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 37 | 37 | "no-new": "off", | 38 | 38 |
| 39 | 39 | // Type-aware: catch unhandled promises | 40 | | - "typescript/no-floating-promises": "warn" | | 40 | + "typescript/no-floating-promises": "warn", | | 41 | + // Warn when spreading non-plain objects (Headers, class instances, etc.) | | 42 | + "typescript/no-misused-spread": "warn" | 41 | 43 | }, | 42 | 44 | "options": { | 43 | 45 | "typeAware": true | 44 | 46 | }, | 45 | | - "ignorePatterns": ["**/node_modules", "**/dist", "**/.build", "**/.sst", "**/*.d.ts"] | | 47 | + "options": { | | 48 | + "typeAware": true | | 49 | + }, | | 50 | + "ignorePatterns": ["**/node_modules", "**/dist", "**/.build", "**/.sst", "**/*.d.ts", "**/sdk.gen.ts"] | 46 | 51 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/utils/server.ts +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,7 +16,10 @@ export function createSdkForServer({ | 16 | 16 |
| 17 | 17 | return createOpencodeClient({ | 18 | 18 | ...config, | 19 | | - headers: { ...config.headers, ...auth }, | | 19 | + headers: { | | 20 | + ...(config.headers instanceof Headers ? Object.fromEntries(config.headers.entries()) : config.headers), | | 21 | + ...auth, | | 22 | + }, | 20 | 23 | baseUrl: server.url, | 21 | 24 | }) | 22 | 25 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/console/app/src/routes/download/[channel]/[platform].ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -37,5 +37,5 @@ export async function GET({ params: { platform, channel } }: APIEvent) { | 37 | 37 | const headers = new Headers(resp.headers) | 38 | 38 | if (downloadName) headers.set("content-disposition", `attachment; filename="${downloadName}"`) | 39 | 39 |
| 40 | | - return new Response(resp.body, { ...resp, headers }) | | 40 | + return new Response(resp.body, { status: resp.status, statusText: resp.statusText, headers }) | 41 | 41 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/tui/component/logo.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -520,7 +520,7 @@ export function Logo() { | 520 | 520 | const shadow = tint(theme.background, ink, 0.25) | 521 | 521 | const attrs = bold ? TextAttributes.BOLD : undefined | 522 | 522 |
| 523 | | - return [...line].map((char, i) => { | | 523 | + return Array.from(line).map((char, i) => { | 524 | 524 | const h = field(off + i, y, frame) | 525 | 525 | const n = wave(off + i, y, frame, lit(char)) + h | 526 | 526 | const s = wave(off + i, y, dusk, false) + h | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/server/ui/index.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -37,9 +37,9 @@ export const UIRoutes = (): Hono => | 37 | 37 | } | 38 | 38 | } else { | 39 | 39 | const response = await proxy(`https://app.opencode.ai${path}`, { | 40 | | - ...c.req, | | 40 | + raw: c.req.raw, | 41 | 41 | headers: { | 42 | | - ...c.req.raw.headers, | | 42 | + ...Object.fromEntries(c.req.raw.headers.entries()), | 43 | 43 | host: "app.opencode.ai", | 44 | 44 | }, | 45 | 45 | }) | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/v2/session-event.ts +5-1Lines changed: 5 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,11 @@ export namespace SessionEvent { | 39 | 39 | }) { | 40 | 40 | static create(input: FileAttachment) { | 41 | 41 | return new FileAttachment({ | 42 | | - ...input, | | 42 | + uri: input.uri, | | 43 | + mime: input.mime, | | 44 | + name: input.name, | | 45 | + description: input.description, | | 46 | + source: input.source, | 43 | 47 | }) | 44 | 48 | } | 45 | 49 | } | |
|