fix: 修复 oxlint 报告的代码质量问题

This commit is contained in:
2026-06-09 14:33:15 +08:00
parent 6ebfe24921
commit 5a7b8f1dcc
5 changed files with 4 additions and 11 deletions

View File

@@ -1 +0,0 @@
export {};

View File

@@ -29,7 +29,7 @@ export async function scanChanges(
const fileName = `${docConfig.name}.md`; const fileName = `${docConfig.name}.md`;
const completed = mdFiles.has(fileName); const completed = mdFiles.has(fileName);
const deps = docConfig.depend ?? []; const deps = docConfig.depend ?? [];
const dependMet = deps.length === 0 || deps.every((dep) => mdFiles.has(`${dep}.md`)); const dependMet = deps.every((dep) => mdFiles.has(`${dep}.md`));
return { name: docConfig.name, completed, dependMet }; return { name: docConfig.name, completed, dependMet };
}); });
} else { } else {

View File

@@ -1,11 +1,5 @@
import { describe, it, expect } from "bun:test"; import { describe, it, expect } from "bun:test";
import { import { UsageError, ConfigError, InternalError } from "../../src/cli/errors.ts";
CliError,
UsageError,
ConfigError,
CommandError,
InternalError,
} from "../../src/cli/errors.ts";
import { mapError } from "../../src/cli.ts"; import { mapError } from "../../src/cli.ts";
describe("mapError", () => { describe("mapError", () => {

View File

@@ -1,6 +1,6 @@
import { describe, it, expect } from "bun:test"; import { describe, it, expect } from "bun:test";
import { formatError } from "../../src/cli/output.ts"; import { formatError } from "../../src/cli/output.ts";
import { UsageError, ConfigError, CommandError, InternalError } from "../../src/cli/errors.ts"; import { UsageError, ConfigError, InternalError } from "../../src/cli/errors.ts";
describe("formatError", () => { describe("formatError", () => {
it("只输出错误行(无 hint/usage", () => { it("只输出错误行(无 hint/usage", () => {

View File

@@ -1,6 +1,6 @@
import { describe, it, expect, beforeEach, afterEach } from "bun:test"; import { describe, it, expect, beforeEach, afterEach } from "bun:test";
import { existsSync } from "node:fs"; import { existsSync } from "node:fs";
import { mkdir, writeFile, rm, readFile, rename } from "node:fs/promises"; import { mkdir, writeFile, rm, rename } from "node:fs/promises";
import { join } from "node:path"; import { join } from "node:path";
import { runInit } from "../../src/commands/init.ts"; import { runInit } from "../../src/commands/init.ts";
import { loadConfig, getChangeDir, getArchiveDir } from "../../src/core/config.ts"; import { loadConfig, getChangeDir, getArchiveDir } from "../../src/core/config.ts";