Settings

Theme

Ask HN: Keeping TypeScript CLI options and types in sync

4 points by ilbert 2 months ago · 0 comments · 1 min read


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?

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection