shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
68.53k stars 4.06k forks source link

[bug]: 'k' is defined but never used. #4225

Open Kazooki123 opened 2 months ago

Kazooki123 commented 2 months ago

Describe the bug

In chart.tsx or in components/ui/charts.tsx in line 11:

export type ChartConfig = {
  [k in string]: {
  ^^
    label?: React.ReactNode
    icon?: React.ComponentType
  } & (
    | { color?: string; theme?: never }
    | { color?: never; theme: Record<keyof typeof THEMES, string> }
  )
}

An error occured saying "'k' is defined but never used.".

Any ways or solutions to fix this?

Affected component/components

chart.tsx

How to reproduce

  1. Go to components/ui/chart.tsx
  2. Check line 11

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

OS Name:                   Microsoft Windows 11 Home Single Language
OS Version:                10.0.22621 N/A Build 22621
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          asus
Registered Organization:   N/A
Product ID:                XXXXXXXXXXXXXXXXXXXX
Original Install Date:     21/07/2023, 1:48:39 pm
System Boot Time:          09/07/2024, 10:03:39 am
System Manufacturer:       ASUSTeK COMPUTER INC.
System Model:              VivoBook_ASUSLaptop X515DAP_M515DA
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.

Before submitting

shadcn commented 2 months ago

what's in your tsconfig.json?

Kazooki123 commented 2 months ago
{
  "compilerOptions": {
    "target": "es6",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}
Kazooki123 commented 2 months ago

Let me know if it's finally fixed or there is a solution. Thank you in advance.