Skip to content

Ask HN: Keeping TypeScript CLI options and types in sync

4 pointsilbertdiscuss
On HN

Building TypeScript CLIs, I keep running into the same problem. I define an option in one place (its default, its parser, its validator) and the type for it on argv ends up declared somewhere else. After enough changes, one of them is always slightly wrong, and I find out only when something silently coerces to undefined.

Have you ever faced the same issue? How are you solving it?

Same question for printing the --help output: handwritten strings, or generated from the config?

Comments

No comments yet.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.