Files
hive/frontend/node_modules/eslint/lib/rules/no-await-in-loop.js
anthonyrawlins 85bf1341f3 Add comprehensive frontend UI and distributed infrastructure
Frontend Enhancements:
- Complete React TypeScript frontend with modern UI components
- Distributed workflows management interface with real-time updates
- Socket.IO integration for live agent status monitoring
- Agent management dashboard with cluster visualization
- Project management interface with metrics and task tracking
- Responsive design with proper error handling and loading states

Backend Infrastructure:
- Distributed coordinator for multi-agent workflow orchestration
- Cluster management API with comprehensive agent operations
- Enhanced database models for agents and projects
- Project service for filesystem-based project discovery
- Performance monitoring and metrics collection
- Comprehensive API documentation and error handling

Documentation:
- Complete distributed development guide (README_DISTRIBUTED.md)
- Comprehensive development report with architecture insights
- System configuration templates and deployment guides

The platform now provides a complete web interface for managing the distributed AI cluster
with real-time monitoring, workflow orchestration, and agent coordination capabilities.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 08:41:59 +10:00

107 lines
2.7 KiB
JavaScript

/**
* @fileoverview Rule to disallow uses of await inside of loops.
* @author Nat Mote (nmote)
*/
"use strict";
/**
* Check whether it should stop traversing ancestors at the given node.
* @param {ASTNode} node A node to check.
* @returns {boolean} `true` if it should stop traversing.
*/
function isBoundary(node) {
const t = node.type;
return (
t === "FunctionDeclaration" ||
t === "FunctionExpression" ||
t === "ArrowFunctionExpression" ||
/*
* Don't report the await expressions on for-await-of loop since it's
* asynchronous iteration intentionally.
*/
(t === "ForOfStatement" && node.await === true)
);
}
/**
* Check whether the given node is in loop.
* @param {ASTNode} node A node to check.
* @param {ASTNode} parent A parent node to check.
* @returns {boolean} `true` if the node is in loop.
*/
function isLooped(node, parent) {
switch (parent.type) {
case "ForStatement":
return (
node === parent.test ||
node === parent.update ||
node === parent.body
);
case "ForOfStatement":
case "ForInStatement":
return node === parent.body;
case "WhileStatement":
case "DoWhileStatement":
return node === parent.test || node === parent.body;
default:
return false;
}
}
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow `await` inside of loops",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-await-in-loop"
},
schema: [],
messages: {
unexpectedAwait: "Unexpected `await` inside a loop."
}
},
create(context) {
/**
* Validate an await expression.
* @param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate.
* @returns {void}
*/
function validate(awaitNode) {
if (awaitNode.type === "ForOfStatement" && !awaitNode.await) {
return;
}
let node = awaitNode;
let parent = node.parent;
while (parent && !isBoundary(parent)) {
if (isLooped(node, parent)) {
context.report({
node: awaitNode,
messageId: "unexpectedAwait"
});
return;
}
node = parent;
parent = parent.parent;
}
}
return {
AwaitExpression: validate,
ForOfStatement: validate
};
}
};