ui: Input component's InputProps interface gives no-empty-interface ESLint error
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!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 15 (2 by maintainers)
Still happening.
Replacing the empty interface with this snippet works for me.
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>I use
.eslintignoreinstead:This method may be better than off the whole rule.
This is still an issue shound’t be closed yet
I have the same error for textArea component.
thats now working
Hey there,
You can disable the check temporally on
.eslintrc.json:Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules