ci: add eslint

This commit is contained in:
2026-07-13 10:38:23 +05:00
parent 72f272246f
commit 06e059367e
5 changed files with 1698 additions and 6 deletions
+2 -2
View File
@@ -42,9 +42,9 @@ describe("FsTaskRepository", () => {
});
it("list returns created tasks sorted by updated desc", async () => {
const a = await repo.create(folder, { ...sampleTask, title: "A" });
await repo.create(folder, { ...sampleTask, title: "A" });
await delay(10);
const b = await repo.create(folder, { ...sampleTask, title: "B" });
await repo.create(folder, { ...sampleTask, title: "B" });
const tasks = await repo.list(folder);
expect(tasks).toHaveLength(2);
+3 -1
View File
@@ -3,6 +3,8 @@ import { IFileSystem, ITaskRepository } from "@/ports";
import { parseTaskFile, serializeTask } from "@/utils/markdown";
import { generateId } from "@/utils/uuid";
const MAX_SAFE_NAME_LENGTH = 80;
export class FsTaskRepository implements ITaskRepository {
constructor(
private fs: IFileSystem,
@@ -93,7 +95,7 @@ export class FsTaskRepository implements ITaskRepository {
.toLowerCase()
.replace(/[^a-z0-9\u0400-\u04FF]+/g, "-")
.replace(/^-|-$/g, "")
.slice(0, 80);
.slice(0, MAX_SAFE_NAME_LENGTH);
return this.joinPath(folderPath, `${safeName}${this.fileExtension}`);
}