Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

build(lint): fix false-positive any matching in comments and add t11 validator to husky pre-commit hook

diegosouzapw81ebcc9a72b1
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 376d9947c6..727757cb7f 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,3 +1,4 @@
npx lint-staged
node scripts/check-docs-sync.mjs
+npm run check:any-budget:t11
npm run test:unit
diff --git a/scripts/check-t11-any-budget.mjs b/scripts/check-t11-any-budget.mjs
index 895e670a9c..b12ee1da41 100644
--- a/scripts/check-t11-any-budget.mjs
+++ b/scripts/check-t11-any-budget.mjs
@@ -110,7 +110,10 @@ for (const item of budget) {
}
const content = fs.readFileSync(absolutePath, "utf8");
- const matches = content.match(anyRegex);
+ // Remove block and line comments to avoid false positives with the word "any" in comments
+ let cleanContent = content.replace(/\/\*[\s\S]*?\*\//g, "");
+ cleanContent = cleanContent.replace(/\/\/.*$/gm, "");
+ const matches = cleanContent.match(anyRegex);
const count = matches ? matches.length : 0;
const status = count <= item.maxAny ? "OK" : "FAIL";