summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-04-18 10:53:16 -0400
committerN. Taylor Mullen <[email protected]>2025-04-18 12:41:02 -0400
commite0339993aeae97e0ce77ffa430214b64007b9f6f (patch)
treed48320c7cc66076a42b42de8cee7ff9985474fdc
parentcb303514035440b1631964cad5093a4c80cd3e43 (diff)
Initial auto-fixing of linting errors.
- This is the result of runing `npm lint -- -fix`
-rw-r--r--eslint.config.js1
-rw-r--r--packages/cli/src/config/args.ts2
-rw-r--r--packages/cli/src/core/gemini-client.ts18
-rw-r--r--packages/cli/src/core/gemini-stream.ts3
-rw-r--r--packages/cli/src/core/history-updater.ts2
-rw-r--r--packages/cli/src/tools/grep.tool.ts4
-rw-r--r--packages/cli/src/tools/read-file.tool.ts2
-rw-r--r--packages/cli/src/tools/terminal.tool.ts4
-rw-r--r--packages/cli/src/tools/tools.ts8
-rw-r--r--packages/cli/src/tools/write-file.tool.ts2
-rw-r--r--packages/cli/src/ui/components/Footer.tsx4
-rw-r--r--packages/cli/src/ui/components/Header.tsx4
-rw-r--r--packages/cli/src/ui/components/HistoryDisplay.tsx8
-rw-r--r--packages/cli/src/ui/components/InputPrompt.tsx2
-rw-r--r--packages/cli/src/ui/components/Tips.tsx4
-rw-r--r--packages/cli/src/ui/components/messages/ToolGroupMessage.tsx6
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts3
-rw-r--r--packages/cli/src/ui/utils/MarkdownRenderer.tsx2
-rw-r--r--packages/cli/src/utils/BackgroundTerminalAnalyzer.ts6
-rw-r--r--packages/cli/src/utils/getFolderStructure.ts2
20 files changed, 37 insertions, 50 deletions
diff --git a/eslint.config.js b/eslint.config.js
index 917ce7e6..dcebf242 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -53,7 +53,6 @@ export default tseslint.config(
},
settings: {
'import/resolver': {
- typescript: true,
node: true,
},
},
diff --git a/packages/cli/src/config/args.ts b/packages/cli/src/config/args.ts
index f36e7e58..a71b4b66 100644
--- a/packages/cli/src/config/args.ts
+++ b/packages/cli/src/config/args.ts
@@ -6,7 +6,7 @@ const DEFAULT_GEMINI_MODEL = 'gemini-2.5-flash-preview-04-17';
export interface CliArgs {
target_dir: string | undefined;
model: string | undefined;
- _: (string | number)[]; // Captures positional arguments
+ _: Array<string | number>; // Captures positional arguments
// Add other expected args here if needed
// e.g., verbose?: boolean;
}
diff --git a/packages/cli/src/core/gemini-client.ts b/packages/cli/src/core/gemini-client.ts
index c7c7b5f6..0b79a2ad 100644
--- a/packages/cli/src/core/gemini-client.ts
+++ b/packages/cli/src/core/gemini-client.ts
@@ -44,7 +44,7 @@ export class GeminiClient {
this.ai = new GoogleGenAI({ apiKey });
}
- public async startChat(): Promise<Chat> {
+ async startChat(): Promise<Chat> {
const tools = toolRegistry.getToolSchemas();
const model = getModel();
@@ -75,7 +75,7 @@ ${folderStructure}
try {
const chat = this.ai.chats.create({
- model: model,
+ model,
config: {
systemInstruction: CoreSystemPrompt,
...this.defaultHyperParameters,
@@ -103,14 +103,12 @@ ${folderStructure}
}
}
- public addMessageToHistory(chat: Chat, message: Content): void {
+ addMessageToHistory(chat: Chat, message: Content): void {
const history = chat.getHistory();
history.push(message);
- this.ai.chats;
- chat;
}
- public async *sendMessageStream(
+ async *sendMessageStream(
chat: Chat,
request: PartListUnion,
signal?: AbortSignal,
@@ -180,7 +178,7 @@ ${folderStructure}
}
if (pendingToolCalls.length > 0) {
- const toolPromises: Promise<ToolExecutionOutcome>[] =
+ const toolPromises: Array<Promise<ToolExecutionOutcome>> =
pendingToolCalls.map(async (pendingToolCall) => {
const tool = toolRegistry.getTool(pendingToolCall.name);
@@ -311,7 +309,7 @@ ${folderStructure}
return {
functionResponse: {
- name: name,
+ name,
id: executedTool.callId,
response: toolOutcomePayload,
},
@@ -444,7 +442,7 @@ Respond *only* in JSON format according to the following schema. Do not include
* @returns A promise that resolves to the parsed JSON object matching the schema.
* @throws Throws an error if the API call fails or the response is not valid JSON.
*/
- public async generateJson(
+ async generateJson(
contents: Content[],
schema: SchemaUnion,
): Promise<any> {
@@ -458,7 +456,7 @@ Respond *only* in JSON format according to the following schema. Do not include
responseSchema: schema,
responseMimeType: 'application/json',
},
- contents: contents, // Pass the full Content array
+ contents, // Pass the full Content array
});
const responseText = result.text;
diff --git a/packages/cli/src/core/gemini-stream.ts b/packages/cli/src/core/gemini-stream.ts
index 065d261a..314a829d 100644
--- a/packages/cli/src/core/gemini-stream.ts
+++ b/packages/cli/src/core/gemini-stream.ts
@@ -1,6 +1,5 @@
-import { ToolCallEvent } from '../ui/types.js';
+import { ToolCallEvent , HistoryItem } from '../ui/types.js';
import { Part } from '@google/genai';
-import { HistoryItem } from '../ui/types.js';
import {
handleToolCallChunk,
addErrorMessageToHistory,
diff --git a/packages/cli/src/core/history-updater.ts b/packages/cli/src/core/history-updater.ts
index 12dd30c0..a97c99a1 100644
--- a/packages/cli/src/core/history-updater.ts
+++ b/packages/cli/src/core/history-updater.ts
@@ -118,7 +118,7 @@ export const handleToolCallChunk = (
description,
resultDisplay: chunk.resultDisplay,
status: chunk.status,
- confirmationDetails: confirmationDetails,
+ confirmationDetails,
};
const activeGroupId = currentToolGroupIdRef.current;
diff --git a/packages/cli/src/tools/grep.tool.ts b/packages/cli/src/tools/grep.tool.ts
index 72e28d01..788fc76d 100644
--- a/packages/cli/src/tools/grep.tool.ts
+++ b/packages/cli/src/tools/grep.tool.ts
@@ -351,7 +351,7 @@ export class GrepTool extends BaseTool<GrepToolParams, GrepToolResult> {
results.push({
// Use relative path, or just the filename if it's in the base path itself
filePath: relativeFilePath || path.basename(absoluteFilePath),
- lineNumber: lineNumber,
+ lineNumber,
line: lineContent, // Use the full extracted line content
});
}
@@ -555,7 +555,7 @@ export class GrepTool extends BaseTool<GrepToolParams, GrepToolResult> {
path.relative(absolutePath, fileAbsolutePath) ||
path.basename(fileAbsolutePath),
lineNumber: index + 1,
- line: line,
+ line,
});
}
});
diff --git a/packages/cli/src/tools/read-file.tool.ts b/packages/cli/src/tools/read-file.tool.ts
index fc4dc977..98df7c12 100644
--- a/packages/cli/src/tools/read-file.tool.ts
+++ b/packages/cli/src/tools/read-file.tool.ts
@@ -36,7 +36,7 @@ export class ReadFileTool extends BaseTool<
ReadFileToolParams,
ReadFileToolResult
> {
- public static readonly Name: string = 'read_file';
+ static readonly Name: string = 'read_file';
// Maximum number of lines to read by default
private static readonly DEFAULT_MAX_LINES = 2000;
diff --git a/packages/cli/src/tools/terminal.tool.ts b/packages/cli/src/tools/terminal.tool.ts
index 3e2d7bf8..73f4af7d 100644
--- a/packages/cli/src/tools/terminal.tool.ts
+++ b/packages/cli/src/tools/terminal.tool.ts
@@ -127,7 +127,7 @@ export class TerminalTool extends BaseTool<
TerminalToolParams,
TerminalToolResult
> {
- public static Name: string = 'execute_bash_command';
+ static Name: string = 'execute_bash_command';
private readonly rootDirectory: string;
private readonly outputLimit: number;
@@ -387,7 +387,7 @@ Use this tool for running build steps (\`npm install\`, \`make\`), linters (\`es
const confirmationDetails: ToolExecuteConfirmationDetails = {
title: 'Confirm Shell Command',
command: params.command,
- rootCommand: rootCommand,
+ rootCommand,
description: `Execute in '${this.currentCwd}':\n${description}`,
onConfirm: async (outcome: ToolConfirmationOutcome) => {
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
diff --git a/packages/cli/src/tools/tools.ts b/packages/cli/src/tools/tools.ts
index 74acb919..9df90261 100644
--- a/packages/cli/src/tools/tools.ts
+++ b/packages/cli/src/tools/tools.ts
@@ -76,10 +76,10 @@ export abstract class BaseTool<
* @param parameterSchema JSON Schema defining the parameters
*/
constructor(
- public readonly name: string,
- public readonly displayName: string,
- public readonly description: string,
- public readonly parameterSchema: Record<string, unknown>,
+ readonly name: string,
+ readonly displayName: string,
+ readonly description: string,
+ readonly parameterSchema: Record<string, unknown>,
) {}
/**
diff --git a/packages/cli/src/tools/write-file.tool.ts b/packages/cli/src/tools/write-file.tool.ts
index 8cf0a422..1939bca0 100644
--- a/packages/cli/src/tools/write-file.tool.ts
+++ b/packages/cli/src/tools/write-file.tool.ts
@@ -37,7 +37,7 @@ export class WriteFileTool extends BaseTool<
WriteFileToolParams,
WriteFileToolResult
> {
- public static readonly Name: string = 'write_file';
+ static readonly Name: string = 'write_file';
private shouldAlwaysWrite = false;
/**
diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx
index 215a4868..6b069a2f 100644
--- a/packages/cli/src/ui/components/Footer.tsx
+++ b/packages/cli/src/ui/components/Footer.tsx
@@ -5,8 +5,7 @@ interface FooterProps {
queryLength: number;
}
-const Footer: React.FC<FooterProps> = ({ queryLength }) => {
- return (
+const Footer: React.FC<FooterProps> = ({ queryLength }) => (
<Box marginTop={1} justifyContent="space-between">
<Box minWidth={15}>
<Text color="gray">{queryLength === 0 ? '? for shortcuts' : ''}</Text>
@@ -14,6 +13,5 @@ const Footer: React.FC<FooterProps> = ({ queryLength }) => {
<Text color="blue">Gemini</Text>
</Box>
);
-};
export default Footer;
diff --git a/packages/cli/src/ui/components/Header.tsx b/packages/cli/src/ui/components/Header.tsx
index 37d42b57..d3f0f9d5 100644
--- a/packages/cli/src/ui/components/Header.tsx
+++ b/packages/cli/src/ui/components/Header.tsx
@@ -7,8 +7,7 @@ interface HeaderProps {
cwd: string;
}
-const Header: React.FC<HeaderProps> = ({ cwd }) => {
- return (
+const Header: React.FC<HeaderProps> = ({ cwd }) => (
<>
{/* Static Header Art */}
<Box marginBottom={1}>
@@ -35,6 +34,5 @@ const Header: React.FC<HeaderProps> = ({ cwd }) => {
</Box>
</>
);
-};
export default Header;
diff --git a/packages/cli/src/ui/components/HistoryDisplay.tsx b/packages/cli/src/ui/components/HistoryDisplay.tsx
index 285a6e30..fe0bf4c1 100644
--- a/packages/cli/src/ui/components/HistoryDisplay.tsx
+++ b/packages/cli/src/ui/components/HistoryDisplay.tsx
@@ -17,9 +17,9 @@ interface HistoryDisplayProps {
const HistoryDisplay: React.FC<HistoryDisplayProps> = ({
history,
onSubmit,
-}) => {
+}) =>
// No grouping logic needed here anymore
- return (
+ (
<Box flexDirection="column">
{history.map((item) => (
<Box key={item.id} marginBottom={1}>
@@ -36,7 +36,7 @@ const HistoryDisplay: React.FC<HistoryDisplayProps> = ({
</Box>
))}
</Box>
- );
-};
+ )
+;
export default HistoryDisplay;
diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx
index cf28960e..f79aeaa3 100644
--- a/packages/cli/src/ui/components/InputPrompt.tsx
+++ b/packages/cli/src/ui/components/InputPrompt.tsx
@@ -32,6 +32,6 @@ const InputPrompt: React.FC<InputPromptProps> = ({
</Box>
</Box>
);
-};
+}
export default InputPrompt;
diff --git a/packages/cli/src/ui/components/Tips.tsx b/packages/cli/src/ui/components/Tips.tsx
index 88a14407..6be53360 100644
--- a/packages/cli/src/ui/components/Tips.tsx
+++ b/packages/cli/src/ui/components/Tips.tsx
@@ -2,8 +2,7 @@ import React from 'react';
import { Box, Text } from 'ink';
import { UI_WIDTH } from '../constants.js';
-const Tips: React.FC = () => {
- return (
+const Tips: React.FC = () => (
<Box flexDirection="column" marginBottom={1} width={UI_WIDTH}>
<Text>Tips for getting started:</Text>
<Text>
@@ -17,6 +16,5 @@ const Tips: React.FC = () => {
<Text>4. Be specific for the best results.</Text>
</Box>
);
-};
export default Tips;
diff --git a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx
index 7317345b..6627faee 100644
--- a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx
+++ b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx
@@ -20,8 +20,7 @@ const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
return (
<Box flexDirection="column" borderStyle="round" borderColor={borderColor}>
- {toolCalls.map((tool) => {
- return (
+ {toolCalls.map((tool) => (
<React.Fragment key={tool.callId}>
<ToolMessage
key={tool.callId} // Use callId as the key
@@ -38,8 +37,7 @@ const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
></ToolConfirmationMessage>
)}
</React.Fragment>
- );
- })}
+ ))}
{/* Optional: Add padding below the last item if needed,
though ToolMessage already has some vertical space implicitly */}
{/* {tools.length > 0 && <Box height={1} />} */}
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 4144d96a..63f110b5 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -3,8 +3,7 @@ import { useInput } from 'ink';
import { GeminiClient } from '../../core/gemini-client.js';
import { type Chat, type PartListUnion } from '@google/genai';
import { HistoryItem } from '../types.js';
-import { processGeminiStream } from '../../core/gemini-stream.js';
-import { StreamingState } from '../../core/gemini-stream.js';
+import { processGeminiStream , StreamingState } from '../../core/gemini-stream.js';
const addHistoryItem = (
setHistory: React.Dispatch<React.SetStateAction<HistoryItem[]>>,
diff --git a/packages/cli/src/ui/utils/MarkdownRenderer.tsx b/packages/cli/src/ui/utils/MarkdownRenderer.tsx
index 20b50939..ffe1ea46 100644
--- a/packages/cli/src/ui/utils/MarkdownRenderer.tsx
+++ b/packages/cli/src/ui/utils/MarkdownRenderer.tsx
@@ -197,7 +197,7 @@ export class MarkdownRenderer {
* @param text The full markdown string to render.
* @returns An array of React nodes representing markdown blocks.
*/
- public static render(text: string): React.ReactNode[] {
+ static render(text: string): React.ReactNode[] {
if (!text) return [];
const lines = text.split('\n');
diff --git a/packages/cli/src/utils/BackgroundTerminalAnalyzer.ts b/packages/cli/src/utils/BackgroundTerminalAnalyzer.ts
index 3e958d09..6028f9b1 100644
--- a/packages/cli/src/utils/BackgroundTerminalAnalyzer.ts
+++ b/packages/cli/src/utils/BackgroundTerminalAnalyzer.ts
@@ -75,7 +75,7 @@ export class BackgroundTerminalAnalyzer {
* @param command The command string that was executed (for context in prompts).
* @returns A promise resolving to the final analysis outcome.
*/
- public async analyze(
+ async analyze(
pid: ProcessHandle,
tempStdoutFilePath: string,
tempStderrFilePath: string,
@@ -91,8 +91,8 @@ export class BackgroundTerminalAnalyzer {
while (attempts < this.maxAttempts) {
attempts++;
- let currentStdout: string = '';
- let currentStderr: string = '';
+ let currentStdout = '';
+ let currentStderr = '';
// --- Robust File Reading ---
try {
diff --git a/packages/cli/src/utils/getFolderStructure.ts b/packages/cli/src/utils/getFolderStructure.ts
index 5c26f400..d1e780a8 100644
--- a/packages/cli/src/utils/getFolderStructure.ts
+++ b/packages/cli/src/utils/getFolderStructure.ts
@@ -61,7 +61,7 @@ async function readFullStructure(
const name = path.basename(folderPath);
// Initialize with isIgnored: false
const folderInfo: Omit<FullFolderInfo, 'totalChildren' | 'totalFiles'> = {
- name: name,
+ name,
path: folderPath,
files: [],
subFolders: [],