From 133f39494e7417c40141b3cd1487d7505cd95977 Mon Sep 17 00:00:00 2001 From: Olcan Date: Thu, 24 Apr 2025 15:42:18 -0700 Subject: [PATCH] general rules should apply to whole project (#159) * general rules should apply to whole project * Merge remote-tracking branch 'origin/main' into fix_eslint * lint fixes under server package --- eslint.config.js | 2 +- packages/server/src/core/client.ts | 4 ++-- packages/server/src/tools/ls.ts | 5 +---- packages/server/src/tools/read-many-files.ts | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 4078fdff..97934e81 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -89,7 +89,7 @@ export default tseslint.config( }, { // General overrides and rules for the project (TS/TSX files) - files: ['packages/cli/src/**/*.{ts,tsx}'], // Target only TS/TSX in the cli package + files: ['packages/*/src/**/*.{ts,tsx}'], // Target only TS/TSX in the cli package languageOptions: { globals: { ...globals.node, diff --git a/packages/server/src/core/client.ts b/packages/server/src/core/client.ts index ba673541..fa4d23a8 100644 --- a/packages/server/src/core/client.ts +++ b/packages/server/src/core/client.ts @@ -68,7 +68,7 @@ export class GeminiClient { config: { systemInstruction: getCoreSystemPrompt(), ...this.generateContentConfig, - tools: tools, + tools, }, history: [ { @@ -111,7 +111,7 @@ export class GeminiClient { // What do we do when we have both function responses and confirmations? const fnResponses = turn.getFunctionResponses(); - if (fnResponses.length == 0) { + if (fnResponses.length === 0) { break; // user's turn to respond } request = fnResponses; diff --git a/packages/server/src/tools/ls.ts b/packages/server/src/tools/ls.ts index a646dd22..628daad5 100644 --- a/packages/server/src/tools/ls.ts +++ b/packages/server/src/tools/ls.ts @@ -257,10 +257,7 @@ export class LSTool extends BaseTool { // Create formatted content for LLM const directoryContent = entries - .map((entry) => { - // More concise format for LLM - return `${entry.isDirectory ? '[DIR] ' : ''}${entry.name}`; - }) + .map((entry) => `${entry.isDirectory ? '[DIR] ' : ''}${entry.name}`) .join('\n'); return { diff --git a/packages/server/src/tools/read-many-files.ts b/packages/server/src/tools/read-many-files.ts index 3060a11b..fad05759 100644 --- a/packages/server/src/tools/read-many-files.ts +++ b/packages/server/src/tools/read-many-files.ts @@ -104,7 +104,7 @@ const DEFAULT_EXCLUDES: string[] = [ // Default values for encoding and separator format const DEFAULT_ENCODING: BufferEncoding = 'utf-8'; -const DEFAULT_OUTPUT_SEPARATOR_FORMAT: string = '--- {filePath} ---'; +const DEFAULT_OUTPUT_SEPARATOR_FORMAT = '--- {filePath} ---'; /** * Tool implementation for finding and reading multiple text files from the local filesystem @@ -257,7 +257,7 @@ Default excludes apply to common non-text files and large dependency directories const toolBaseDir = this.targetDir; const filesToConsider = new Set(); - const skippedFiles: { path: string; reason: string }[] = []; + const skippedFiles: Array<{ path: string; reason: string }> = []; const processedFilesRelativePaths: string[] = []; let concatenatedContent = '';