function getDefineMacrosStatement(node) {
  if (!node.parent) {
    throw new Error('Node has no parent')
  }

  if (node.parent.type === 'Program') {
    return node
  }

  return getDefineMacrosStatement(node.parent)
}
We need to handle cases like "const props = defineProps(...)"
Define macros must be used only on top, so we can look for "Program" type
inside node.parent.type
@param {CallExpression|ASTNode} node
@return {ASTNode}