I just stumbled upon the fact that TypeScript isn't quite strict checking the assignability of functions: https://www.typescriptlang.org/docs/handbook/type-compatibility.html#function-parameter-bivariance
Unfortunately, for some patterns parameter bivariance misses important type checking. So I'm wondering whether it would be possible to build a custom TSLint rule telling me when I'm doing something like this:
interface Base {}
interface BaseEx extends Base { x; }
let fn1: (a: Base) => void;
let fn2: (b: BaseEx) => void;
fn1 = fn2; // TSLint: parameter (a: BaseEx) is not assignable to (b: Base)
However, documentation on creating custom TSLint rules seems rather incomplete, I only found a single example of a purely syntactical check. I would be really happy if you could advise me a resource to learn how to extend TSLint with semantic rules like this one.