Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
mrudolph22
· 2y ago · 0 comments
TS tooling won’t tell you when your config value violates the constraint “isBetween(0, 100)” or “matches(Regex(…))”. Among other things.
Comments
[–]
hot_gril
2y ago
A config validator, which can be written in TS, would.
[–]
mrudolph22
OP
2y ago
In theory, yes. But I doubt that we’ll see a TS IDE plugin that underlines violated constraints with red squiggles anytime soon. :-)
[–]
hot_gril
2y ago
There are IDEs that auto-run unit tests and highlight exceptions thrown in the main or test code, which wouldn't be far off.
[–]
rockwotj
2y ago
Agreed, runtime checks can be implemented in typescript - that’s the beauty of it