fix: 修复 oxlint 报告的代码质量问题
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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", () => {
|
||||||
|
|||||||
@@ -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)", () => {
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user