Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

chore(ui): add no-console lint ratchet and strip console from prod builds

Yuneng Jiang76a9f7b5f3be
diff --git a/ui/litellm-dashboard/eslint-budgets.json b/ui/litellm-dashboard/eslint-budgets.json
index 2139d177512..4ba3581379f 100644
--- a/ui/litellm-dashboard/eslint-budgets.json
+++ b/ui/litellm-dashboard/eslint-budgets.json
@@ -1,5 +1,6 @@
{
"@typescript-eslint/no-explicit-any": { "max": 2040, "target": 1500 },
+ "no-console": { "max": 486, "target": 0 },
"complexity": { "max": 140, "target": 80 },
"max-depth": { "max": 70, "target": 30 }
}
diff --git a/ui/litellm-dashboard/eslint-metrics.json b/ui/litellm-dashboard/eslint-metrics.json
index cf754a1bb75..82afa1cbaaa 100644
--- a/ui/litellm-dashboard/eslint-metrics.json
+++ b/ui/litellm-dashboard/eslint-metrics.json
@@ -1,5 +1,6 @@
{
"@typescript-eslint/no-explicit-any": 1991,
"complexity": 128,
- "max-depth": 59
+ "max-depth": 59,
+ "no-console": 486
}
diff --git a/ui/litellm-dashboard/eslint.config.mjs b/ui/litellm-dashboard/eslint.config.mjs
index 10caebb5196..acdd0c91309 100644
--- a/ui/litellm-dashboard/eslint.config.mjs
+++ b/ui/litellm-dashboard/eslint.config.mjs
@@ -17,6 +17,7 @@ const eslintConfig = [
rules: {
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/no-explicit-any": "warn",
+ "no-console": ["warn", { allow: ["warn", "error"] }],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/ban-ts-comment": "off",
diff --git a/ui/litellm-dashboard/next.config.mjs b/ui/litellm-dashboard/next.config.mjs
index 19a2ca298fe..9cfddfd33ca 100644
--- a/ui/litellm-dashboard/next.config.mjs
+++ b/ui/litellm-dashboard/next.config.mjs
@@ -7,6 +7,9 @@ const __dirname = path.dirname(__filename);
const nextConfig = {
output: "export",
+ compiler: {
+ removeConsole: process.env.NODE_ENV === "production" ? { exclude: ["error"] } : false,
+ },
// Required with output: "export" — default image optimizer runs only in server mode.
// See https://nextjs.org/docs/messages/export-image-api
images: {