code: function isReferencedInClosure(variable) {
      const enclosingFunctionScope = getEnclosingFunctionScope(variable.scope);
  
      return variable.references.some(reference =>
          getEnclosingFunctionScope(reference.from) !== enclosingFunctionScope);
  }
docs: Checks whether the given variable has any references from a more specific
  function expression (i.e. a closure).
  
  @param {eslint-scope.Variable} variable - A variable to check.
  @returns {boolean} `true` if the variable is used from a closure.