in rules/controller-as-vm.js [53:74]
function reportBadUses() {
if (controllerFunctions.length > 0 || controllerNameMatcher) {
badCaptureStatements.forEach(function(item) {
item.parents.filter(isControllerFunction).forEach(function() {
context.report(item.stmt, 'You should assign "this" to a consistent variable across your project: {{capture}}',
{
capture: viewModelName
}
);
});
});
badStatements.forEach(function(item) {
item.parents.filter(isControllerFunction).forEach(function() {
context.report(item.stmt, 'You should not use "this" directly. Instead, assign it to a variable called "{{capture}}"',
{
capture: viewModelName
}
);
});
});
}
}