code: function isOuterClass(variable, reference) {
      if (variable.defs[0].type !== "ClassName") {
          return false;
      }
  
      if (variable.scope.variableScope === reference.from.variableScope) {
          // allow the same scope only if it's the top level global/module scope
          if (!isTopLevelScope(variable.scope.variableScope)) {
              return false;
          }
      }
  
      return true;
  }
docs: Checks whether or not a given variable is a class declaration in an upper function scope.
  
  @param {eslint-scope.Variable} variable - A variable to check.
  @param {eslint-scope.Reference} reference - A reference to check.
  @returns {boolean} `true` if the variable is a class declaration.