Menu

Reddit - Please wait for verification
📰
0

Reddit - Please wait for verification

TypeScript·/u/youngsenpaipai·3 days ago
#Q7rXCv3N
Reading 0:00
15s threshold

Shipped v1.0.0 of merlin-commit (interactive CLI for conventional commits). More useful to share what building it strict TypeScript + ESM-only actually taught me. ESM-only is cleaner than I expected, once you commit. execa v9 and chalk v5 are both ESM-only, which forced the decision early. The catch: you need .js extensions on all relative imports even when the source is .ts. TypeScript resolves these at compile time, but it's unintuitive the first time you see it. noUnusedLocals does not catch unused exports. Spent too long wondering why dead code was surviving - noUnusedLocals: true only works within a module boundary. For exported symbols you need a linter rule or ts-prune. This surprised me. Type-safe config validation without Zod. The config lives at ~/.merlinrc.json, fully user-controlled. I wrote validateConfig(unknown): Partial that narrows field-by-field manually.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More