function getOverrideConfig(node) {
      if (!hasElementOverrides) {
        return;
      }

      const allAncestorElements = getJSXElementAncestors(node);
      if (!allAncestorElements.length) {
        return;
      }

      for (const ancestorElement of allAncestorElements) {
        const isClosestJSXAncestor = ancestorElement === allAncestorElements[0];

        const ancestor = getJSXElementName(ancestorElement);
        if (ancestor) {
          if (ancestor.name) {
            const ancestorElements = config.elementOverrides[ancestor.name];
            const ancestorConfig = ancestor.compoundName
              ? config.elementOverrides[ancestor.compoundName] || ancestorElements
              : ancestorElements;

            if (ancestorConfig) {
              if (isClosestJSXAncestor || ancestorConfig.applyToNestedElements) {
                return ancestorConfig;
              }
            }
          }
        }
      }
    }
Gets an override config for a given node. For any given node, we also
need to traverse the ancestor tree to determine if an ancestor's config
will also apply to the current node.
@param {ASTNode} node
@returns {OverrideConfig | undefined}