It should be $on('$destroy', ...).
Rule based on Angular 1.x
The following patterns are considered problems;
/*eslint angular/on-destroy: 2*/
// invalid
$rootScope.$on('destroy', function () {
// ...
}); // error: You probably misspelled $on("$destroy").
The following patterns are not considered problems;
/*eslint angular/on-destroy: 2*/
// valid
$scope.$on('$destroy', function () {
// ...
});
// valid
var unregister = $rootScope.$on('$destroy', function () {
// ...
});
This rule was introduced in eslint-plugin-angular 0.1.0