refactor(lint): fix lint errors - unused imports and variables

- Add *.d.ts to oxlint ignore patterns
- Remove unused imports from test files
- Prefix unused variables with underscore
- Fix floating promises with void operator

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Shunsuke Hayashi 2026-01-26 13:13:29 +09:00
parent 8ffe18aaee
commit 319d65ccd3
12 changed files with 14 additions and 15 deletions

View File

@ -8,5 +8,5 @@
"categories": {
"correctness": "error"
},
"ignorePatterns": ["src/canvas-host/a2ui/a2ui.bundle.js"]
"ignorePatterns": ["src/canvas-host/a2ui/a2ui.bundle.js", "**/*.d.ts"]
}

View File

@ -7,7 +7,6 @@
import type { Message } from "@buape/carbon";
import type { ReplyOptions, ReplyData, ReplyEmbed, QuoteMetadata, ReplyAuthor } from "./types.js";
import { ResponseFormat } from "./types.js";
/**
* Discordリプライオプション拡張

View File

@ -4,7 +4,6 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
runCodexReview,
parseCodexOutput,
createReviewRequest,
evaluateReview,

View File

@ -6,7 +6,7 @@
import { exec } from "child_process";
import { promisify } from "util";
import { mkdtempSync, writeFileSync, unlinkSync, rmSync, rmdirSync } from "node:fs";
import { mkdtempSync, writeFileSync, unlinkSync, rmdirSync } from "node:fs";
import { join } from "node:path";
import type {
CodexReview,

View File

@ -3,7 +3,6 @@
*/
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { SessionStatus } from "./types.js";
// DynamoDBモック
vi.mock("@aws-sdk/client-dynamodb");

View File

@ -69,7 +69,7 @@ export async function recoverPendingSessions(
// 期限切れチェック
const validSessions = sessions.filter((s) => {
if (Date.now() > s.metadata.expiresAt * 1000) {
deleteSession(s.metadata.sessionId);
void deleteSession(s.metadata.sessionId);
result.expired++;
return false;
}

View File

@ -204,7 +204,7 @@ function withTimeout<T>(
}, timeoutMs);
// Promiseが解決したらクリアンアップキャンセルされても実行
promise.finally?.(() => clearTimeout(timeoutId));
void promise.finally?.(() => clearTimeout(timeoutId));
}),
]);
}

View File

@ -63,7 +63,10 @@ import { ThetaPhase } from "./types.js";
/**
* θ
*/
export function createThetaCycleState(runId: string, options?: ThetaCycleOptions): ThetaCycleState {
export function createThetaCycleState(
runId: string,
_options?: ThetaCycleOptions,
): ThetaCycleState {
return {
runId,
startTime: Date.now(),
@ -127,7 +130,7 @@ export async function runThetaCycle<T = unknown>(
const improveState = improveResult.state;
// サマリー生成
const summary = generateCycleSummary(improveState);
const _summary = generateCycleSummary(improveState);
// オプションのコールバック
if (options?.onEvent) {

View File

@ -467,7 +467,7 @@ ${handoff.context}
// Simulate θサイクル
["observe", "analyze", "decide", "allocate", "execute", "improve"].forEach(() => {
// Simulate phase
1 + 1;
void 1;
});
const cycleEnd = Date.now();

View File

@ -9,8 +9,8 @@
* - Session-based agent selection
*/
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { mkdirSync, rmSync, existsSync, writeFileSync } from "fs";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { mkdirSync, rmSync, existsSync } from "fs";
import { join } from "path";
import { tmpdir } from "os";
import { randomBytes } from "crypto";

View File

@ -42,7 +42,6 @@ import {
getModelRefStatus,
resolveAllowedModelRef,
resolveThinkingDefault,
type ModelRef,
type ThinkLevel,
} from "../../src/agents/model-selection.js";
@ -864,7 +863,7 @@ describe("Engine Unit Tests", () => {
},
});
const primary = resolveAgentModelPrimary(cfg, "main");
const _primary = resolveAgentModelPrimary(cfg, "main");
const fallbacks = resolveAgentModelFallbacksOverride(cfg, "main");
// main agent has no model override, so it inherits from defaults

View File

@ -9,7 +9,7 @@
* - Error handling and retries
*/
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
// Mock MCP tool types
interface MCPTool {