xonecas.io
64875
Mc

mini-coder / commit d4c7875

chore(lint): tighten biome rules and fix violations

Sean2026-03-01 d4c7875e4c3f0eeed67f4a5bfbb5e276d029c612 parent a91fbc7

9 files changed

biome.json+23−1
@@ -10,11 +10,33 @@
1010 "enabled": true,
1111 "rules": {
1212 "recommended": true,
13+ "suspicious": {
14+ "noDebugger": "error",
15+ "noExplicitAny": "error"
16+ },
17+ "style": {
18+ "noNonNullAssertion": "error",
19+ "noParameterAssign": "error",
20+ "useConst": "error"
21+ },
22+ "complexity": {
23+ "noUselessCatch": "error"
24+ },
25+ "suspicious": {
26+ "noDebugger": "error",
27+ "noExplicitAny": "error",
28+ "noConsoleLog": "error"
29+ },
1330 "correctness": {
14- "noUnusedVariables": "error"
31+ "noUnusedVariables": "error",
32+ "noUnusedImports": "error",
33+ "noUndeclaredVariables": "error"
1534 }
1635 }
1736 },
37+ "javascript": {
38+ "globals": ["Bun", "Timer"]
39+ },
1840 "files": {
1941 "ignore": ["node_modules", "dist"]
2042 }
src/agent/agent.ts+7−56
@@ -1,68 +1,19 @@
1-import { existsSync, readFileSync } from "node:fs";
2-import { join } from "node:path";
31 import * as c from "yoctocolors";
42 import { loadAgents } from "../cli/agents.ts";
5-import { type CommandContext, handleCommand } from "../cli/commands.ts";
6-import {
7- type ImageAttachment,
8- isImageFilename,
9- loadImageFile,
10-} from "../cli/image-types.ts";
11-import { readline, type InputResult, watchForInterrupt } from "../cli/input.ts";
12-import {
13- PREFIX,
14- formatSubagentLabel,
15- tildePath,
16- writeln,
17-} from "../cli/output.ts";
18-import { loadSkills } from "../cli/skills.ts";
3+import type { CommandContext } from "../cli/commands.ts";
4+import { tildePath } from "../cli/output.ts";
195 import type { AgentReporter } from "./reporter.ts";
206
21-import {
22- getContextWindow,
23- parseModelString,
24- resolveModel,
25-} from "../llm-api/providers.ts";
26-import { type CoreMessage, runTurn } from "../llm-api/turn.ts";
7+import { getContextWindow } from "../llm-api/providers.ts";
278 import type { ToolDef } from "../llm-api/types.ts";
289 import { connectMcpServer } from "../mcp/client.ts";
29-import {
30- type SnapshotRestoreResult,
31- restoreSnapshot,
32- takeSnapshot,
33-} from "../tools/snapshot.ts";
34-import type { SubagentOutput } from "../tools/subagent.ts";
35-
36-import {
37- deleteAllSnapshots,
38- deleteLastTurn,
39- deleteSnapshot,
40- getConfigDir,
41- getMaxTurnIndex,
42- listMcpServers,
43- saveMessages,
44- setPreferredModel,
45-} from "../session/db/index.ts";
46-
47-import {
48- type ActiveSession,
49- newSession,
50- resumeSession,
51- touchActiveSession,
52-} from "../session/manager.ts";
10+
11+import { listMcpServers, setPreferredModel } from "../session/db/index.ts";
5312 import { createSubagentRunner } from "./subagent-runner.ts";
54-import { buildReadOnlyToolSet, buildToolSet } from "./tools.ts";
13+import { buildToolSet } from "./tools.ts";
5514 import { undoLastTurn } from "./undo-snapshot.ts";
5615
57-import {
58- extractAssistantText,
59- getGitBranch,
60- hasRalphSignal,
61- makeInterruptMessage,
62- resolveFileRefs,
63- runShellPassthrough,
64-} from "./agent-helpers.ts";
65-import { buildSystemPrompt } from "./system-prompt.ts";
16+import { getGitBranch } from "./agent-helpers.ts";
6617
6718 import { runInputLoop } from "./input-loop.ts";
6819 import { SessionRunner } from "./session-runner.ts";
src/agent/session-runner.ts+1−3
@@ -1,14 +1,12 @@
11 import * as c from "yoctocolors";
22 import type { ImageAttachment } from "../cli/image-types.ts";
33 import { watchForInterrupt } from "../cli/input.ts";
4-import { getContextWindow, resolveModel } from "../llm-api/providers.ts";
4+import { resolveModel } from "../llm-api/providers.ts";
55 import type { CoreMessage } from "../llm-api/turn.ts";
66 import { runTurn } from "../llm-api/turn.ts";
77 import type { ToolDef } from "../llm-api/types.ts";
88 import {
99 deleteAllSnapshots,
10- deleteLastTurn,
11- deleteSnapshot,
1210 getMaxTurnIndex,
1311 saveMessages,
1412 } from "../session/db/index.ts";
src/agent/subagent-runner.ts+1−1
@@ -1,6 +1,6 @@
11 import { loadAgents } from "../cli/agents.ts";
22 import { formatSubagentLabel } from "../cli/output.ts";
3-import { parseModelString, resolveModel } from "../llm-api/providers.ts";
3+import { resolveModel } from "../llm-api/providers.ts";
44 import { type CoreMessage, runTurn } from "../llm-api/turn.ts";
55 import type { SubagentOutput } from "../tools/subagent.ts";
66 import type { AgentReporter } from "./reporter.ts";
src/cli/agents.ts+0−5
@@ -1,8 +1,3 @@
1-import { existsSync, readFileSync, readdirSync } from "node:fs";
2-import { homedir } from "node:os";
3-import { basename, join } from "node:path";
4-import { parseFrontmatter } from "./frontmatter.ts";
5-
61 // ─── Types ────────────────────────────────────────────────────────────────────
72
83 import { loadMarkdownConfigs } from "./load-markdown-configs.ts";
src/cli/commands.ts+1−1
@@ -14,7 +14,7 @@ import {
1414 loadCustomCommands,
1515 } from "./custom-commands.ts";
1616 import { renderMarkdown } from "./markdown.ts";
17-import { PREFIX, renderError, renderInfo, write, writeln } from "./output.ts";
17+import { PREFIX, write, writeln } from "./output.ts";
1818 import { loadSkills } from "./skills.ts";
1919
2020 // ─── Types ────────────────────────────────────────────────────────────────────
src/cli/custom-commands.ts+0−6
@@ -1,9 +1,3 @@
1-import { existsSync, readFileSync, readdirSync } from "node:fs";
2-import { homedir } from "node:os";
3-import { basename, join } from "node:path";
4-import { warnConventionConflicts } from "./config-conflicts.ts";
5-import { parseFrontmatter } from "./frontmatter.ts";
6-
71 // ─── Types ────────────────────────────────────────────────────────────────────
82
93 import { loadMarkdownConfigs } from "./load-markdown-configs.ts";
src/cli/output-reporter.ts+0−2
@@ -5,10 +5,8 @@ import type {
55 SubagentEventData,
66 TurnResult,
77 } from "../agent/reporter.ts";
8-import type { CoreMessage } from "../llm-api/turn.ts";
98 import type { TurnEvent } from "../llm-api/types.ts";
109 import {
11- PREFIX,
1210 Spinner,
1311 renderError,
1412 renderHook,
src/cli/skills.ts+0−6
@@ -1,9 +1,3 @@
1-import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
2-import { homedir } from "node:os";
3-import { join } from "node:path";
4-import { warnConventionConflicts } from "./config-conflicts.ts";
5-import { parseFrontmatter } from "./frontmatter.ts";
6-
71 // ─── Types ────────────────────────────────────────────────────────────────────
82
93 import { loadMarkdownConfigs } from "./load-markdown-configs.ts";