Skip to content

Commit 43fa77c

Browse files
ctehannesrudolph
authored andcommitted
Fix linter errors (#3821)
1 parent be3f468 commit 43fa77c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+218
-150
lines changed

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dist
2+
build
3+
out
4+
.next
5+
.venv
6+
pnpm-lock.yaml

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@roo-code/vscode-e2e",
33
"private": true,
44
"scripts": {
5-
"lint": "eslint **/*.ts --max-warnings=0",
5+
"lint": "eslint src --ext=ts --max-warnings=0",
66
"check-types": "tsc --noEmit",
77
"format": "prettier --write src",
88
"test:ci": "pnpm --filter roo-cline build:development && pnpm test:run",

e2e/src/suite/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { type RooCodeAPI, Package } from "@roo-code/types"
88
import { waitFor } from "./utils"
99

1010
declare global {
11-
var api: RooCodeAPI
11+
let api: RooCodeAPI
1212
}
1313

1414
export async function run() {
@@ -29,7 +29,7 @@ export async function run() {
2929
await vscode.commands.executeCommand(`${Package.name}.SidebarProvider.focus`)
3030
await waitFor(() => api.isReady())
3131

32-
// Expose the API to the tests.
32+
// @ts-expect-error - Expose the API to the tests.
3333
globalThis.api = api
3434

3535
// Add all the tests to the runner.

e2e/src/suite/modes.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import * as assert from "assert"
22

3-
import type { ClineMessage } from "@roo-code/types"
3+
import type { RooCodeAPI, ClineMessage } from "@roo-code/types"
44

55
import { waitUntilCompleted } from "./utils"
66

77
suite("Roo Code Modes", () => {
88
test("Should handle switching modes correctly", async () => {
9-
const api = globalThis.api
9+
// @ts-expect-error - Expose the API to the tests.
10+
const api = globalThis.api as RooCodeAPI
1011

1112
/**
1213
* Switch modes.
@@ -15,7 +16,7 @@ suite("Roo Code Modes", () => {
1516
const switchModesPrompt =
1617
"For each mode (Architect, Ask, Debug) respond with the mode name and what it specializes in after switching to that mode."
1718

18-
let messages: ClineMessage[] = []
19+
const messages: ClineMessage[] = []
1920

2021
const modeSwitches: string[] = []
2122

e2e/src/suite/subtasks.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import * as assert from "assert"
22

3-
import type { ClineMessage } from "@roo-code/types"
3+
import type { RooCodeAPI, ClineMessage } from "@roo-code/types"
44

55
import { sleep, waitFor, waitUntilCompleted } from "./utils"
66

77
suite.skip("Roo Code Subtasks", () => {
88
test("Should handle subtask cancellation and resumption correctly", async () => {
9-
const api = globalThis.api
9+
// @ts-expect-error - Expose the API to the tests.
10+
const api = globalThis.api as RooCodeAPI
1011

1112
const messages: Record<string, ClineMessage[]> = {}
1213

e2e/src/suite/task.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import * as assert from "assert"
22

3-
import type { ClineMessage } from "@roo-code/types"
3+
import type { RooCodeAPI, ClineMessage } from "@roo-code/types"
44

55
import { waitUntilCompleted } from "./utils"
66

77
suite("Roo Code Task", () => {
88
test("Should handle prompt and response correctly", async () => {
9-
const api = globalThis.api
9+
// @ts-expect-error - Expose the API to the tests.
10+
const api = globalThis.api as RooCodeAPI
1011

1112
const messages: ClineMessage[] = []
1213

packages/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "./dist/index.js",
77
"types": "./src/index.ts",
88
"scripts": {
9-
"lint": "eslint src/**/*.ts --max-warnings=0",
9+
"lint": "eslint src --ext=ts --max-warnings=0",
1010
"check-types": "tsc --noEmit",
1111
"test": "vitest --globals --run",
1212
"build": "tsc",

packages/build/src/esbuild.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ export function generatePackageJson({
143143
overrideJson,
144144
substitution,
145145
}: {
146-
packageJson: Record<string, any>
147-
overrideJson: Record<string, any>
146+
packageJson: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
147+
overrideJson: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
148148
substitution: [string, string]
149149
}) {
150150
const { viewsContainers, views, commands, menus, submenus, configuration } = contributesSchema.parse(contributes)
@@ -167,6 +167,7 @@ export function generatePackageJson({
167167
}
168168
}
169169

170+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
170171
function transformArrayRecord<T>(obj: Record<string, any[]>, from: string, to: string, props: string[]): T {
171172
return Object.entries(obj).reduce(
172173
(acc, [key, ary]) => ({
@@ -187,13 +188,15 @@ function transformArrayRecord<T>(obj: Record<string, any[]>, from: string, to: s
187188
)
188189
}
189190

191+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
190192
function transformArray<T>(arr: any[], from: string, to: string, idProp: string): T[] {
191193
return arr.map(({ [idProp]: id, ...rest }) => ({
192194
[idProp]: id.replace(from, to),
193195
...rest,
194196
}))
195197
}
196198

199+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
197200
function transformRecord<T>(obj: Record<string, any>, from: string, to: string): T {
198201
return Object.entries(obj).reduce(
199202
(acc, [key, value]) => ({

packages/build/src/git.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { execSync } from "child_process"
22

33
export function getGitSha() {
4-
let gitSha = undefined
4+
let gitSha: string | undefined = undefined
55

66
try {
77
gitSha = execSync("git rev-parse HEAD").toString().trim()
8-
} catch (e) {}
8+
} catch (_e) {
9+
// Do nothing.
10+
}
911

1012
return gitSha
1113
}

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)