From c9a56f72b80062bd060d7fdfa6711c67826e1d50 Mon Sep 17 00:00:00 2001 From: Scott Lovegrove Date: Thu, 27 Nov 2025 10:40:06 +0000 Subject: [PATCH] fix: Replace 'any' with 'Record' in test mocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix ESLint @typescript-eslint/no-explicit-any errors in uncompletable task tests by using proper typing for request body assertions instead of 'any' type. This resolves CI failures from PR #418. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/todoist-api.tasks.test.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/todoist-api.tasks.test.ts b/src/todoist-api.tasks.test.ts index e496cc2..192c279 100644 --- a/src/todoist-api.tasks.test.ts +++ b/src/todoist-api.tasks.test.ts @@ -65,7 +65,7 @@ describe('TodoistApi task endpoints', () => { server.use( http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}`, async ({ request }) => { - const body = (await request.json()) as any + const body = (await request.json()) as Record expect(body.content).toBe('* This is an uncompletable task') return HttpResponse.json(expectedTask, { status: 200 }) }), @@ -90,7 +90,7 @@ describe('TodoistApi task endpoints', () => { server.use( http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}`, async ({ request }) => { - const body = (await request.json()) as any + const body = (await request.json()) as Record expect(body.content).toBe('* Already has prefix') return HttpResponse.json(expectedTask, { status: 200 }) }), @@ -115,7 +115,7 @@ describe('TodoistApi task endpoints', () => { server.use( http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}`, async ({ request }) => { - const body = (await request.json()) as any + const body = (await request.json()) as Record expect(body.content).toBe('Regular completable task') return HttpResponse.json(expectedTask, { status: 200 }) }), @@ -167,7 +167,7 @@ describe('TodoistApi task endpoints', () => { server.use( http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}/123`, async ({ request }) => { - const body = (await request.json()) as any + const body = (await request.json()) as Record expect(body.content).toBe('* Updated uncompletable task') return HttpResponse.json(returnedTask, { status: 200 }) }), @@ -191,7 +191,7 @@ describe('TodoistApi task endpoints', () => { server.use( http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}/123`, async ({ request }) => { - const body = (await request.json()) as any + const body = (await request.json()) as Record expect(body.content).toBeUndefined() expect(body.is_uncompletable).toBe(false) // Note: snake_case conversion return HttpResponse.json(returnedTask, { status: 200 }) @@ -286,7 +286,7 @@ describe('TodoistApi task endpoints', () => { server.use( http.post(`${getSyncBaseUri()}${ENDPOINT_SYNC_QUICK_ADD}`, async ({ request }) => { - const body = (await request.json()) as any + const body = (await request.json()) as Record expect(body.text).toBe('* Quick uncompletable task') return HttpResponse.json(expectedTask, { status: 200 }) }), @@ -311,7 +311,7 @@ describe('TodoistApi task endpoints', () => { server.use( http.post(`${getSyncBaseUri()}${ENDPOINT_SYNC_QUICK_ADD}`, async ({ request }) => { - const body = (await request.json()) as any + const body = (await request.json()) as Record expect(body.text).toBe('* Already prefixed quick task') return HttpResponse.json(expectedTask, { status: 200 }) }),