From ed157cb4df3a96f8727365ca8b46d96ac213d250 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Mon, 9 Feb 2026 12:03:03 +0100 Subject: [PATCH] lint: format and lint --- jetstream.ts | 26 ++++++++++++++------------ server.ts | 2 +- src/data/db.ts | 6 +++--- src/data/note.ts | 14 +++++++------- src/migrations/init.ts | 4 ++-- 5 files changed, 27 insertions(+), 25 deletions(-) diff --git a/jetstream.ts b/jetstream.ts index d71904d..93bdc65 100644 --- a/jetstream.ts +++ b/jetstream.ts @@ -1,38 +1,40 @@ import { Jetstream } from "@skyware/jetstream"; -import { upsertNote } from "./src/data/db" +import { upsertNote } from "./src/data/db.ts"; const jetstream = new Jetstream({ - wantedCollections: ["space.litenote.note"], + wantedCollections: ["space.litenote.note"], }); jetstream.onCreate("space.litenote.note", (event) => { - console.log("create", event); - const {did, commit: {rkey, record}} = event + console.log("create", event); + const { did, commit: { rkey, record } } = event; upsertNote({ did, rkey, - ...record - } as any) + ...record, + // deno-lint-ignore no-explicit-any + } as any); }); jetstream.onUpdate("space.litenote.note", (event) => { - console.log("update", event); - const {did, commit: {rkey, record}} = event + console.log("update", event); + const { did, commit: { rkey, record } } = event; upsertNote({ did, rkey, - ...record - } as any) + ...record, + // deno-lint-ignore no-explicit-any + } as any); }); jetstream.on("close", () => { - console.log("Connection closed"); + console.log("Connection closed"); }); jetstream.on("error", (error) => { - console.log("Connection closed with error", error); + console.log("Connection closed with error", error); }); console.log("launching jetstream"); diff --git a/server.ts b/server.ts index 1892313..7080cf8 100644 --- a/server.ts +++ b/server.ts @@ -10,4 +10,4 @@ const app = new Application(); app.use(router.routes()); app.use(router.allowedMethods()); -app.listen({port: 8080}); +app.listen({ port: 8080 }); diff --git a/src/data/db.ts b/src/data/db.ts index c1edd24..159a97b 100644 --- a/src/data/db.ts +++ b/src/data/db.ts @@ -1,9 +1,9 @@ import { DB } from "https://deno.land/x/sqlite/mod.ts"; -import type { Note } from "./note" +import type { Note } from "./note.ts"; export const db = new DB(Deno.env.get("SQLITE_PATH") ?? "notes.db"); -export const upsertNote = async (note: Note) => { +export const upsertNote = (note: Note) => { db.query( ` INSERT INTO note ( @@ -30,4 +30,4 @@ export const upsertNote = async (note: Note) => { note.rkey, ], ); -} +}; diff --git a/src/data/note.ts b/src/data/note.ts index bd4346b..ca6bdd2 100644 --- a/src/data/note.ts +++ b/src/data/note.ts @@ -1,8 +1,8 @@ export type Note = { - did: string - rkey: string - title: string - content: string - publishedAt: Date - createdAt: Date -} \ No newline at end of file + did: string; + rkey: string; + title: string; + content: string; + publishedAt: Date; + createdAt: Date; +}; diff --git a/src/migrations/init.ts b/src/migrations/init.ts index 149a4b2..7c7af69 100644 --- a/src/migrations/init.ts +++ b/src/migrations/init.ts @@ -1,4 +1,4 @@ -import { db } from "../data/db" +import { db } from "../data/db"; db.execute(` CREATE TABLE IF NOT EXISTS note ( @@ -12,4 +12,4 @@ db.execute(` ); `); -db.close(); \ No newline at end of file +db.close();