JavaScript libraries should be written in TypeScript
Absolutely not. This is the opposite of what you should do in my opinion.<p>If you&#x27;re writing an API to be consumed in language X then you need to write the API itself in language X. This will help you capture and handle edge cases, language idiosyncrasies and other similar issues the way you want.<p>Using a different language that gets transpiled into a target language also increases your surface area for bugs because now you have to worry about typescript and JavaScript bugs. After using CoffeeScript a few years back and spending HOURS debugging issues in its transpiling to JavaScript I decided it just wasn&#x27;t worth the hassle. Besides JavaScript, while not perfect, is pretty damn good.<p>I love the idea of type script but transpiling it down into a language that isn&#x27;t as type strict just seems silly to me. Now when it can be compiled to WebAssembly? Count me in.