✅ The "extends": "plugin:ember/recommended"
property in a configuration file enables this rule.
Always use closure actions (according to DDAU convention). Exception: only when you need bubbling.
export default Controller.extend({
actions: {
detonate() {
alert('Kabooom');
}
}
});
Examples of incorrect code for this rule:
// awful-component.js
export default Component.extend({
actions: {
pushLever() {
this.sendAction('detonate');
}
}
});
Examples of correct code for this rule:
// pretty-component.js
export default Component.extend({
actions: {
pushLever() {
this.boom();
}
}
});
- RFC to deprecate
sendAction