code: function checkForLoops(node) {
              const loopNode = getContainingLoopNode(node);
  
              if (!loopNode) {
                  return;
              }
  
              const references = context.getScope().through;
              const unsafeRefs = references.filter(r => !isSafe(loopNode, r)).map(r => r.identifier.name);
  
              if (unsafeRefs.length > 0) {
                  context.report({
                      node,
                      messageId: "unsafeRefs",
                      data: { varNames: `'${unsafeRefs.join("', '")}'` }
                  });
              }
          }
docs: Reports functions which match the following condition:
  
  - has a loop node in ancestors.
  - has any references which refers to an unsafe variable.
  
  @param {ASTNode} node The AST node to check.
  @returns {boolean} Whether or not the node is within a loop.