💼 This rule is enabled in the following configs: strict-gjs, strict-gts.
💼 This rule is enabled in the following configs: strict-gjs, strict-gts.
Disallow chained property access on this.
Accessing deeply nested properties through this (like this.user.name) in templates makes components harder to refactor and test. It also creates tight coupling between the template and the component's internal structure. Use local variables or computed properties instead.
This rule disallows chaining property access on this in templates (e.g., this.foo.bar).
<template>
{{this.user.name}}
</template><template>
{{this.model.user.firstName}}
</template><template>
<div>{{this.data.items.length}}</div>
</template><template>
{{this.userName}}
</template><template>
{{get this.user "name"}}
</template><template>
{{userName}}
</template>