Files
flying-hero 96f6318101 📦 添加虚拟环境和启动脚本
新增:
- backend/venv/ - Python 虚拟环境
- backend/start.sh - 启动脚本(使用虚拟环境)
- backend/requirements.txt - 依赖列表
- .gitignore - 忽略虚拟环境和缓存文件

说明:
- 每个项目使用独立虚拟环境
- 避免依赖冲突
- 启动脚本自动创建和激活虚拟环境
2026-04-04 18:29:02 +08:00

87 lines
2.0 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _experimentalUtils = require("@typescript-eslint/experimental-utils");
var _utils = require("./utils");
var _default = (0, _utils.createRule)({
name: __filename,
meta: {
docs: {
category: 'Best Practices',
description: 'Enforces a maximum depth to nested describe calls',
recommended: false
},
messages: {
exceededMaxDepth: 'Too many nested describe calls ({{ depth }}). Maximum allowed is {{ max }}.'
},
type: 'suggestion',
schema: [{
type: 'object',
properties: {
max: {
type: 'integer',
minimum: 0
}
},
additionalProperties: false
}]
},
defaultOptions: [{
max: 5
}],
create(context, [{
max
}]) {
const describeCallbackStack = [];
function pushDescribeCallback(node) {
const {
parent
} = node;
if ((parent === null || parent === void 0 ? void 0 : parent.type) !== _experimentalUtils.AST_NODE_TYPES.CallExpression || !(0, _utils.isDescribeCall)(parent)) {
return;
}
describeCallbackStack.push(0);
if (describeCallbackStack.length > max) {
context.report({
node: parent,
messageId: 'exceededMaxDepth',
data: {
depth: describeCallbackStack.length,
max
}
});
}
}
function popDescribeCallback(node) {
const {
parent
} = node;
if ((parent === null || parent === void 0 ? void 0 : parent.type) === _experimentalUtils.AST_NODE_TYPES.CallExpression && (0, _utils.isDescribeCall)(parent)) {
describeCallbackStack.pop();
}
}
return {
FunctionExpression: pushDescribeCallback,
'FunctionExpression:exit': popDescribeCallback,
ArrowFunctionExpression: pushDescribeCallback,
'ArrowFunctionExpression:exit': popDescribeCallback
};
}
});
exports.default = _default;