* Function to check if a node has an argument that is a module and * return its name. * @param {ASTNode} node The node to check * @returns {undefined | string} module name or undefined
(node)
| 36 | * @returns {undefined | string} module name or undefined |
| 37 | */ |
| 38 | function getModuleNameFromCall(node) { |
| 39 | // Node has arguments and first argument is string |
| 40 | if (node.arguments.length && isString(node.arguments[0])) { |
| 41 | return getModuleName(node.arguments[0].value.trim()); |
| 42 | } |
| 43 | |
| 44 | return undefined; |
| 45 | } |
| 46 | |
| 47 | const rules = { |
| 48 | 'Program:exit'(node) { |
no test coverage detected
searching dependent graphs…