in rules/no-directive-replace.js [50:78]
'angular?directive': function(callExpressionNode, fnNode) {
if (!fnNode || !fnNode.body) {
return;
}
var body = fnNode.body.body ? fnNode.body.body : [fnNode.body];
body.forEach(function(statement) {
if (statement.type === 'ReturnStatement' || statement.type === 'ObjectExpression') {
// get potential replace node by argument name of empty string for object expressions
var potentialNodes = potentialReplaceNodes[''];
if (statement.argument) {
potentialNodes = potentialReplaceNodes[statement.argument.name || ''];
}
if (!potentialNodes) {
return;
}
potentialNodes.forEach(function(report) {
var block = statement.parent.type === 'ArrowFunctionExpression' ? statement : statement.parent;
// only reports nodes that belong to the same expression
if (report.block === block) {
context.report(report.node, 'Directive definition property replace is deprecated.');
}
});
}
});
},