فهرست منبع

fix lint issues

Bernt Christian Egeland 7 ماه پیش
والد
کامیت
853b1b8978

+ 8 - 1
biome.json

@@ -1,5 +1,5 @@
 {
-	"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
+	"$schema": "https://biomejs.dev/schemas/2.3.15/schema.json",
 	"vcs": {
 		"enabled": true,
 		"clientKind": "git",
@@ -120,10 +120,17 @@
 		}
 	},
 	"css": {
+		"parser": {
+			"cssModules": true,
+			"allowWrongLineComments": true
+		},
 		"formatter": {
 			"enabled": true,
 			"indentStyle": "space",
 			"indentWidth": 2
+		},
+		"linter": {
+			"enabled": false
 		}
 	},
 	"assist": {

+ 1 - 0
package.json

@@ -8,6 +8,7 @@
     "build": "next build",
     "start": "next start",
     "lint": "biome lint .",
+    "lint:fix": "biome lint . --write",
     "format": "biome format . --write",
     "check": "biome check .",
     "check:fix": "biome check . --write"

+ 0 - 4
src/app/(authenticated)/vehicles/[id]/service/new/service-record-form.tsx

@@ -37,9 +37,7 @@ import {
   CommandItem,
   CommandList,
 } from '@/components/ui/command'
-import { Switch } from '@/components/ui/switch'
 import {
-  Camera,
   Check,
   ChevronsUpDown,
   FileText,
@@ -50,8 +48,6 @@ import {
   Plus,
   Search,
   Trash2,
-  Upload,
-  X,
 } from 'lucide-react'
 import { formatCurrency, getCurrencySymbol } from '@/lib/format'
 

+ 1 - 1
src/app/(public)/share/invoice/[orgId]/[token]/invoice-view.tsx

@@ -13,7 +13,7 @@ import {
   Paperclip,
   X,
 } from 'lucide-react'
-import { formatCurrency, formatDate as fmtDate, formatDateForPdf, DEFAULT_DATE_FORMAT } from '@/lib/format'
+import { formatCurrency, formatDate as fmtDate, DEFAULT_DATE_FORMAT } from '@/lib/format'
 
 interface InvoiceRecord {
   id: string

+ 1 - 1
src/app/api/backup/import-invoice-ninja/route.ts

@@ -548,7 +548,7 @@ export async function POST(request: NextRequest) {
     return NextResponse.json({ error: message }, { status: 500 });
   } finally {
     if (tmpDir) {
-      rm(tmpDir, { recursive: true, force: true }).catch(() => {});
+      rm(tmpDir, { recursive: true, force: true }).catch(() => { /* ignore cleanup errors */ });
     }
   }
 }

+ 1 - 1
src/app/api/backup/import-lubelog/route.ts

@@ -430,7 +430,7 @@ export async function POST(request: NextRequest) {
   } finally {
     // Clean up temp directory
     if (tmpDir) {
-      rm(tmpDir, { recursive: true, force: true }).catch(() => {});
+      rm(tmpDir, { recursive: true, force: true }).catch(() => { /* ignore cleanup errors */ });
     }
   }
 }

+ 0 - 1
src/app/api/backup/import/route.ts

@@ -16,7 +16,6 @@ function isZipBuffer(buffer: ArrayBuffer): boolean {
 
 interface BackupData {
   version: number;
-  // biome-ignore lint: backup data shape is dynamic
   data: Record<string, any>;
 }
 

+ 1 - 0
src/app/error.tsx

@@ -4,6 +4,7 @@ import { useEffect } from "react";
 import { Wrench } from "lucide-react";
 import { Button } from "@/components/ui/button";
 
+// biome-ignore lint/suspicious/noShadowRestrictedNames: Next.js error boundary convention
 export default function Error({
   error,
   reset,

+ 2 - 2
src/features/reports/Components/csv-export.ts

@@ -16,7 +16,7 @@ function downloadCsv(
   rows: Record<string, unknown>[],
   keys: string[],
 ) {
-  const escape = (v: unknown) => {
+  const escapeCsv = (v: unknown) => {
     const s = String(v ?? "");
     return s.includes(",") || s.includes('"') || s.includes("\n")
       ? `"${s.replace(/"/g, '""')}"`
@@ -25,7 +25,7 @@ function downloadCsv(
 
   const lines = [
     headers.map(escape).join(","),
-    ...rows.map((r) => keys.map((k) => escape(r[k])).join(",")),
+    ...rows.map((r) => keys.map((k) => escapeCsv(r[k])).join(",")),
   ];
 
   const blob = new Blob([lines.join("\n")], { type: "text/csv;charset=utf-8;" });