🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
chore(eslint): widen root margin rule to all components (#16931)
Ben Bachem5839e889d20e
diff --git a/web/eslint.config.mjs b/web/eslint.config.mjsindex baa18d5bd3..b571fc4073 100644--- a/web/eslint.config.mjs+++ b/web/eslint.config.mjs@@ -190,13 +190,6 @@ export default [},rules: {...reactYouMightNotNeedAnEffect.configs.recommended.rules,- // Margin makes components harder to compose and should therefore be applied by the parent.- // See: https://mxstbr.com/thoughts/margin for a discussion of this pattern.- // TODO: Consider expanding this rule beyond design-system components- "@repo/no-margin-on-root-elements": [- "warn",- { classNameFunctions: ["cn", "clsx"] },- ],"boundaries/dependencies": ["error",{@@ -226,6 +219,20 @@ export default [},},+ {+ name: "langfuse/web/component-margin-rules",+ files: ["src/components/**/*.{ts,tsx}"],+ ignores: ["src/components/**/*.stories.{ts,tsx}"],+ rules: {+ // Margin makes components harder to compose and should therefore be applied by the parent.+ // See: https://mxstbr.com/thoughts/margin for a discussion of this pattern.+ "@repo/no-margin-on-root-elements": [+ "warn",+ { classNameFunctions: ["cn", "clsx"] },+ ],+ },+ },+// We're using the in-app-agent directory as a testing ground for some new eslint-rules.{...reactYouMightNotNeedAnEffect.configs.recommended,diff --git a/web/src/components/ChatMessages/ToolCallCard.tsx b/web/src/components/ChatMessages/ToolCallCard.tsxindex 89ea1599ea..d4ffe382f3 100644--- a/web/src/components/ChatMessages/ToolCallCard.tsx+++ b/web/src/components/ChatMessages/ToolCallCard.tsx@@ -1,3 +1,4 @@+/* eslint-disable @repo/no-margin-on-root-elements */import { type LLMToolCall } from "@langfuse/shared";import { PrettyJsonView } from "@/src/components/ui/PrettyJsonView";diff --git a/web/src/components/ScoreBadge/ScoreBadge.tsx b/web/src/components/ScoreBadge/ScoreBadge.tsxindex f963bc3fab..8bb6371884 100644--- a/web/src/components/ScoreBadge/ScoreBadge.tsx+++ b/web/src/components/ScoreBadge/ScoreBadge.tsx@@ -1,3 +1,4 @@+/* eslint-disable @repo/no-margin-on-root-elements */import { type LastUserScore, type ScoreDomain } from "@langfuse/shared";import {BracesIcon,diff --git a/web/src/components/date-picker.tsx b/web/src/components/date-picker.tsxindex e8408a6dbf..3c44088490 100644--- a/web/src/components/date-picker.tsx+++ b/web/src/components/date-picker.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props, @repo/no-abstracted-overlay-trigger */+/* eslint-disable @repo/no-style-props, @repo/no-abstracted-overlay-trigger, @repo/no-margin-on-root-elements */"use client";import * as React from "react";diff --git a/web/src/components/layouts/header.tsx b/web/src/components/layouts/header.tsxindex aaf9c17cea..5ba4a16495 100644--- a/web/src/components/layouts/header.tsx+++ b/web/src/components/layouts/header.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */import Link from "next/link";import DocPopup from "@/src/components/layouts/doc-popup";import { Badge } from "@/src/components/ui/badge";diff --git a/web/src/components/layouts/page-tabs.tsx b/web/src/components/layouts/page-tabs.tsxindex c9c188ddf2..d6b596f2e0 100644--- a/web/src/components/layouts/page-tabs.tsx+++ b/web/src/components/layouts/page-tabs.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */import { cn } from "@/src/utils/tailwind";import Link from "next/link";import { useRouter } from "next/router";diff --git a/web/src/components/layouts/settings-table-card.tsx b/web/src/components/layouts/settings-table-card.tsxindex f0717d7627..6bc913dd92 100644--- a/web/src/components/layouts/settings-table-card.tsx+++ b/web/src/components/layouts/settings-table-card.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */import { Card } from "@/src/components/ui/card";import { cn } from "@/src/utils/tailwind";diff --git a/web/src/components/nav/nav-main.tsx b/web/src/components/nav/nav-main.tsxindex 996041961f..9e3f7e1131 100644--- a/web/src/components/nav/nav-main.tsx+++ b/web/src/components/nav/nav-main.tsx@@ -1,3 +1,4 @@+/* eslint-disable @repo/no-margin-on-root-elements */"use client";import { type LucideIcon } from "lucide-react";import {diff --git a/web/src/components/session/ModernSessionSidebar.tsx b/web/src/components/session/ModernSessionSidebar.tsxindex 24599baa97..3970b985dc 100644--- a/web/src/components/session/ModernSessionSidebar.tsx+++ b/web/src/components/session/ModernSessionSidebar.tsx@@ -1,3 +1,4 @@+/* eslint-disable @repo/no-margin-on-root-elements */import React, { useCallback, useRef } from "react";import { useVirtualizer } from "@tanstack/react-virtual";import {diff --git a/web/src/components/table/data-table-controls.tsx b/web/src/components/table/data-table-controls.tsxindex adf7a2b597..baf56fcc63 100644--- a/web/src/components/table/data-table-controls.tsx+++ b/web/src/components/table/data-table-controls.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */import {type default as React,createContext,diff --git a/web/src/components/table/data-table-multi-select-actions/data-table-select-all-banner.tsx b/web/src/components/table/data-table-multi-select-actions/data-table-select-all-banner.tsxindex 96ac005783..16ce9a74c5 100644--- a/web/src/components/table/data-table-multi-select-actions/data-table-select-all-banner.tsx+++ b/web/src/components/table/data-table-multi-select-actions/data-table-select-all-banner.tsx@@ -1,3 +1,4 @@+/* eslint-disable @repo/no-margin-on-root-elements */import { type MultiSelect } from "@/src/components/table/data-table-toolbar";import { Button } from "@/src/components/ui/button";import { numberFormatter } from "@/src/utils/numbers";diff --git a/web/src/components/ui/alert-dialog.tsx b/web/src/components/ui/alert-dialog.tsxindex 5f972d47f6..de704b20af 100644--- a/web/src/components/ui/alert-dialog.tsx+++ b/web/src/components/ui/alert-dialog.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";import * as React from "react";diff --git a/web/src/components/ui/command.tsx b/web/src/components/ui/command.tsxindex dfffd66be6..976d9df4e7 100644--- a/web/src/components/ui/command.tsx+++ b/web/src/components/ui/command.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";import * as React from "react";diff --git a/web/src/components/ui/dialog.tsx b/web/src/components/ui/dialog.tsxindex b22ec8dc23..41887c8bfc 100644--- a/web/src/components/ui/dialog.tsx+++ b/web/src/components/ui/dialog.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";import * as React from "react";diff --git a/web/src/components/ui/drawer.tsx b/web/src/components/ui/drawer.tsxindex 11abcbc3b8..d74fe211b9 100644--- a/web/src/components/ui/drawer.tsx+++ b/web/src/components/ui/drawer.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";import * as React from "react";diff --git a/web/src/components/ui/dropdown-menu.tsx b/web/src/components/ui/dropdown-menu.tsxindex eb1e1f9b48..3b64c2fa6a 100644--- a/web/src/components/ui/dropdown-menu.tsx+++ b/web/src/components/ui/dropdown-menu.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";import * as React from "react";diff --git a/web/src/components/ui/input-command.tsx b/web/src/components/ui/input-command.tsxindex d3ed8b755c..ab72609870 100644--- a/web/src/components/ui/input-command.tsx+++ b/web/src/components/ui/input-command.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";// Adapted command to be used as a form field with suggestionsdiff --git a/web/src/components/ui/select.tsx b/web/src/components/ui/select.tsxindex 68aeb23808..3e4592c023 100644--- a/web/src/components/ui/select.tsx+++ b/web/src/components/ui/select.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";import * as React from "react";diff --git a/web/src/components/ui/sidebar.tsx b/web/src/components/ui/sidebar.tsxindex 3d4265c7e7..977279dbd8 100644--- a/web/src/components/ui/sidebar.tsx+++ b/web/src/components/ui/sidebar.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";import * as React from "react";diff --git a/web/src/components/ui/splash-screen.tsx b/web/src/components/ui/splash-screen.tsxindex 9cc4c54926..856db4e7f0 100644--- a/web/src/components/ui/splash-screen.tsx+++ b/web/src/components/ui/splash-screen.tsx@@ -1,3 +1,4 @@+/* eslint-disable @repo/no-margin-on-root-elements */import React, { useState } from "react";import { cn } from "@/src/utils/tailwind";import Image from "next/image";diff --git a/web/src/components/ui/table.tsx b/web/src/components/ui/table.tsxindex fd409d5629..e46cb895fa 100644--- a/web/src/components/ui/table.tsx+++ b/web/src/components/ui/table.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */import * as React from "react";import { Button } from "@/src/components/ui/button";diff --git a/web/src/components/ui/tabs-bar.tsx b/web/src/components/ui/tabs-bar.tsxindex 33dcaee1b7..dfbf0ab280 100644--- a/web/src/components/ui/tabs-bar.tsx+++ b/web/src/components/ui/tabs-bar.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";import * as React from "react";diff --git a/web/src/components/ui/tabs.tsx b/web/src/components/ui/tabs.tsxindex 2063a1e211..cc4804c954 100644--- a/web/src/components/ui/tabs.tsx+++ b/web/src/components/ui/tabs.tsx@@ -1,4 +1,4 @@-/* eslint-disable @repo/no-style-props */+/* eslint-disable @repo/no-style-props, @repo/no-margin-on-root-elements */"use client";import * as React from "react";