File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ git add -A
1919git commit -m "<type>: <description>"
2020
2121# 3. Run checks before pushing (see post-change-checks rule)
22- bun run typecheck && trunk check --fix && bun test
22+ bun run typecheck && trunk check --fix && bun test && bun run knip
2323
2424# 4. Push and open PR
2525git push origin <branch>
Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ channels/telegram.ts (formatBriefingForTelegram)
1001001 . Create ` src/sources/my-source.ts ` with:
101101
102102 ``` typescript
103+ import type { DataSource } from " ../types" ;
104+
103105 export const mySource: DataSource = {
104106 name: " My Source" ,
105107 priority: 5 , // lower = higher in briefing
@@ -124,6 +126,18 @@ from `fetch`. The orchestrator flattens arrays automatically.
124126
125127---
126128
129+ ## Code Style
130+
131+ - ** No classes** — factory functions returning interfaces (e.g. ` createTelegramChannel ` )
132+ - ** Functional style** — ` const ` arrow functions, pure where possible
133+ - ** Named exports only** — no default exports
134+ - ** File naming** — kebab-case (` etf-flows.ts ` , not ` etfFlows.ts ` )
135+ - ** No ` any ` ** — strict TypeScript, ` noUncheckedIndexedAccess ` enabled
136+ - ** Error handling** — sources never throw; orchestrator catches via ` Promise.allSettled `
137+ - ** Telegram formatting** — MarkdownV2 requires escaping special chars; use ` escapeMarkdown() ` in ` telegram.ts `
138+
139+ ---
140+
127141## Local Dev
128142
129143``` bash
@@ -144,6 +158,7 @@ Always run these before committing (not just before pushing):
144158bun run typecheck # Catch type errors
145159trunk check --fix # Lint + format (catches unused imports etc.)
146160bun test # Full test suite
161+ bun run knip # Dead code detection
147162```
148163
149164See ` .cursor/rules/post-change-checks.mdc ` for the full decision tree.
You can’t perform that action at this time.
0 commit comments