My short TypeScript wish list: - Only allowing `Error` instances to be thrown - Enforcing that interpolated values in template literals are strings
-
-
What's the advantage of requiring String(), other than needless verbosity?
-
So you're explicit and don't accidentally coerce things to strings that shouldn't be. I constantly refactor code and turn things from strings into other object representations. I'm constantly finding places where my logging was broken because it would just be [object Object]
- 1 more reply
New conversation -
-
-
AFAIK in React (suspense), throwing a promise is a pattern
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
It's not TS responsibility to block anti-patterns (that's for "soft" linters)
-
Well that's easy to disprove. If by "blocking" we mean "creating a type error which requires additional code to silence" and by "anti-patterns" we mean "patterns that are more likely to cause runtime errors" You've come close to defining the core purpose of TypeScript.
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 