Skip to content

Commit 2bb5201

Browse files
mstuartclaude
andcommitted
fix: resolve ESLint errors for unused imports and no-explicit-any
Remove unused SchemaType imports from builder.ts, navigator.ts, and generator.ts. Remove unused buildOperation import from generator.ts. Replace `any` type annotations with proper types to satisfy @typescript-eslint/no-explicit-any rule. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4f91a89 commit 2bb5201

6 files changed

Lines changed: 9 additions & 10 deletions

File tree

src/adapters/langchain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface LangChainToolConfig {
1414
export interface StructuredToolConfig {
1515
name: string;
1616
description: string;
17-
schema: z.ZodObject<any>;
17+
schema: z.ZodObject<Record<string, z.ZodType>>;
1818
func: (input: Record<string, unknown>) => Promise<string>;
1919
}
2020

@@ -159,7 +159,7 @@ function buildJsonSchema(
159159
function buildZodSchema(
160160
field: SchemaField,
161161
schema: ParsedSchema,
162-
): z.ZodObject<any> {
162+
): z.ZodObject<Record<string, z.ZodType>> {
163163
const shape: Record<string, z.ZodType> = {};
164164

165165
for (const arg of field.args) {

src/adapters/vercel-ai.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { GraphQLExecutor } from '../mcp/executor.js';
66

77
export interface VercelAIToolConfig {
88
description: string;
9-
parameters: z.ZodObject<any>;
9+
parameters: z.ZodObject<Record<string, z.ZodType>>;
1010
execute: (args: Record<string, unknown>) => Promise<string>;
1111
}
1212

@@ -73,7 +73,7 @@ function typeRefToZod(typeRef: TypeRef, schema: ParsedSchema): z.ZodType {
7373
function buildParametersSchema(
7474
field: SchemaField,
7575
schema: ParsedSchema,
76-
): z.ZodObject<any> {
76+
): z.ZodObject<Record<string, z.ZodType>> {
7777
const shape: Record<string, z.ZodType> = {};
7878

7979
for (const arg of field.args) {

src/mock/generator.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import type { ParsedSchema, SchemaType, SchemaField, TypeRef } from '../types/index.js';
1+
import type { ParsedSchema, SchemaField, TypeRef } from '../types/index.js';
22
import { unwrapType } from '../operations/variables.js';
33
import { GraphQLExecutor } from '../mcp/executor.js';
4-
import { buildOperation } from '../operations/index.js';
54

65
export interface MockConfig {
76
seed?: number;
@@ -266,7 +265,7 @@ export function createMockExecutor(
266265
const mockExecutor = Object.create(GraphQLExecutor.prototype) as GraphQLExecutor;
267266

268267
// Override the execute method
269-
(mockExecutor as any).execute = async (
268+
(mockExecutor as unknown as Record<string, unknown>).execute = async (
270269
operation: string,
271270
_variables?: Record<string, unknown>,
272271
_additionalHeaders?: Record<string, string>,

src/operations/builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ParsedSchema, SchemaField, SchemaType } from '../types/index.js';
1+
import type { ParsedSchema, SchemaField } from '../types/index.js';
22
import { typeRefToString, isRequired, unwrapType } from './variables.js';
33

44
export interface VariableDefinition {

src/semantic/navigator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ParsedSchema, SchemaType } from '../types/index.js';
1+
import type { ParsedSchema } from '../types/index.js';
22
import { tokenize } from './tokenizer.js';
33

44
export interface SearchResult {

src/summarizer/summarizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function renderMarkdown(value: unknown, indent: number): string {
131131
if (value.length === 0) return '(empty list)';
132132

133133
const lines: string[] = [];
134-
const meta = (value as any)._meta;
134+
const meta = (value as unknown as Record<string, unknown>)._meta as { totalCount: number; showing: number } | undefined;
135135

136136
for (const item of value) {
137137
if (typeof item === 'object' && item !== null && !Array.isArray(item)) {

0 commit comments

Comments
 (0)