···2828 cp src/rules/posts/constants.example.ts src/rules/posts/constants.ts
2929 cp src/rules/profiles/constants.example.ts src/rules/profiles/constants.ts
30303131- # - name: Run linter
3232- # run: npm run lint
3131+ - name: Run linter
3232+ run: bun run lint
33333434 - name: Type check
3535 run: bun run type-check
···11-import { Checks } from "../../types.js";
11+import type { Checks } from "../../types.js";
2233/**
44 * Example handle check configurations
+14-14
src/rules/posts/checkPosts.ts
···66} from "../../accountModeration.js";
77import { logger } from "../../logger.js";
88import { createPostLabel, createPostReport } from "../../moderation.js";
99-import { Post } from "../../types.js";
99+import type { Post } from "../../types.js";
1010import { getFinalUrl } from "../../utils/getFinalUrl.js";
1111import { getLanguage } from "../../utils/getLanguage.js";
1212import { countStarterPacks } from "../account/countStarterPacks.js";
···102102 }
103103 }
104104105105- countStarterPacks(post[0].did, post[0].time);
105105+ void countStarterPacks(post[0].did, post[0].time);
106106107107- if (checkPost.toLabel === true) {
108108- createPostLabel(
107107+ if (checkPost.toLabel) {
108108+ void createPostLabel(
109109 post[0].atURI,
110110 post[0].cid,
111111- `${checkPost.label}`,
112112- `${post[0].time}: ${checkPost.comment} at ${post[0].atURI} with text "${post[0].text}"`,
111111+ checkPost.label,
112112+ `${post[0].time.toString()}: ${checkPost.comment} at ${post[0].atURI} with text "${post[0].text}"`,
113113 checkPost.duration,
114114 post[0].did,
115115 post[0].time,
···126126 },
127127 "Reporting post",
128128 );
129129- createPostReport(
129129+ void createPostReport(
130130 post[0].atURI,
131131 post[0].cid,
132132- `${post[0].time}: ${checkPost.comment} at ${post[0].atURI} with text "${post[0].text}"`,
132132+ `${post[0].time.toString()}: ${checkPost.comment} at ${post[0].atURI} with text "${post[0].text}"`,
133133 );
134134 }
135135136136- if (checkPost.reportAcct === true) {
136136+ if (checkPost.reportAcct) {
137137 logger.info(
138138 {
139139 process: "CHECKPOSTS",
···143143 },
144144 "Reporting account",
145145 );
146146- createAccountReport(
146146+ void createAccountReport(
147147 post[0].did,
148148- `${post[0].time}: ${checkPost.comment} at ${post[0].atURI} with text "${post[0].text}"`,
148148+ `${post[0].time.toString()}: ${checkPost.comment} at ${post[0].atURI} with text "${post[0].text}"`,
149149 );
150150 }
151151152152- if (checkPost.commentAcct === true) {
153153- createAccountComment(
152152+ if (checkPost.commentAcct) {
153153+ void createAccountComment(
154154 post[0].did,
155155- `${post[0].time}: ${checkPost.comment} at ${post[0].atURI} with text "${post[0].text}"`,
155155+ `${post[0].time.toString()}: ${checkPost.comment} at ${post[0].atURI} with text "${post[0].text}"`,
156156 post[0].atURI,
157157 );
158158 }
+7-1
src/rules/posts/tests/checkPosts.test.ts
···11+22+33+44+55+66+17import { beforeEach, describe, expect, it, vi } from "vitest";
28import {
39 createAccountComment,
···511} from "../../../accountModeration.js";
612import { logger } from "../../../logger.js";
713import { createPostLabel, createPostReport } from "../../../moderation.js";
88-import { Post } from "../../../types.js";
1414+import type { Post } from "../../../types.js";
915import { getFinalUrl } from "../../../utils/getFinalUrl.js";
1016import { getLanguage } from "../../../utils/getLanguage.js";
1117import { countStarterPacks } from "../../account/countStarterPacks.js";
···11+22+33+44+55+66+17import { beforeEach, describe, expect, it, vi } from "vitest";
28import {
39 createAccountComment,
+1
src/tests/accountThreshold.test.ts
···11+12import { afterEach, describe, expect, it, vi } from "vitest";
23import {
34 createAccountComment,
+6-3
src/tests/agent.test.ts
···11+12import { beforeEach, describe, expect, it, vi } from "vitest";
2334describe("Agent", () => {
···3031 const { agent, login } = await import("../agent.js");
31323233 // Check that the agent was created with the correct service URL
3333- expect(mockConstructor).toHaveBeenCalledWith({
3434- service: "https://pds.test.com",
3535- });
3434+ expect(mockConstructor).toHaveBeenCalledWith(
3535+ expect.objectContaining({
3636+ service: "https://pds.test.com",
3737+ }),
3838+ );
3639 expect(agent.service.toString()).toBe("https://pds.test.com/");
37403841 // Check that the login function calls the mockLogin function
+3-3
src/tests/metrics.test.ts
···11-import { Server } from "http";
11+import type { Server } from "http";
22import request from "supertest";
33-import { describe, expect, it } from "vitest";
33+import { afterEach, describe, expect, it } from "vitest";
44import { startMetricsServer } from "../metrics.js";
5566describe("Metrics Server", () => {
77- let server: Server;
77+ let server: Server | undefined;
8899 afterEach(() => {
1010 if (server) {
+5-1
src/tests/moderation.test.ts
···11+22+33+44+55+16import { beforeEach, describe, expect, it, vi } from "vitest";
27// --- Imports Second ---
38import { checkAccountLabels } from "../accountModeration.js";
49import { agent } from "../agent.js";
55-import { logger } from "../logger.js";
610import { createPostLabel } from "../moderation.js";
711import { tryClaimPostLabel } from "../redis.js";
812
+1
src/tests/redis.test.ts
···11+12// Import the mocked redis first to get a reference to the mock client
23import { createClient } from "redis";
34import { afterEach, describe, expect, it, vi } from "vitest";
+8-15
src/types.ts
···11+import type * as AppBskyRichtextFacet from "@atproto/ozone/dist/lexicon/types/app/bsky/richtext/facet.js";
22+13export interface Checks {
24 language?: string[];
35 label: string;
···3840 description?: string;
3941}
40424141-// Define the type for the link feature
4242-export interface LinkFeature {
4343- $type: "app.bsky.richtext.facet#link";
4444- uri: string;
4545-}
4646-4743export interface List {
4844 label: string;
4945 rkey: string;
5046}
51475252-export interface FacetIndex {
5353- byteStart: number;
5454- byteEnd: number;
5555-}
5656-5757-export interface Facet {
5858- index: FacetIndex;
5959- features: Array<{ $type: string; [key: string]: any }>;
6060-}
4848+// Re-export facet types from @atproto/ozone for convenience
4949+export type Facet = AppBskyRichtextFacet.Main;
5050+export type FacetIndex = AppBskyRichtextFacet.ByteSlice;
5151+export type FacetMention = AppBskyRichtextFacet.Mention;
5252+export type LinkFeature = AppBskyRichtextFacet.Link;
5353+export type FacetTag = AppBskyRichtextFacet.Tag;
61546255export interface AccountAgeCheck {
6356 monitoredDIDs?: string[]; // DIDs to monitor for replies (optional if monitoredPostURIs is provided)