How to intentionally throw a fatal exception during build

I’d like to throw a fatal exception that prevents my app from building if I call a function without providing a required parameter, similar to what happens when there’s a lint error.

I feel like this is some fundamental technique I should know but all the search results I’ve found are about fixing some build error, not intentionally calling one.

Is this something that’s built in to TypeScript? (I’m using vanilla JS Ionic Vue.) Much appreciate any pointers!