With Typescript version 2.4 weak type detection was added. Now I agree this is a great feature and will help catch a whole bunch of bugs for when you are assigning a value to a type that doesn't have a single property match for the type's optional properties.
Unfortunately for a large project originally written in Javascript and then migrated to Typescript there will be cases where the weak type loophole is used.
To allow for an easy migration to TS 2.4 and then the gradual removal of all weak type offences - is anyone aware of a flag or hack to disable the weak type detection temporarily?
There is no compiler flag, but I can recommend you ts-migrate. It will transform your existing js to ts code with
any
where inference does not work.