'How to specify type of literal object and comply with TSLint?

TSLint marks both of these as errors:
const a = {} as MyClass; // no-object-literal-type-assertion
const a = <MyClass>{}; // no-angle-bracket-type-assertion

And advices to use explicit typing:
let a: MyClass

But what should you use when just using literals and not assignments?
return { name: 'john' } as MyClass
return <MyClass> { name: 'john' }

What alternative can be used there without declaring a variable?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source