Skip to content

Commit bd755be

Browse files
committed
make biome happier
1 parent e28658f commit bd755be

File tree

13 files changed

+60
-39
lines changed

13 files changed

+60
-39
lines changed

apps/array/src/renderer/features/logs/components/LogEventRenderer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import type { AgentEvent } from "@posthog/agent";
1313
import { Code, ContextMenu } from "@radix-ui/themes";
1414
import { IS_DEV } from "@/constants/environment";
1515

16-
// biome-ignore lint/suspicious/noExplicitAny: Components are type-safe internally, map handles dispatch
1716
const EVENT_COMPONENT_MAP: Record<
1817
string,
1918
React.ComponentType<{ event: any }>

apps/array/src/renderer/features/panels/store/panelLayoutStore.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ describe("panelLayoutStore", () => {
274274
const storedData = localStorage.getItem("panel-layout-store");
275275
expect(storedData).not.toBeNull();
276276

277-
const parsed = JSON.parse(storedData!);
277+
const parsed = JSON.parse(storedData ?? "");
278278
expect(parsed.state.taskLayouts["task-1"]).toBeDefined();
279279
expect(parsed.state.taskLayouts["task-1"].openFiles).toContain(
280280
"src/App.tsx",

apps/array/src/renderer/features/sidebar/components/items/ViewItem.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ export function ViewItem({ label, isActive, onClick }: ViewItemProps) {
1111
return (
1212
<SidebarItem
1313
depth={0}
14-
icon={label === "My tasks" ? <UserIcon size={12} weight={isActive ? "fill" : "regular"} /> : <ListNumbersIcon size={12} weight={isActive ? "fill" : "regular"} />}
14+
icon={
15+
label === "My tasks" ? (
16+
<UserIcon size={12} weight={isActive ? "fill" : "regular"} />
17+
) : (
18+
<ListNumbersIcon size={12} weight={isActive ? "fill" : "regular"} />
19+
)
20+
}
1521
label={label}
1622
isActive={isActive}
1723
onClick={onClick}

apps/array/src/renderer/features/task-detail/components/FileTreePanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ export function FileTreePanel({ taskId, task }: FileTreePanelProps) {
9393
error,
9494
} = useQuery({
9595
queryKey: ["directory", repoPath],
96-
queryFn: () => window.electronAPI.listDirectory(repoPath!),
96+
queryFn: () => {
97+
if (!repoPath) throw new Error("repoPath is required");
98+
return window.electronAPI.listDirectory(repoPath);
99+
},
97100
enabled: !!repoPath,
98101
staleTime: Infinity,
99102
});

apps/array/src/renderer/stores/registeredFoldersStore.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ interface RegisteredFoldersState {
99
removeFolder: (folderId: string) => Promise<void>;
1010
updateLastAccessed: (folderId: string) => Promise<void>;
1111
getFolderByPath: (path: string) => RegisteredFolder | undefined;
12-
cleanupOrphanedWorktrees: (
13-
mainRepoPath: string,
14-
) => Promise<{
12+
cleanupOrphanedWorktrees: (mainRepoPath: string) => Promise<{
1513
deleted: string[];
1614
errors: Array<{ path: string; error: string }>;
1715
}>;

apps/array/src/renderer/types/electron.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,7 @@ declare global {
221221
) => Promise<TaskFolderAssociation | null>;
222222
removeTaskAssociation: (taskId: string) => Promise<void>;
223223
clearTaskWorktree: (taskId: string) => Promise<void>;
224-
cleanupOrphanedWorktrees: (
225-
mainRepoPath: string,
226-
) => Promise<{
224+
cleanupOrphanedWorktrees: (mainRepoPath: string) => Promise<{
227225
deleted: string[];
228226
errors: Array<{ path: string; error: string }>;
229227
}>;

apps/array/src/test/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { afterAll, afterEach, beforeAll, vi } from "vitest";
66
// we don't care about them.
77
const originalError = console.error;
88
beforeAll(() => {
9-
console.error = (...args: any[]) => {
9+
console.error = (...args: unknown[]) => {
1010
if (
1111
typeof args[0] === "string" &&
1212
args[0].includes("Warning: An update to") &&

packages/agent/src/posthog-api.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export class PostHogAPIClient {
273273
const teamId = projectId ? parseInt(projectId, 10) : this.getTeamId();
274274

275275
try {
276-
const errorData = await this.apiRequest<any>(
276+
const errorData = await this.apiRequest<Record<string, unknown>>(
277277
`/api/projects/${teamId}/error_tracking/${errorId}/`,
278278
);
279279

@@ -284,7 +284,10 @@ export class PostHogAPIClient {
284284
type: "error",
285285
id: errorId,
286286
url: `${this.baseUrl}/project/${teamId}/error_tracking/${errorId}`,
287-
title: errorData.exception_type || "Unknown Error",
287+
title:
288+
(typeof errorData.exception_type === "string"
289+
? errorData.exception_type
290+
: undefined) || "Unknown Error",
288291
content,
289292
metadata: {
290293
exception_type: errorData.exception_type,
@@ -343,7 +346,7 @@ export class PostHogAPIClient {
343346
/**
344347
* Format error data for agent consumption
345348
*/
346-
private formatErrorContent(errorData: any): string {
349+
private formatErrorContent(errorData: Record<string, unknown>): string {
347350
const sections = [];
348351

349352
if (errorData.exception_type) {

packages/agent/src/prompt-builder.ts

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import { promises as fs } from "node:fs";
22
import { join } from "node:path";
33
import type { TemplateVariables } from "./template-manager.js";
4-
import type { PostHogResource, Task, UrlMention } from "./types.js";
4+
import type {
5+
PostHogResource,
6+
ResourceType,
7+
SupportingFile,
8+
Task,
9+
UrlMention,
10+
} from "./types.js";
511
import { Logger } from "./utils/logger.js";
612

713
export interface PromptBuilderDeps {
8-
getTaskFiles: (taskId: string) => Promise<any[]>;
14+
getTaskFiles: (taskId: string) => Promise<SupportingFile[]>;
915
generatePlanTemplate: (vars: TemplateVariables) => Promise<string>;
1016
posthogClient?: {
1117
fetchResourceByUrl: (mention: UrlMention) => Promise<PostHogResource>;
@@ -81,9 +87,9 @@ export class PromptBuilder {
8187
const [, type, id] = match;
8288
mentions.push({
8389
url: "", // Will be reconstructed if needed
84-
type: type as any,
90+
type: type as ResourceType,
8591
id,
86-
label: this.generateUrlLabel("", type as any),
92+
label: this.generateUrlLabel("", type as ResourceType),
8793
});
8894
match = resourceRegex.exec(description);
8995
}
@@ -249,8 +255,8 @@ export class PromptBuilder {
249255
prompt += `<title>${task.title}</title>\n`;
250256
prompt += `<description>${processedDescription}</description>\n`;
251257

252-
if ((task as any).primary_repository) {
253-
prompt += `<repository>${(task as any).primary_repository}</repository>\n`;
258+
if (task.primary_repository) {
259+
prompt += `<repository>${task.primary_repository}</repository>\n`;
254260
}
255261
prompt += "</task>\n";
256262

@@ -278,7 +284,7 @@ export class PromptBuilder {
278284
try {
279285
const taskFiles = await this.getTaskFiles(task.id);
280286
const contextFiles = taskFiles.filter(
281-
(f: any) => f.type === "context" || f.type === "reference",
287+
(f: SupportingFile) => f.type === "context" || f.type === "reference",
282288
);
283289
if (contextFiles.length > 0) {
284290
prompt += "\n<supporting_files>\n";
@@ -312,8 +318,8 @@ export class PromptBuilder {
312318
prompt += `<title>${task.title}</title>\n`;
313319
prompt += `<description>${processedDescription}</description>\n`;
314320

315-
if ((task as any).primary_repository) {
316-
prompt += `<repository>${(task as any).primary_repository}</repository>\n`;
321+
if (task.primary_repository) {
322+
prompt += `<repository>${task.primary_repository}</repository>\n`;
317323
}
318324
prompt += "</task>\n";
319325

@@ -341,7 +347,7 @@ export class PromptBuilder {
341347
try {
342348
const taskFiles = await this.getTaskFiles(task.id);
343349
const contextFiles = taskFiles.filter(
344-
(f: any) => f.type === "context" || f.type === "reference",
350+
(f: SupportingFile) => f.type === "context" || f.type === "reference",
345351
);
346352
if (contextFiles.length > 0) {
347353
prompt += "\n<supporting_files>\n";
@@ -361,7 +367,7 @@ export class PromptBuilder {
361367
task_title: task.title,
362368
task_description: processedDescription,
363369
date: new Date().toISOString().split("T")[0],
364-
repository: ((task as any).primary_repository || "") as string,
370+
repository: task.primary_repository || "",
365371
};
366372

367373
const planTemplate = await this.generatePlanTemplate(templateVariables);
@@ -393,8 +399,8 @@ export class PromptBuilder {
393399
prompt += `<title>${task.title}</title>\n`;
394400
prompt += `<description>${processedDescription}</description>\n`;
395401

396-
if ((task as any).primary_repository) {
397-
prompt += `<repository>${(task as any).primary_repository}</repository>\n`;
402+
if (task.primary_repository) {
403+
prompt += `<repository>${task.primary_repository}</repository>\n`;
398404
}
399405
prompt += "</task>\n";
400406

@@ -421,8 +427,10 @@ export class PromptBuilder {
421427

422428
try {
423429
const taskFiles = await this.getTaskFiles(task.id);
424-
const hasPlan = taskFiles.some((f: any) => f.type === "plan");
425-
const todosFile = taskFiles.find((f: any) => f.name === "todos.json");
430+
const hasPlan = taskFiles.some((f: SupportingFile) => f.type === "plan");
431+
const todosFile = taskFiles.find(
432+
(f: SupportingFile) => f.name === "todos.json",
433+
);
426434

427435
if (taskFiles.length > 0) {
428436
prompt += "\n<context>\n";

packages/agent/src/task-manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export interface TaskExecutionState {
44
taskId: string;
55
status: "running" | "completed" | "failed" | "canceled" | "timeout";
66
mode: "plan_only" | "plan_and_build" | "build_only";
7-
result?: any;
7+
result?: unknown;
88
startedAt: number;
99
completedAt?: number;
1010
abortController?: AbortController;
@@ -37,7 +37,7 @@ export class TaskManager {
3737
return executionState;
3838
}
3939

40-
async waitForCompletion(executionId: string): Promise<any> {
40+
async waitForCompletion(executionId: string): Promise<unknown> {
4141
const execution = this.executionStates.get(executionId);
4242
if (!execution) {
4343
throw new Error(`Execution ${executionId} not found`);
@@ -76,7 +76,7 @@ export class TaskManager {
7676
});
7777
}
7878

79-
completeExecution(executionId: string, result: any): void {
79+
completeExecution(executionId: string, result: unknown): void {
8080
const execution = this.executionStates.get(executionId);
8181
if (!execution) {
8282
throw new Error(`Execution ${executionId} not found`);

0 commit comments

Comments
 (0)