Browse Source

style: fix formatting issues in chart.tsx and tsconfig.json

Fixed CI formatting failures detected by Biome:
- src/components/ui/chart.tsx: indentation adjustments (143 lines changed)
- tsconfig.json: compact array/object formatting (22 lines changed)

CI Run: https://github.com/ding113/claude-code-hub/actions/runs/22823442958

Co-Authored-By: Claude Opus 4.6 <[email protected]>
claude[bot] 1 month ago
parent
commit
0259b73d64
2 changed files with 75 additions and 90 deletions
  1. 71 72
      src/components/ui/chart.tsx
  2. 4 18
      tsconfig.json

+ 71 - 72
src/components/ui/chart.tsx

@@ -171,81 +171,80 @@ function ChartTooltipContent({
         {payload
           .filter((item: { type?: string }) => item.type !== "none")
           .map((item, index: number) => {
-              const dataKeyStr = String(item.dataKey);
-              const key = `${nameKey || item.name || dataKeyStr || "value"}`;
-              const itemConfig = getPayloadConfigFromPayload(config, item, key);
-              const indicatorColor = color || item.payload?.fill || item.color;
-
-              return (
-                <div
-                  key={dataKeyStr}
-                  className={cn(
-                    "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
-                    indicator === "dot" && "items-center"
-                  )}
-                >
-                  {formatter && item?.value !== undefined && item.name ? (
-                    formatter(
-                      (Array.isArray(item.value)
-                        ? item.value.join(", ")
-                        : item.value) as string | number,
-                      String(item.name),
-                      item as Parameters<typeof formatter>[2],
-                      index,
-                      payload
-                    )
-                  ) : (
-                    <>
-                      {itemConfig?.icon ? (
-                        <itemConfig.icon />
-                      ) : (
-                        !hideIndicator && (
-                          <div
-                            className={cn(
-                              "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
-                              {
-                                "h-2.5 w-2.5": indicator === "dot",
-                                "w-1": indicator === "line",
-                                "w-0 border-[1.5px] border-dashed bg-transparent":
-                                  indicator === "dashed",
-                                "my-0.5": nestLabel && indicator === "dashed",
-                              }
-                            )}
-                            style={
-                              {
-                                "--color-bg": indicatorColor,
-                                "--color-border": indicatorColor,
-                              } as React.CSSProperties
+            const dataKeyStr = String(item.dataKey);
+            const key = `${nameKey || item.name || dataKeyStr || "value"}`;
+            const itemConfig = getPayloadConfigFromPayload(config, item, key);
+            const indicatorColor = color || item.payload?.fill || item.color;
+
+            return (
+              <div
+                key={dataKeyStr}
+                className={cn(
+                  "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
+                  indicator === "dot" && "items-center"
+                )}
+              >
+                {formatter && item?.value !== undefined && item.name ? (
+                  formatter(
+                    (Array.isArray(item.value) ? item.value.join(", ") : item.value) as
+                      | string
+                      | number,
+                    String(item.name),
+                    item as Parameters<typeof formatter>[2],
+                    index,
+                    payload
+                  )
+                ) : (
+                  <>
+                    {itemConfig?.icon ? (
+                      <itemConfig.icon />
+                    ) : (
+                      !hideIndicator && (
+                        <div
+                          className={cn(
+                            "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
+                            {
+                              "h-2.5 w-2.5": indicator === "dot",
+                              "w-1": indicator === "line",
+                              "w-0 border-[1.5px] border-dashed bg-transparent":
+                                indicator === "dashed",
+                              "my-0.5": nestLabel && indicator === "dashed",
                             }
-                          />
-                        )
+                          )}
+                          style={
+                            {
+                              "--color-bg": indicatorColor,
+                              "--color-border": indicatorColor,
+                            } as React.CSSProperties
+                          }
+                        />
+                      )
+                    )}
+                    <div
+                      className={cn(
+                        "flex flex-1 justify-between leading-none",
+                        nestLabel ? "items-end" : "items-center"
                       )}
-                      <div
-                        className={cn(
-                          "flex flex-1 justify-between leading-none",
-                          nestLabel ? "items-end" : "items-center"
-                        )}
-                      >
-                        <div className="grid gap-1.5">
-                          {nestLabel ? tooltipLabel : null}
-                          <span className="text-muted-foreground">
-                            {itemConfig?.label || item.name}
-                          </span>
-                        </div>
-                        {item.value && (
-                          <span className="text-foreground font-mono font-medium tabular-nums">
-                            {typeof item.value === "number"
-                              ? item.value.toLocaleString()
-                              : String(item.value)}
-                          </span>
-                        )}
+                    >
+                      <div className="grid gap-1.5">
+                        {nestLabel ? tooltipLabel : null}
+                        <span className="text-muted-foreground">
+                          {itemConfig?.label || item.name}
+                        </span>
                       </div>
-                    </>
-                  )}
-                </div>
-              );
-            }
-          )}
+                      {item.value && (
+                        <span className="text-foreground font-mono font-medium tabular-nums">
+                          {typeof item.value === "number"
+                            ? item.value.toLocaleString()
+                            : String(item.value)}
+                        </span>
+                      )}
+                    </div>
+                  </>
+                )}
+              </div>
+            );
+          })}
       </div>
     </div>
   );

+ 4 - 18
tsconfig.json

@@ -1,11 +1,7 @@
 {
   "compilerOptions": {
     "target": "ES2017",
-    "lib": [
-      "dom",
-      "dom.iterable",
-      "esnext"
-    ],
+    "lib": ["dom", "dom.iterable", "esnext"],
     "allowJs": true,
     "skipLibCheck": true,
     "strict": true,
@@ -24,12 +20,8 @@
       }
     ],
     "paths": {
-      "@/*": [
-        "./src/*"
-      ],
-      "@messages/*": [
-        "./messages/*"
-      ]
+      "@/*": ["./src/*"],
+      "@messages/*": ["./messages/*"]
     }
   },
   "include": [
@@ -41,11 +33,5 @@
     ".next/dev/types/**/*.ts",
     ".next/dev/dev/types/**/*.ts"
   ],
-  "exclude": [
-    "node_modules",
-    "tests/**",
-    "docs-site",
-    ".next",
-    "dist"
-  ]
+  "exclude": ["node_modules", "tests/**", "docs-site", ".next", "dist"]
 }