function-call-composed-name
Ast Rule: function call
function-call-composed-name
function visit(node, filename, code) {
if(node.functionName && node.functionName.astType === "member" &&
node.functionName.name.value === "log" &&
node.functionName.parent.astType === "string" &&
node.functionName.parent.value === "console"
){
const editChangeFunctionCall = buildEditUpdate(node.functionName.name.start.line, node.functionName.name.start.col, node.functionName.name.end.line, node.functionName.name.end.col, "info");
const fix = buildFix("use info", [editChangeFunctionCall]);
const error = buildError(node.functionName.start.line, node.functionName.start.col, node.functionName.end.line, node.functionName.end.col, "do not use function bar", "CRITICAL", "SAFETY");
addError(error.addFix(fix));
}
}
console.js
Expected test result: has error