Skip to content

Commit 16c0992

Browse files
authored
refactor: remove unnecessary type assertion as any (RooCodeInc#2802)
1 parent 3b8be75 commit 16c0992

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/api/providers/anthropic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class AnthropicHandler implements ApiHandler {
114114
break
115115
}
116116
default: {
117-
stream = (await this.client.messages.create({
117+
stream = await this.client.messages.create({
118118
model: modelId,
119119
max_tokens: model.info.maxTokens || 8192,
120120
temperature: 0,
@@ -123,7 +123,7 @@ export class AnthropicHandler implements ApiHandler {
123123
// tools,
124124
// tool_choice: { type: "auto" },
125125
stream: true,
126-
})) as any
126+
})
127127
break
128128
}
129129
}

src/api/transform/gemini-format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function convertAnthropicContentToGemini(content: string | Anthropic.Cont
2020
},
2121
} as InlineDataPart
2222
default:
23-
throw new Error(`Unsupported content block type: ${(block as any).type}`)
23+
throw new Error(`Unsupported content block type: ${block.type}`)
2424
}
2525
})
2626
}

src/core/context/context-tracking/FileContextTracker.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("FileContextTracker", () => {
4141
const originalCreateFileSystemWatcher = vscode.workspace.createFileSystemWatcher
4242
vscode.workspace.createFileSystemWatcher = function () {
4343
return mockFileSystemWatcher
44-
} as any
44+
}
4545

4646
// Mock controller and context
4747
mockContext = {

webview-ui/src/components/settings/__tests__/APIOptions.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("ApiOptions Component", () => {
2626

2727
beforeEach(() => {
2828
//@ts-expect-error - vscode is not defined in the global namespace in test environment
29-
global.vscode = { postMessage: mockPostMessage } as any
29+
global.vscode = { postMessage: mockPostMessage }
3030
})
3131

3232
it("renders Requesty API Key input", () => {
@@ -73,7 +73,7 @@ describe("ApiOptions Component", () => {
7373

7474
beforeEach(() => {
7575
//@ts-expect-error - vscode is not defined in the global namespace in test environment
76-
global.vscode = { postMessage: mockPostMessage } as any
76+
global.vscode = { postMessage: mockPostMessage }
7777
})
7878

7979
it("renders Together API Key input", () => {

0 commit comments

Comments
 (0)