code: function findLastAssignedValue(scope, name) {
    const results = [];
  
    traverseShallow(scope.path.node, {
      visitAssignmentExpression: function(path) {
        const node = path.node;
        // Skip anything that is not an assignment to a variable with the
        // passed name.
        if (
          !t.Identifier.check(node.left) ||
          node.left.name !== name ||
          node.operator !== '='
        ) {
          return this.traverse(path);
        }
        results.push(path.get('right'));
        return false;
      },
    });
  
    if (results.length === 0) {
      return null;
    }
    return resolveToValue(results.pop());
  }
docs: Tries to find the last value assigned to `name` in the scope created by
  `scope`. We are not descending into any statements (blocks).