Skip to content

Commit

Permalink
Fix lint and type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
openhands-agent committed Dec 10, 2024
1 parent ec0be4a commit 608f1f7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions scripts/src/github-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async function fetchAllPages<T>(url: string): Promise<T[]> {
pageCount++;
console.log(`Fetching page ${pageCount.toString()} from ${currentUrl}`);
const response = await fetchWithAuth(currentUrl);
console.log(`Got ${response.data.length.toString()} items`);
console.log(`Got ${String(response.data.length)} items`);
allItems.push(...(response.data as T[]));
currentUrl = response.nextUrl ?? '';
}
Expand Down Expand Up @@ -155,7 +155,7 @@ async function processIssueComments(issue: GitHubIssue): Promise<Activity[]> {
let prNumber: string | undefined;

// Try full PR URL format
const fullUrlMatch = successComment.body.match(/https:\/\/github\.com\/[^\/]+\/[^\/]+\/pull\/(\d+)/);
const fullUrlMatch = successComment.body.match(/https:\/\/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);
if (fullUrlMatch) {
prNumber = fullUrlMatch[1];
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface GitHubPRResponse {
}

export interface ApiResponse {
data: any[] | any;
data: unknown[];
hasNextPage: boolean;
nextUrl: string | null;
}
Expand Down
1 change: 1 addition & 0 deletions src/__integration_tests__/github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('GitHub Service Integration Tests', () => {
url: expect.stringMatching(/^https:\/\/github\.com\//),
title: expect.any(String),
description: expect.any(String),
prUrl: expect.any(String),
};

for (const activity of activities) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/ActivityList.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render, screen, fireEvent } from '@testing-library/react';
import { describe, it, expect, beforeEach } from 'vitest';
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { ActivityList } from './ActivityList';
import { BotActivity } from '../types';
import { getComputedStyle } from '../test/testUtils';
Expand Down Expand Up @@ -137,7 +137,7 @@ describe('ActivityList', () => {
afterEach(() => {
// Clean up styles
const styles = document.head.getElementsByTagName('style');
Array.from(styles).forEach(style => style.remove());
Array.from(styles).forEach((style) => { style.remove(); });
});

const issueStatuses = [
Expand Down Expand Up @@ -248,7 +248,7 @@ describe('ActivityList', () => {
afterEach(() => {
// Clean up styles
const styles = document.head.getElementsByTagName('style');
Array.from(styles).forEach(style => style.remove());
Array.from(styles).forEach((style) => { style.remove(); });
});

describe('pagination styling', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ActivityList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BotActivity, IssueActivityStatus } from '../types';
import { BotActivity } from '../types';
import { useState } from 'react';

interface ActivityListProps {
Expand Down

0 comments on commit 608f1f7

Please sign in to comment.