fix: resolve fallow dead-code check failures #9

Merged
alex merged 1 commit from pi/issue8-1784395660097 into master 2026-07-18 17:29:01 +00:00
Contributor

Summary

deno task fallow (fallow dead-code --fail-on-issues) was failing on master with two issues. This fixes both so the check goes green.

Changes

1. scripts/chatto-token.ts flagged as an unused file

.fallowrc.json already listed "scripts/" under ignorePatterns, but fallow's glob matcher does not match the bare trailing-slash directory form, so the standalone CLI helper (deno task chatto:token) was still being reported as unreachable from the src/main.ts entry point.

Changed the pattern to "scripts/**", which fallow actually honours. This matches the author's clear intent (the script is a standalone entry point, not dead code). The other directory patterns (dist/, node_modules/, …) happen to contain no scannable files, which is why the same latent bug never surfaced for them.

2. Duplicate export ChattoConfig

ChattoConfig was exported from both src/chatto.ts (the API connection shape: baseUrl, token, roomId) and src/config.ts (the same three fields plus the notification message template), which fallow flags as a duplicate export.

Resolved by making chatto.ts the single canonical owner of ChattoConfig, and having config.ts import it (type-only) and define a richer ChattoSettings extends ChattoConfig that adds the message field. This:

  • removes the name collision,
  • keeps the correct dependency direction (configchatto, the module it configures; chatto.ts stays free of bot coupling),
  • requires no changes to chatto.ts/chatto_test.ts,
  • stays structurally compatible everywhere (ChattoSettings is assignable to ChattoConfig, so main.ts still passes it straight to notifyChatto).

main.ts was updated to import/use ChattoSettings instead of the removed config.ts re-export.

Verification

  • deno task fallow → ✓ No issues found
  • deno task check
  • deno lint
  • deno fmt --check
  • deno task test → 54 passed
## Summary `deno task fallow` (`fallow dead-code --fail-on-issues`) was failing on `master` with two issues. This fixes both so the check goes green. ## Changes ### 1. `scripts/chatto-token.ts` flagged as an unused file `.fallowrc.json` already listed `"scripts/"` under `ignorePatterns`, but fallow's glob matcher does not match the bare trailing-slash directory form, so the standalone CLI helper (`deno task chatto:token`) was still being reported as unreachable from the `src/main.ts` entry point. Changed the pattern to `"scripts/**"`, which fallow actually honours. This matches the author's clear intent (the script is a standalone entry point, not dead code). The other directory patterns (`dist/`, `node_modules/`, …) happen to contain no scannable files, which is why the same latent bug never surfaced for them. ### 2. Duplicate export `ChattoConfig` `ChattoConfig` was exported from **both** `src/chatto.ts` (the API connection shape: `baseUrl`, `token`, `roomId`) and `src/config.ts` (the same three fields plus the notification `message` template), which fallow flags as a duplicate export. Resolved by making `chatto.ts` the single canonical owner of `ChattoConfig`, and having `config.ts` import it (type-only) and define a richer `ChattoSettings extends ChattoConfig` that adds the `message` field. This: - removes the name collision, - keeps the correct dependency direction (`config` → `chatto`, the module it configures; `chatto.ts` stays free of bot coupling), - requires no changes to `chatto.ts`/`chatto_test.ts`, - stays structurally compatible everywhere (`ChattoSettings` is assignable to `ChattoConfig`, so `main.ts` still passes it straight to `notifyChatto`). `main.ts` was updated to import/use `ChattoSettings` instead of the removed `config.ts` re-export. ## Verification - `deno task fallow` → ✓ No issues found - `deno task check` ✅ - `deno lint` ✅ - `deno fmt --check` ✅ - `deno task test` → 54 passed ✅
fix: resolve fallow dead-code check failures
All checks were successful
PR / deno (pull_request) Successful in 19s
PR / fallow (pull_request) Successful in 26s
Build and Push Container Image / build-and-push-1 (push) Successful in 37s
Build and Push Container Image / build-and-push (push) Successful in 0s
Build and Push Container Image / deploy-1 (push) Successful in 4s
Build and Push Container Image / deploy (push) Successful in 0s
e4cf561059
Co-authored-by: alex <alex@forge.l3x.in>
alex merged commit e4cf561059 into master 2026-07-18 17:29:01 +00:00
alex deleted branch pi/issue8-1784395660097 2026-07-18 17:29:01 +00:00
Sign in to join this conversation.
No reviewers
No labels
dependencies
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alex/irc-greeter-bot!9
No description provided.