Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

ci(web): enforce linting and resolve lint issues (#2647)

Marc Klingen6f0c66111403
diff --git a/web/package.json b/web/package.json
index 6fd218d86a..33ce1e3a6c 100644
--- a/web/package.json
+++ b/web/package.json
@@ -9,7 +9,7 @@
"scripts": {
"build": "INLINE_RUNTIME_CHUNK=false dotenv -e ../.env -- next build",
"dev": "dotenv -e ../.env -- next dev",
- "lint": "dotenv -e ../.env -- next lint",
+ "lint": "dotenv -e ../.env -- next lint --max-warnings 0",
"lint:fix": "dotenv -e ../.env -- next lint --fix",
"prettier": "prettier --write ./src *.{ts,js}",
"clean": "rm -rf node_modules",
diff --git a/web/src/__tests__/prompts.v1.servertest.ts b/web/src/__tests__/prompts.v1.servertest.ts
index d9caadf344..a7ddbb574a 100644
--- a/web/src/__tests__/prompts.v1.servertest.ts
+++ b/web/src/__tests__/prompts.v1.servertest.ts
@@ -219,7 +219,7 @@ describe("/api/public/prompts API Endpoint", () => {
});
// Third prompt is deactivated
- const prompt3 = await makeAPICall("POST", "/api/public/prompts", {
+ await makeAPICall("POST", "/api/public/prompts", {
name: "prompt-name",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
prompt: "prompt3",
diff --git a/web/src/__tests__/test-utils.ts b/web/src/__tests__/test-utils.ts
index 8a9af558ca..40cf79757f 100644
--- a/web/src/__tests__/test-utils.ts
+++ b/web/src/__tests__/test-utils.ts
@@ -3,7 +3,7 @@ import { hash } from "bcryptjs";
import { env } from "@/src/env.mjs";
import { getDisplaySecretKey, hashSecretKey } from "@langfuse/shared";
import { prisma } from "@langfuse/shared/src/db";
-import { type z, ZodObject } from "zod";
+import { type z } from "zod";
export const pruneDatabase = async () => {
if (!env.DATABASE_URL.includes("localhost:5432")) {
diff --git a/web/src/components/trace/index.tsx b/web/src/components/trace/index.tsx
index 407021bc8a..1fe9eb2f31 100644
--- a/web/src/components/trace/index.tsx
+++ b/web/src/components/trace/index.tsx
@@ -102,6 +102,7 @@ export function Trace(props: {
const expandAll = useCallback(() => {
capture("trace_detail:observation_tree_expand", { type: "all" });
setCollapsedObservations([]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
diff --git a/web/src/ee/features/playground/page/components/SaveToPromptButton.tsx b/web/src/ee/features/playground/page/components/SaveToPromptButton.tsx
index 25f8dc7999..d01b6b614c 100644
--- a/web/src/ee/features/playground/page/components/SaveToPromptButton.tsx
+++ b/web/src/ee/features/playground/page/components/SaveToPromptButton.tsx
@@ -28,7 +28,6 @@ import { useIsEeEnabled } from "@/src/ee/utils/useIsEeEnabled";
export const SaveToPromptButton: React.FC = () => {
const isEeEnabled = useIsEeEnabled();
- const [open, setOpen] = useState(false);
const [selectedPromptId, setSelectedPromptId] = useState("");
const { modelParams, messages, output, promptVariables } =
usePlaygroundContext();
@@ -115,7 +114,6 @@ export const SaveToPromptButton: React.FC = () => {
setSelectedPromptId(
currentValue === selectedPromptId ? "" : currentValue,
);
- setOpen(false);
}}
>
<Check
diff --git a/web/src/features/column-visibility/hooks/useColumnVisibility.ts b/web/src/features/column-visibility/hooks/useColumnVisibility.ts
index d31cab906b..747fe57477 100644
--- a/web/src/features/column-visibility/hooks/useColumnVisibility.ts
+++ b/web/src/features/column-visibility/hooks/useColumnVisibility.ts
@@ -36,6 +36,7 @@ function useColumnVisibility<TData>(
if (!isEqual(initialColumnVisibility, columnVisibility)) {
setColumnVisibility(initialColumnVisibility);
}
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [columnVisibility, setColumnVisibility]);
return [columnVisibility, setColumnVisibility] as const;
diff --git a/web/src/sentry.client.config.ts b/web/src/sentry.client.config.ts
index 483327703a..47d05593c0 100644
--- a/web/src/sentry.client.config.ts
+++ b/web/src/sentry.client.config.ts
@@ -1,4 +1,3 @@
-import { env } from "@/src/env.mjs";
import * as Sentry from "@sentry/nextjs";
if (process.env.NEXT_PUBLIC_SENTRY_DSN)
diff --git a/web/src/server/api/routers/sessions.ts b/web/src/server/api/routers/sessions.ts
index 6b34697ecd..6447142ab5 100644
--- a/web/src/server/api/routers/sessions.ts
+++ b/web/src/server/api/routers/sessions.ts
@@ -9,7 +9,6 @@ import {
type SessionOptions,
getSessionTableSQL,
} from "@langfuse/shared";
-import * as Sentry from "@sentry/node";
import { Prisma } from "@langfuse/shared/src/db";
import { paginationZod } from "@langfuse/shared";
import { throwIfNoAccess } from "@/src/features/rbac/utils/checkAccess";
diff --git a/web/src/server/api/services/EventProcessor.ts b/web/src/server/api/services/EventProcessor.ts
index 757f2812f2..596dbaa481 100644
--- a/web/src/server/api/services/EventProcessor.ts
+++ b/web/src/server/api/services/EventProcessor.ts
@@ -817,7 +817,7 @@ export class SdkLogProcessor implements EventProcessor {
this.event = event;
}
- process(apiScope: ApiAccessScope) {
+ process() {
try {
console.log("SDK Log", this.event);
return undefined;