code: function variablesInScope(context) {
    let scope = context.getScope();
    let variables = scope.variables;
  
    while (scope.type !== 'global') {
      scope = scope.upper;
      variables = scope.variables.concat(variables);
    }
    if (scope.childScopes.length) {
      variables = scope.childScopes[0].variables.concat(variables);
      if (scope.childScopes[0].childScopes.length) {
        variables = scope.childScopes[0].childScopes[0].variables.concat(variables);
      }
    }
  
    return variables;
  }
docs: List all variable in a given scope
  
  Contain a patch for babel-eslint to avoid https://github.com/babel/babel-eslint/issues/21
  
  @param {Object} context The current rule context.
  @param {Array} name The name of the variable to search.
  @returns {Boolean} True if the variable was found, false if not.