A Tiny TypeScript Rant(mayberay.bearblog.dev)
mayberay.bearblog.dev
A Tiny TypeScript Rant
https://mayberay.bearblog.dev/a-tiny-typescript-rant/
2 comments
You should avoid "any" like the plague. I strongly recommend putting that into your linter.
Unknowns are also a code smell. I'm not sure they're ever necessary, but they can save a lot of grief when fighting with the type system isn't the best use of your time.
As for exceptions... I agree, but a lot of programmers hate checked exceptions.
I will add one beef: fetch should return unknown rather than any.
Unknowns are also a code smell. I'm not sure they're ever necessary, but they can save a lot of grief when fighting with the type system isn't the best use of your time.
As for exceptions... I agree, but a lot of programmers hate checked exceptions.
I will add one beef: fetch should return unknown rather than any.
Also, as you experienced, you can implement new "language restrictions" using zod or new lint rules. Making your project more resilient to version updates and creating your "language superset" that can growth with you.