MCPcopy Index your code
hub / github.com/nodejs/node / CallExpression

Function CallExpression

tools/eslint-rules/no-duplicate-requires.js:36–51  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

34
35 return {
36 CallExpression(node) {
37 if (isRequireCall(node)) {
38 const [firstArg] = node.arguments;
39 if (isString(firstArg)) {
40 const moduleName = firstArg.value.trim();
41 if (requiredModules.has(moduleName)) {
42 context.report({
43 node,
44 message: `'${moduleName}' require is duplicated.`,
45 });
46 } else if (isTopLevel(node)) {
47 requiredModules.add(moduleName);
48 }
49 }
50 }
51 },
52 };
53 },
54};

Callers

nothing calls this directly

Calls 6

isTopLevelFunction · 0.85
isRequireCallFunction · 0.70
hasMethod · 0.65
addMethod · 0.65
isStringFunction · 0.50
reportMethod · 0.45

Tested by

no test coverage detected