function isInLifeCycleMethod(node, checkAsyncSafeLifeCycles) {
  if (
    (node.type === 'MethodDefinition' || node.type === 'Property')
    && isNodeALifeCycleMethod(node, checkAsyncSafeLifeCycles)
  ) {
    return true;
  }

  if (node.parent) {
    return isInLifeCycleMethod(node.parent, checkAsyncSafeLifeCycles);
  }

  return false;
}
Returns true if the given node is inside a React Component lifecycle
method.
@param {ASTNode} node The AST node being checked.
@param {boolean} checkAsyncSafeLifeCycles
@return {boolean} True if the node is inside a lifecycle method