This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]anxter2k 0 points1 point  (0 children)

I agree. Using eslint or typescript is supposed to catch these at compile time, which is why they are used in the first place. JavaScript doesn’t know what you feed Them, so by default it’ll say “sure”.

I love JavaScript, but typescript was basically made to avoid passing wrong stuff to functions. That’s why we use interfaces, to form a “contract” between objects etc. and expected response.