🔧 This rule is automatically fixable by the --fix CLI option.
HBS Only: This rule applies to classic
.hbstemplate files only (loose mode). It is not relevant forgjs/gtsfiles (strict mode), where these patterns cannot occur.
Disallow usage of {{action}} modifiers in templates.
The {{action}} modifier has been deprecated in favor of the {{on}} modifier. The {{on}} modifier provides a more explicit and flexible way to handle events.
This rule disallows using {{action}} as an element modifier.
The following values are valid configuration:
- boolean --
truefor enabled /falsefor disabled - array -- an allowlist of element tag names, which will accept action modifiers
For example, to allow action modifiers only on specific elements:
module.exports = {
rules: {
'ember/template-no-action-modifiers': ['error', { allowlist: ['form'] }],
},
};| Name | Type | Default | Description |
|---|---|---|---|
allowlist |
string[] |
[] |
List of element tag names where {{action}} modifiers should be allowed |
The option can be passed as an array (shorthand) or an object:
Shorthand:
{
"ember/template-no-action-modifiers": ["error", ["button"]]
}Object form:
{
"ember/template-no-action-modifiers": ["error", { "allowlist": ["button"] }]
}