✅ The extends: 'recommended'
property in a configuration file enables this rule.
What's wrong with {{action}}
?
"Action" is an overloaded term in Ember parlance. Actions are:
1.) Methods on the actions
hash
actions: {
helloWorld() {}
}
2.) But also element modifiers that setup event handlers?
3.) Oh, and they are partial applied functions too:
4.) Also, they usually receive strings, but can also receive functions?
They're something we pass downward, but also something we send back up (as in Data Down, Actions Up). They are the way you interact with the DOM, except when you need to actually access the event itself, or when you use the click
method on a classic component class. The point is, if you try to ask a group of experienced Ember devs to define what an "action" is, you may get a few contradicting/overlapping opinions.
Actions have served many different purposes over the years, and this makes them difficult to learn, to teach, and to repurpose.
We wanted to separate out the different responsibilities here, and the @action
decorator was the first part of the puzzle, and the other two pieces are the {{fn}}
helper and {{on}}
modifier.
This rule forbids the following:
This rule allows the following:
to