ci: add eslint
This commit is contained in:
@@ -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,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}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user