in src/rules/javascript/global-require-arg.js [11:26]
CallExpression(node) {
if (
node.callee.name === 'require' &&
node.arguments &&
node.arguments.length
) {
const firstArg = node.arguments[0];
if (firstArg.type === 'Identifier') {
const pathVar = getVariable(context, firstArg.name);
if (typeof pathVar === 'undefined') {
// We infer this is probably a global.
return context.report(node, UNEXPECTED_GLOBAL_ARG.code);
}
}
}
},