refactor(cli): remove unused imports and variables
Eliminates no-unused-vars warnings across the CLI package by dropping dead type imports, unused destructured helpers, and simplifying try/catch blocks whose caught errors and intermediate results were never read. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,12 +10,10 @@
|
||||
|
||||
import { existsSync, mkdirSync, writeFileSync, readFileSync } from "node:fs";
|
||||
import { join, resolve, basename } from "node:path";
|
||||
import { homedir } from "node:os";
|
||||
import { exec } from "node:child_process";
|
||||
import { promisify } from "node:util";
|
||||
const execAsync = promisify(exec);
|
||||
import { CentralCore, QMD_INSTALL_COMMAND, isQmdAvailable } from "@fusion/core";
|
||||
import { resolveGlobalDir } from "@fusion/core";
|
||||
import { maybeInstallClaudeSkillForNewProject } from "./claude-skills-runner.js";
|
||||
|
||||
/** Options for the init command */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type MissionStatus, type MilestoneStatus, type SliceStatus, type FeatureStatus } from "@fusion/core";
|
||||
import { type MilestoneStatus, type SliceStatus, type FeatureStatus } from "@fusion/core";
|
||||
import { createInterface } from "node:readline/promises";
|
||||
import { getStore } from "../project-resolver.js";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CentralCore, type NodeConfig, type SystemMetrics } from "@fusion/core";
|
||||
import { CentralCore, type NodeConfig } from "@fusion/core";
|
||||
import { createInterface } from "node:readline/promises";
|
||||
|
||||
// ── Options Interfaces ───────────────────────────────────────────────────────
|
||||
|
||||
@@ -25,7 +25,6 @@ function toTitleCase(str: string): string {
|
||||
* Generate package.json template
|
||||
*/
|
||||
function generatePackageJson(name: string): string {
|
||||
const titleCase = toTitleCase(name);
|
||||
return JSON.stringify(
|
||||
{
|
||||
name: `@fusion-plugin-examples/${name}`,
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
import { resolve, isAbsolute, relative, basename } from "node:path";
|
||||
import { existsSync, statSync } from "node:fs";
|
||||
import { createInterface } from "node:readline/promises";
|
||||
import { formatProjectLine, detectProjectFromCwd, setDefaultProject, resolveProject as resolveProjectContext } from "../project-context.js";
|
||||
import { detectProjectFromCwd, setDefaultProject } from "../project-context.js";
|
||||
import { maybeInstallClaudeSkillForNewProject } from "./claude-skills-runner.js";
|
||||
|
||||
const VALID_ISOLATION_MODES: IsolationMode[] = ["in-process", "child-process"];
|
||||
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
processPullRequestMergeTask,
|
||||
} from "./task-lifecycle.js";
|
||||
import { promptForPort } from "./port-prompt.js";
|
||||
import { createReadOnlyProviderSettingsView, createProjectSettingsPersistence } from "./provider-settings.js";
|
||||
import { createReadOnlyProviderSettingsView } from "./provider-settings.js";
|
||||
import { createReadOnlyAuthFileStorage, mergeAuthStorageReads, wrapAuthStorageWithApiKeyProviders } from "./provider-auth.js";
|
||||
import { getFusionAuthPath, getLegacyAuthPaths, getModelRegistryModelsPath, getPackageManagerAgentDir } from "./auth-paths.js";
|
||||
import { resolveProject } from "../project-context.js";
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* - fn skills install <owner/repo> - Install skills from a source
|
||||
*/
|
||||
|
||||
import { spawn, type ChildProcess } from "node:child_process";
|
||||
import { spawn } from "node:child_process";
|
||||
|
||||
/**
|
||||
* Skill entry from the skills.sh /api/search endpoint.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TaskStore, COLUMNS, COLUMN_LABELS, type Column, type MergeResult, type StepStatus, type AgentLogType, type AgentLogEntry, type Task } from "@fusion/core";
|
||||
import { TaskStore, COLUMNS, COLUMN_LABELS, type Column, type StepStatus, type AgentLogType, type AgentLogEntry } from "@fusion/core";
|
||||
import { aiMergeTask } from "@fusion/engine";
|
||||
import { createInterface } from "node:readline/promises";
|
||||
import type { PlanningQuestion, PlanningSummary } from "@fusion/core";
|
||||
@@ -60,7 +60,7 @@ async function getCommandContext(projectName?: string): Promise<CommandContext>
|
||||
projectName: context.projectName,
|
||||
explicit: false,
|
||||
};
|
||||
} catch (error) {
|
||||
} catch {
|
||||
const store = new TaskStore(process.cwd());
|
||||
await store.init();
|
||||
return {
|
||||
@@ -331,7 +331,6 @@ export async function runTaskLogs(id: string, options: LogsOptions = {}, project
|
||||
|
||||
// Follow mode: watch for new entries
|
||||
if (options.follow) {
|
||||
const followStore = store;
|
||||
const projectPath = projectContext?.projectPath ?? process.cwd();
|
||||
const logPath = join(projectPath, ".fusion", "tasks", id, "agent.log");
|
||||
|
||||
@@ -666,10 +665,9 @@ export async function runTaskDelete(id: string, force?: boolean, projectName?: s
|
||||
const store = await getStore(projectName);
|
||||
|
||||
// Check if task exists first
|
||||
let task;
|
||||
try {
|
||||
task = await store.getTask(id);
|
||||
} catch (err: any) {
|
||||
await store.getTask(id);
|
||||
} catch {
|
||||
console.error(`✗ Task ${id} not found`);
|
||||
process.exit(1);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user