How to filter particular TypeScript errors in build result

Hi interwebz. I just want to share this short poor man’s fix when migrating TypeScript to filter out some particular errors in TypeScript build. Why the hell you (might) need it? So what would be the common use case , why to bother mask/mute errors…

How to exclude some files from TypeScript build

If you are using TypeScript nightly (and only with TypeScript 1.6 up) you can use in your tsconfig.json new property exclude which will mostly be used for node_modules like this (more on this here : http://blogs.msdn.com/b/typescript/archive/2015/07/27/introducing-typescript-nightlies.aspx) : [javascript] { "compilerOptions": { "out": "../../built/local/tsc.js", "sourceMap": true…

How to force types in Array with TypeScript’s union types

From TypeScript 1.4 we can do nice stuff with types now, with help of feature called Union Types : https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#union-types which will let you do also this sweet stuff : You can see this in action on this link : http://www.typescriptlang.org/Playground Sample snippet here :…