generated from alex/base-template
fix: resolve fallow dead-code check failures #9
No reviewers
Labels
No labels
dependencies
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
alex/irc-greeter-bot!9
Loading…
Reference in a new issue
No description provided.
Delete branch "pi/issue8-1784395660097"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
deno task fallow(fallow dead-code --fail-on-issues) was failing onmasterwith two issues. This fixes both so the check goes green.Changes
1.
scripts/chatto-token.tsflagged as an unused file.fallowrc.jsonalready listed"scripts/"underignorePatterns, 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 thesrc/main.tsentry 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
ChattoConfigChattoConfigwas exported from bothsrc/chatto.ts(the API connection shape:baseUrl,token,roomId) andsrc/config.ts(the same three fields plus the notificationmessagetemplate), which fallow flags as a duplicate export.Resolved by making
chatto.tsthe single canonical owner ofChattoConfig, and havingconfig.tsimport it (type-only) and define a richerChattoSettings extends ChattoConfigthat adds themessagefield. This:config→chatto, the module it configures;chatto.tsstays free of bot coupling),chatto.ts/chatto_test.ts,ChattoSettingsis assignable toChattoConfig, somain.tsstill passes it straight tonotifyChatto).main.tswas updated to import/useChattoSettingsinstead of the removedconfig.tsre-export.Verification
deno task fallow→ ✓ No issues founddeno task check✅deno lint✅deno fmt --check✅deno task test→ 54 passed ✅