Vienna Vienna - 3 months ago 44
TypeScript Question

Use Lifecycle Interface in Angular 2

What exactly does this rule effectuate?

"use-life-cycle-interface": true,

Answer

It's not a built-in tslint rule. It's a rule that's defined by codelyzer.

The GitHub repo has a video (that I've not watched), but little documentation. Fortunately, the author has implemented tests, so it's possible to infer what the use-life-cycle-interface rule does from its test descriptions:

it(`should fail, when a life cycle hook is used without implementing it's interface`, ...
it(`should fail, when life cycle hooks are used without implementing their interfaces`,  ...
it(`should fail, when some of the life cycle hooks are used without implementing their interfaces`, ...