code: function getCallbackInfo(node, context) {
      const retv = { isCallback: false, isLexicalThis: false };
      let searchComplete = false;
      let currentNode = node;
      let parent = node.parent;
  
      while (currentNode && !searchComplete) {
          switch (parent.type) {
          // Checks parents recursively.
  
          case 'LogicalExpression':
          case 'ConditionalExpression':
              break;
  
              // Checks whether the parent node is `.bind(this)` call.
          case 'MemberExpression':
              if (isBindThis(parent, currentNode)) {
                  retv.isLexicalThis =
                          parent.parent.arguments.length === 1 &&
                          parent.parent.arguments[0].type === 'ThisExpression';
                  parent = parent.parent;
              } else {
                  searchComplete = true;
              }
              break;
  
              // Checks whether the node is a callback.
          case 'CallExpression':
          case 'NewExpression':
              if (parent.callee !== currentNode) {
                  retv.isCallback = true;
              }
              // Checks whether the node is a mocha function callback.
              if (retv.isCallback && astUtils.isMochaFunctionCall(parent, context.getScope())) {
                  retv.isMochaCallback = true;
              }
              searchComplete = true;
              break;
  
          default:
              searchComplete = true;
          }
  
          if (!searchComplete) {
              currentNode = parent;
              parent = parent.parent;
          }
      }
      return retv;
  }
docs: Checkes whether or not a given node is a callback.
  @param {ASTNode} node - A node to check.
  @param {object} context - The eslint context.
  @returns {Object}
  {boolean} retv.isCallback - `true` if the node is a callback.
  {boolean} retv.isMochaCallback - `true` if the node is an argument to a mocha function.
  {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`.