function isSetStateUpdater(node) {
  const unwrappedParentCalleeNode = astUtil.isCallExpression(node.parent)
    && astUtil.unwrapTSAsExpression(node.parent.callee);

  return unwrappedParentCalleeNode
    && unwrappedParentCalleeNode.property
    && unwrappedParentCalleeNode.property.name === 'setState'
    // Make sure we are in the updater not the callback
    && node.parent.arguments[0] === node;
}
Check if a function node is a setState updater
@param {ASTNode} node a function node
@return {boolean}