ui icon indicating copy to clipboard operation
ui copied to clipboard

Input component's InputProps interface gives no-empty-interface ESLint error

Open maryamkhan14 opened this issue 1 year ago • 2 comments

Hi! I have a NextJS project using TypeScript, and I just installed the Input component. ESLint flags the following line of the generated input.tsx component:

export interface InputProps
  extends React.InputHTMLAttributes<HTMLInputElement> {}

With the following error: "An interface declaring no members is equivalent to its supertype." As the error message states, the InputProps interface has no members, which is causing the problem.

**Steps to Reproduce: **

  • Install shadcn with all the default options suggested by the installer.
  • Run npx shadcn-ui@latest add input
  • See the ESLint error on the InputProps interface inside the generated Input component

I'm using npm as my package manager, if it helps. Thanks!

maryamkhan14 avatar Nov 28 '23 00:11 maryamkhan14

I have the same error for textArea component.

roshan-gh avatar Jan 15 '24 23:01 roshan-gh

Same for TextArea - Even though they improve readability, it would be better to strip these off to avoid these issues. This errors breaks Vercel's build.

pedrovrima avatar Jan 31 '24 11:01 pedrovrima

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Feb 22 '24 23:02 shadcn

I don't think this should be closed - this issue causes errors on deploying into Vercel (Next 14 - App Router - t3 stack). There should be at least a solution proposed for this (either bypassing Vercel or not causing it at all).

pedrovrima avatar Feb 23 '24 01:02 pedrovrima

Agreed, still got this issue

JackHammer29 avatar Mar 03 '24 19:03 JackHammer29

This is still an issue shound't be closed yet

jomarmontuya avatar Mar 16 '24 22:03 jomarmontuya

Still happening.

Failed to compile.

./src/components/ui/input.tsx
5:18  Error: An interface declaring no members is equivalent to its supertype.  @typescript-eslint/no-empty-interface

Replacing the empty interface with this snippet works for me.

export type InputProps = React.InputHTMLAttributes<HTMLInputElement>

rokitgg avatar Jun 06 '24 21:06 rokitgg

Same error. Screenshot 2024-06-13 at 14 07 48

ZzyzxIsAlreadyTaken avatar Jun 13 '24 12:06 ZzyzxIsAlreadyTaken

I am getting the same issue and I feel it should be fixed ASAP

joywin2003 avatar Jul 17 '24 14:07 joywin2003