Skip to content

Commit 337e819

Browse files
committed
fix: add lint ignore comments for necessary any types
- Add biome-ignore comments for node-fetch-cache type limitations - Add biome-ignore comments for test mocks requiring any types - Add biome-ignore comments for dynamic configuration building - Resolve all linting errors to pass CI checks
1 parent 933e3fb commit 337e819

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

src/cli.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export function createCLI() {
6767
) => {
6868
const spinner = ora('Fetching data...').start();
6969
try {
70+
// biome-ignore lint/suspicious/noExplicitAny: Building args dynamically
7071
const args: any = { url };
7172
if (options.backend) args.backend = options.backend;
7273
if (options.cache === false) args.no_cache = true;
@@ -109,6 +110,7 @@ export function createCLI() {
109110
}) => {
110111
const spinner = ora('Updating fetch configuration...').start();
111112
try {
113+
// biome-ignore lint/suspicious/noExplicitAny: Building args dynamically
112114
const args: any = {};
113115
if (options.backend) args.backend = options.backend;
114116
if (options.cacheTtl) args.cache_ttl = options.cacheTtl;

src/index.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ vi.mock('./tools/example.js');
2121
* Test suite for the MCP server module
2222
*/
2323
describe('MCP Server Entry Point', () => {
24+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
2425
let mockServer: any;
26+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
2527
let mockTransport: any;
28+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
2629
let mockProgram: any;
2730
let originalArgv: string[];
2831

@@ -38,16 +41,19 @@ describe('MCP Server Entry Point', () => {
3841
connect: vi.fn(),
3942
close: vi.fn(),
4043
};
44+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
4145
vi.mocked(Server).mockImplementation(() => mockServer as any);
4246

4347
// Mock Transport
4448
mockTransport = {};
49+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
4550
vi.mocked(StdioServerTransport).mockImplementation(() => mockTransport as any);
4651

4752
// Mock CLI
4853
mockProgram = {
4954
parseAsync: vi.fn(),
5055
};
56+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
5157
vi.mocked(cliModule.createCLI).mockReturnValue(mockProgram as any);
5258

5359
// Mock example tool

src/tools/fetch-example.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ describe('fetchExampleTool', () => {
121121
text: vi.fn().mockResolvedValue(JSON.stringify(mockData)),
122122
};
123123

124+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
124125
vi.mocked(configurableFetch.fetch).mockResolvedValue(mockResponse as any);
125126

126127
const result = await fetchExampleTool({
@@ -152,7 +153,9 @@ describe('fetchExampleTool', () => {
152153
};
153154

154155
vi.mocked(configurableFetch.fetch)
156+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
155157
.mockResolvedValueOnce(mockResponse as any)
158+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
156159
.mockResolvedValueOnce(mockResponse as any);
157160

158161
const result = await fetchExampleTool({
@@ -173,6 +176,7 @@ describe('fetchExampleTool', () => {
173176
text: vi.fn().mockResolvedValue('test'),
174177
};
175178

179+
// biome-ignore lint/suspicious/noExplicitAny: Test mocks
176180
vi.mocked(configurableFetch.fetch).mockResolvedValue(mockResponse as any);
177181

178182
await fetchExampleTool({

src/tools/fetch-example.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export async function fetchExampleTool(args: unknown) {
5757
const startTime = Date.now();
5858

5959
// Prepare request options
60+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic options building
6061
const requestOptions: any = {
6162
backend: input.backend,
6263
noCache: input.no_cache,
@@ -166,6 +167,7 @@ export async function configureFetchTool(args: unknown) {
166167
}
167168

168169
// Update configuration (only include defined values)
170+
// biome-ignore lint/suspicious/noExplicitAny: Dynamic config building
169171
const updateConfig: any = {};
170172
if (input.backend !== undefined) updateConfig.backend = input.backend;
171173
if (input.cache_ttl !== undefined) updateConfig.cacheTtl = input.cache_ttl;

src/utils/fetch.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ type FetchFunction = (url: string | URL, options?: RequestInit) => Promise<Respo
7979
*/
8080
export class ConfigurableFetch {
8181
private config: FetchConfig;
82+
// biome-ignore lint/suspicious/noExplicitAny: node-fetch-cache doesn't export types
8283
private memoryCache?: any;
84+
// biome-ignore lint/suspicious/noExplicitAny: node-fetch-cache doesn't export types
8385
private diskCache?: any;
8486

8587
/**
@@ -162,6 +164,7 @@ export class ConfigurableFetch {
162164
* @param requestHeaders - Headers from the request
163165
* @returns Merged headers object
164166
*/
167+
// biome-ignore lint/suspicious/noExplicitAny: Headers can be multiple types
165168
private mergeHeaders(requestHeaders?: any): Record<string, string> {
166169
const headers: Record<string, string> = {
167170
...this.config.defaultHeaders,

src/utils/validation.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ describe('validateInput', () => {
7575
parse: () => {
7676
throw new Error('Not a ZodError');
7777
},
78+
// biome-ignore lint/suspicious/noExplicitAny: Testing error handling
7879
} as any;
7980

8081
expect(() => validateInput(faultySchema, 'input')).toThrow('Not a ZodError');

0 commit comments

Comments
 (0)