Using TypeScript, you can convert object literals to a class by doing the following:
let businessObj = new ScenarioController(<FormatService>{
format: x => x
});
Is there a way to prevent these types of casts in the compiler or linter?
Oftentimes, developers abuse this feature, leading to numerous maintenance issues.