function findAllCallsToRequire(ast) {
  /** @type {RequireCallResult[]} */
  const matches = []
  traverse(ast, {
    CallExpression: function (path) {
      const { node } = path
      const { callee } = node
      if (callee.type !== 'Identifier') {
        return
      }
      if (callee.name !== 'require') {
        return
      }
      // ensure this is the global "require" method
      if (path.scope.hasBinding('require', true)) {
        return
      }
      matches.push(path)
    },
  })
  return matches
}
@param {import('@babel/types').Node} ast
@returns {RequireCallResult[]}