Skip to content

Commit 824da8c

Browse files
authored
chore: Enable no-unused-vars linting to shake out unused values (#1903)
chore: Enable no-unused-vars linting to shake out unused values during refactoring and iteration
1 parent 93eba54 commit 824da8c

File tree

352 files changed

+1144
-1236
lines changed

Some content is hidden

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

352 files changed

+1144
-1236
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"no-external-import"
7373
],
7474
"exclude": [
75-
"no-unused-vars",
75+
"jsx-no-useless-fragment",
7676
"no-explicit-any",
7777
"require-yield"
7878
]

packages/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ export const schema = <T extends JSONSchema>(schema: T) => schema;
596596

597597
// toSchema is a compile-time transformer that converts TypeScript types to JSONSchema
598598
// The actual implementation is done by the TypeScript transformer
599-
export const toSchema = <T>(options?: Partial<JSONSchema>): JSONSchema => {
599+
export const toSchema = <T>(_options?: Partial<JSONSchema>): JSONSchema => {
600600
return {} as JSONSchema;
601601
};
602602

packages/background-charm-service/src/space-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class SpaceManager {
161161
continue;
162162
}
163163

164-
const { charmId, entry, timestamp } = this.pendingTasks.shift()!;
164+
const { charmId, entry, timestamp: _ } = this.pendingTasks.shift()!;
165165

166166
this.processCharm(charmId, entry);
167167
}

packages/background-charm-service/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function getIdentity(
4242
try {
4343
const pkcs8Key = await Deno.readFile(identityPath);
4444
return await Identity.fromPkcs8(pkcs8Key, keyConfig);
45-
} catch (e) {
45+
} catch (_e) {
4646
throw new Error(`Could not read key at ${identityPath}.`);
4747
}
4848
} else if (operatorPass) {

packages/background-charm-service/src/worker-controller.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@ import { Cell } from "@commontools/runner";
33
import { Identity } from "@commontools/identity";
44
import { defer, type Deferred } from "@commontools/utils/defer";
55
import {
6-
InitializationData,
76
isWorkerIPCRequest,
87
isWorkerIPCResponse,
9-
RunData,
108
WorkerIPCMessageType,
11-
WorkerIPCRequest,
12-
WorkerIPCResponse,
139
} from "./worker-ipc.ts";
1410

1511
const DEFAULT_TASK_TIMEOUT = 60_000;
@@ -122,7 +118,7 @@ export class WorkerController extends EventTarget {
122118
}
123119
this.state = WorkerState.Terminating;
124120

125-
for (const [msgId, task] of this.pending.entries()) {
121+
for (const [_, task] of this.pending.entries()) {
126122
task.deferred.reject(new Error("Worker shutting down."));
127123
}
128124
this.pending.clear();

packages/charm/src/format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export async function parseComposerDocument(
250250

251251
try {
252252
document = JSON.parse(serializedDocument) as Descendant[];
253-
} catch (error) {
253+
} catch (_) {
254254
console.warn(
255255
"Failed to parse JSON compose document, assuming plain text:",
256256
);

packages/charm/src/iframe/prompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ${newSpec}
6161
6262
by following the following steps:
6363
<steps>
64-
${steps.map((step, index) => `<step>${step}</step>`).join("\n")}
64+
${steps.map((step) => `<step>${step}</step>`).join("\n")}
6565
</steps>`
6666
: ""
6767
}`,

packages/charm/src/iframe/recipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const getIframeRecipe = (
8787
}
8888
try {
8989
return { recipeId, src, iframe: parseIframeRecipe(src) };
90-
} catch (error) {
90+
} catch (_) {
9191
return { recipeId, src };
9292
}
9393
};

packages/charm/src/iframe/static.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ const libraries = {
1919
},
2020
};
2121

22-
const jsonRegex = new RegExp(
23-
"```(?:json)?\s*(\{[\s\S]*?\})\s*```|(\{[\s\S]*\})",
24-
);
25-
2622
// The HTML template that wraps the developer's code
2723
export const prefillHtml = `<html>
2824
<head>

packages/charm/src/iterate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export async function iterate(
110110
options?: GenerationOptions,
111111
): Promise<{ cell: Cell<unknown>; llmRequestId?: string }> {
112112
const optionsWithDefaults = applyDefaults(options);
113-
const { model, cache, space, generationId } = optionsWithDefaults;
113+
const { generationId } = optionsWithDefaults;
114114
const { iframe } = getIframeRecipe(charm, charmManager.runtime);
115115

116116
const prevSpec = iframe?.spec;

0 commit comments

Comments
 (0)