Disallow using element event actions (e.g., onclick={{action}}) in templates. Use the {{on}} modifier instead.
This rule disallows the use of element event actions in templates.
Examples of incorrect code for this rule:
<template>
<button onclick={{this.handleClick}}>Click</button>
</template><template>
<div onmouseenter={{this.handleHover}}>Hover</div>
</template>Examples of correct code for this rule:
<template>
<button {{on "click" this.handleClick}}>Click</button>
</template><template>
<div {{on "mouseenter" this.handleHover}}>Hover</div>
</template>| Name | Type | Default | Description |
|---|---|---|---|
requireActionHelper |
boolean |
false |
When true, only flags events using {{action ...}}; when false, flags any dynamic value on event attributes. |