To conform to this linting rule,
this codemod will replace uses of Ember.on
with their method equivalent.
export default Component.extend({
abc: on('didInsertElement', function () { /* custom logic */ }),
});
will become
export default Component.extend({
didInsertElement() { /* custom logic */ }
});
export default Ember.Component.extend({
onSomething: Ember.on('something', function() {
}),
});
cos probably done for a reason and observer needs manual refactoring and proper testing
export default Ember.Component.extend({
a: Ember.on('init', Ember.observer('something', function() {
})),
});
soon to be deprecated, should remain as a linting error until refactored
export default Ember.Component.extend({
onDidReceiveAttrs: Ember.on('didReceiveAttrs', function({ newAttrs, oldAttrs }) {
}),
});